From 7277381533f80f40bf11a191187ef4348063351c Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Wed, 7 Mar 2018 23:23:25 -0500 Subject: [PATCH 01/97] OpenFin Application namespace in line with .30 release. --- types/openfin/v30/index.d.ts | 1756 ++++++++++++++++++++++++++++ types/openfin/v30/openfin-tests.ts | 728 ++++++++++++ types/openfin/v30/tsconfig.json | 24 + types/openfin/v30/tslint.json | 6 + types/openfin/v30/v30 | 1736 +++++++++++++++++++++++++++ 5 files changed, 4250 insertions(+) create mode 100644 types/openfin/v30/index.d.ts create mode 100644 types/openfin/v30/openfin-tests.ts create mode 100644 types/openfin/v30/tsconfig.json create mode 100644 types/openfin/v30/tslint.json create mode 100644 types/openfin/v30/v30 diff --git a/types/openfin/v30/index.d.ts b/types/openfin/v30/index.d.ts new file mode 100644 index 0000000000..1e69b3b713 --- /dev/null +++ b/types/openfin/v30/index.d.ts @@ -0,0 +1,1756 @@ +// Type definitions for OpenFin API 17.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.17.14 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Launches the given Application manifest. + */ + createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the system tray. + */ + getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Registers a username and an app name for licensing purposes. + */ + registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; + } + monitorInfo: MonitorInfo + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} diff --git a/types/openfin/v30/openfin-tests.ts b/types/openfin/v30/openfin-tests.ts new file mode 100644 index 0000000000..ce49b14f5c --- /dev/null +++ b/types/openfin/v30/openfin-tests.ts @@ -0,0 +1,728 @@ +/// + +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + //createFromManifest + fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { + console.log(app.uuid); + }, err => console.log(err)); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); + + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // getTrayIconInfo + application.getTrayIconInfo(info => { + console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, + info.monitorInfo.type, info.monitorInfo.reason); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); + //uuid + let hasUuid = application.uuid; +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

Hello Html

', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} diff --git a/types/openfin/v30/tsconfig.json b/types/openfin/v30/tsconfig.json new file mode 100644 index 0000000000..fd3199ceb7 --- /dev/null +++ b/types/openfin/v30/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "openfin-tests.ts" + ] +} \ No newline at end of file diff --git a/types/openfin/v30/tslint.json b/types/openfin/v30/tslint.json new file mode 100644 index 0000000000..64aace11d6 --- /dev/null +++ b/types/openfin/v30/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": false + } +} diff --git a/types/openfin/v30/v30 b/types/openfin/v30/v30 new file mode 100644 index 0000000000..5c40c47ae0 --- /dev/null +++ b/types/openfin/v30/v30 @@ -0,0 +1,1736 @@ +// Type definitions for OpenFin API 17.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.17.14 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Passes in custom data that will be relayed to the RVM + */ + registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} From d4d064b7c57f3feddfe25a417bed0cdf70ea214f Mon Sep 17 00:00:00 2001 From: orblazer Date: Sun, 11 Mar 2018 14:32:47 +0100 Subject: [PATCH 02/97] Fix "this" context on "on" functions --- types/ws/index.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/types/ws/index.d.ts b/types/ws/index.d.ts index 303dcc3875..fbfc3713c3 100644 --- a/types/ws/index.d.ts +++ b/types/ws/index.d.ts @@ -67,14 +67,14 @@ declare class WebSocket extends events.EventEmitter { removeEventListener(method: string, listener?: () => void): void; // Events - on(event: 'close', listener: (code: number, reason: string) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this; - on(event: 'message', listener: (data: WebSocket.Data) => void): this; - on(event: 'open' , listener: () => void): this; - on(event: 'ping' | 'pong', listener: (data: Buffer) => void): this; - on(event: 'unexpected-response', listener: (request: http.ClientRequest, response: http.IncomingMessage) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (this: WebSocket, code: number, reason: string) => void): this; + on(event: 'error', listener: (this: WebSocket, err: Error) => void): this; + on(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this; + on(event: 'message', listener: (this: WebSocket, data: WebSocket.Data) => void): this; + on(event: 'open' , listener: (this: WebSocket) => void): this; + on(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this; + on(event: 'unexpected-response', listener: (this: WebSocket, request: http.ClientRequest, response: http.IncomingMessage) => void): this; + on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this; addListener(event: 'close', listener: (code: number, message: string) => void): this; addListener(event: 'error', listener: (err: Error) => void): this; @@ -181,11 +181,11 @@ declare namespace WebSocket { shouldHandle(request: http.IncomingMessage): boolean; // Events - on(event: 'connection', cb: (socket: WebSocket, request: http.IncomingMessage) => void): this; - on(event: 'error', cb: (error: Error) => void): this; - on(event: 'headers', cb: (headers: string[], request: http.IncomingMessage) => void): this; - on(event: 'listening', cb: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'connection', cb: (this: WebSocket, socket: WebSocket, request: http.IncomingMessage) => void): this; + on(event: 'error', cb: (this: WebSocket, error: Error) => void): this; + on(event: 'headers', cb: (this: WebSocket, headers: string[], request: http.IncomingMessage) => void): this; + on(event: 'listening', cb: (this: WebSocket) => void): this; + on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this; addListener(event: 'connection', cb: (client: WebSocket) => void): this; addListener(event: 'error', cb: (err: Error) => void): this; From 15412bfd248a0efdafd8aa6641c74128d6eb5406 Mon Sep 17 00:00:00 2001 From: orblazer Date: Sun, 11 Mar 2018 14:36:07 +0100 Subject: [PATCH 03/97] Add missing contribution --- types/ws/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/ws/index.d.ts b/types/ws/index.d.ts index fbfc3713c3..7848bf3992 100644 --- a/types/ws/index.d.ts +++ b/types/ws/index.d.ts @@ -4,6 +4,7 @@ // Matt Silverlock // Margus Lamp // Philippe D'Alva +// Orblazer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 8e98757a32779cbc0c4a4fb260d490c9ad70f9ec Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Wed, 14 Mar 2018 14:05:27 +0800 Subject: [PATCH 04/97] Update index.d.ts Change accordingly to datatable. --- types/datatables.net/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index cdddc98789..7941d0586f 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1297,7 +1297,7 @@ declare namespace DataTables { /** * Data to use as the display data for the table. Since: 1.10 */ - data?: object; + data?: Object[]; //#endregion "Data" @@ -1931,6 +1931,7 @@ declare namespace DataTables { } interface ColumnLegacy { + idx: number; aDataSort: any; asSorting: string[]; bSearchable: boolean; From 68e71f096b02e611a134fb7b571fb0a6075dfefb Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Wed, 14 Mar 2018 14:46:17 +0800 Subject: [PATCH 05/97] Update index.d.ts Add style api --- types/datatables.net-select/index.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index e24f6b8ab6..5ceac21eaf 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -46,4 +46,17 @@ declare namespace DataTables { */ style?: string; } + + interface Api { + select: { + /* + * Get the current selection style applied to the table + */ + style(): string; + /* + * Set the table's selection style + */ + style(s: "api" | "single" | "multi" | "os"): Api; + } + } } From 50f05dff6452f785ad9f4e2cba9cea52cc0f7a27 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Wed, 14 Mar 2018 14:51:26 +0800 Subject: [PATCH 06/97] Update index.d.ts --- types/datatables.net-select/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index 5ceac21eaf..aa68f64969 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -44,7 +44,7 @@ declare namespace DataTables { /* * Set the selection style for end user interaction with the table */ - style?: string; + style?: "api" | "single" | "multi" | "os" | "multi+shift"; } interface Api { From c3545db618098defce0d82cb5ebe742c23b1bfe2 Mon Sep 17 00:00:00 2001 From: Mykolas Kairys Date: Thu, 15 Mar 2018 14:21:40 +0200 Subject: [PATCH 07/97] react-router-redux typings update for createMatchSelector function --- types/react-router-redux/index.d.ts | 4 ++++ types/react-router-redux/react-router-redux-tests.tsx | 6 +++++- types/react-router-redux/tslint.json | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/types/react-router-redux/index.d.ts b/types/react-router-redux/index.d.ts index 0ce965b397..89ef136014 100644 --- a/types/react-router-redux/index.d.ts +++ b/types/react-router-redux/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux // Definitions by: Huy Nguyen // Shoya Tanaka +// Mykolas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -19,6 +20,7 @@ import { LocationDescriptor } from 'history'; import * as React from 'react'; +import { match } from 'react-router'; export interface ConnectedRouterProps { store?: Store; @@ -77,3 +79,5 @@ export interface LocationChangeAction { } export function routerMiddleware(history: History): Middleware; + +export function createMatchSelector(path: string): (state: State) => match | null; diff --git a/types/react-router-redux/react-router-redux-tests.tsx b/types/react-router-redux/react-router-redux-tests.tsx index b6927fb7bf..bf2575ae26 100644 --- a/types/react-router-redux/react-router-redux-tests.tsx +++ b/types/react-router-redux/react-router-redux-tests.tsx @@ -7,7 +7,7 @@ import { Provider } from 'react-redux'; import createHistory from 'history/createBrowserHistory'; import { Route } from 'react-router'; -import { ConnectedRouter, routerReducer, routerMiddleware, push, RouterState } from 'react-router-redux'; +import { ConnectedRouter, routerReducer, routerMiddleware, push, RouterState, createMatchSelector } from 'react-router-redux'; // Create a history of your choosing (we're using a browser history in this case) const history = createHistory(); @@ -44,3 +44,7 @@ ReactDOM.render( // Now you can dispatch navigation actions from anywhere! store.dispatch(push('/foo')); + +// And match location path using createMatchSelector +const matchSelector = createMatchSelector('/:foo'); +const match = matchSelector(store.getState()); diff --git a/types/react-router-redux/tslint.json b/types/react-router-redux/tslint.json index f93cf8562a..71ee04c4e1 100644 --- a/types/react-router-redux/tslint.json +++ b/types/react-router-redux/tslint.json @@ -1,3 +1,6 @@ { - "extends": "dtslint/dt.json" + "extends": "dtslint/dt.json", + "rules": { + "no-unnecessary-generics": false + } } From 4b26c77b3ccd58041802c624b1b6f10c9ecacb1e Mon Sep 17 00:00:00 2001 From: Matthew Zartman Date: Mon, 19 Mar 2018 11:55:53 -0400 Subject: [PATCH 08/97] Adds new module to fit Meteor suggested styling --- types/meteor-roles/index.d.ts | 254 ++++++++++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) diff --git a/types/meteor-roles/index.d.ts b/types/meteor-roles/index.d.ts index 80a4b02c90..ed91f96ab5 100644 --- a/types/meteor-roles/index.d.ts +++ b/types/meteor-roles/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Meteor Roles 1.2.14 // Project: https://github.com/alanning/meteor-roles/ // Definitions by: Robbie Van Gorkom +// Matthew Zartman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -262,3 +263,256 @@ declare namespace Roles { declare namespace Meteor { var roles : Mongo.Collection; } + + +/* Declaring in the format prescribed by Meteor */ +declare module "meteor/alanning:roles" { + namespace Roles { + /** + * Constant used to reference the special 'global' group that + * can be used to apply blanket permissions across all groups. + * + * @example + * Roles.addUsersToRoles(user, 'admin', Roles.GLOBAL_GROUP) + * Roles.userIsInRole(user, 'admin') // => true + * + * Roles.setUserRoles(user, 'support-staff', Roles.GLOBAL_GROUP) + * Roles.userIsInRole(user, 'support-staff') // => true + * Roles.userIsInRole(user, 'admin') // => false + * + * @property GLOBAL_GROUP + * @type String + * @static + * @final + */ + var GLOBAL_GROUP : string; + + /** + * Subscription handle for the currently logged in user's permissions. + * + * NOTE: The corresponding publish function, `_roles`, depends on + * `this.userId` so it will automatically re-run when the currently + * logged-in user changes. + * + * @example + * + * `Roles.subscription.ready()` // => `true` if user roles have been loaded + * + * @property subscription + * @type Object + * @for Roles + */ + var subscription : Subscription; + + /** + * Add users to roles. Will create roles as needed. + * + * NOTE: Mixing grouped and non-grouped roles for the same user + * is not supported and will throw an error. + * + * Makes 2 calls to database: + * 1. retrieve list of all existing roles + * 2. update users' roles + * + * @example + * Roles.addUsersToRoles(userId, 'admin') + * Roles.addUsersToRoles(userId, ['view-secrets'], 'example.com') + * Roles.addUsersToRoles([user1, user2], ['user','editor']) + * Roles.addUsersToRoles([user1, user2], ['glorious-admin', 'perform-action'], 'example.org') + * Roles.addUsersToRoles(userId, 'admin', Roles.GLOBAL_GROUP) + * + * @method addUsersToRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles/permissions to add users to + * @param {String} [group] Optional group name. If supplied, roles will be + * specific to that group. + * Group names can not start with '$' or numbers. + * Periods in names '.' are automatically converted + * to underscores. + * The special group Roles.GLOBAL_GROUP provides + * a convenient way to assign blanket roles/permissions + * across all groups. The roles/permissions in the + * Roles.GLOBAL_GROUP group will be automatically + * included in checks for any group. + */ + function addUsersToRoles( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : void; + + /** + * Create a new role. Whitespace will be trimmed. + * + * @method createRole + * @param {String} role Name of role + * @return {String} id of new role + */ + function createRole(role : string) : string; + + /** + * Delete an existing role. Will throw "Role in use" error if any users + * are currently assigned to the target role. + * + * @method deleteRole + * @param {String} role Name of role + */ + function deleteRole (role : string) : void; + + /** + * Retrieve set of all existing roles + * + * @method getAllRoles + * @return {Cursor} cursor of existing roles + */ + function getAllRoles() : Mongo.Cursor; + + /** + * Retrieve users groups, if any + * + * @method getGroupsForUser + * @param {String|Object} user User Id or actual user object + * @param {String} [role] Optional name of roles to restrict groups to. + * + * @return {Array} Array of user's groups, unsorted. Roles.GLOBAL_GROUP will be omitted + */ + function getGroupsForUser( + user : string|Object, + role? : string + ) : string[]; + + /** + * Retrieve users roles + * + * @method getRolesForUser + * @param {String|Object} user User Id or actual user object + * @param {String} [group] Optional name of group to restrict roles to. + * User's Roles.GLOBAL_GROUP will also be included. + * @return {Array} Array of user's roles, unsorted. + */ + function getRolesForUser( + user : string|Object, + group? : string + ) : string[]; + + /** + * Retrieve all users who are in target role. + * + * NOTE: This is an expensive query; it performs a full collection scan + * on the users collection since there is no index set on the 'roles' field. + * This is by design as most queries will specify an _id so the _id index is + * used automatically. + * + * @method getUsersInRole + * @param {Array|String} role Name of role/permission. If array, users + * returned will have at least one of the roles + * specified but need not have _all_ roles. + * @param {String} [group] Optional name of group to restrict roles to. + * User's Roles.GLOBAL_GROUP will also be checked. + * @param {Object} [options] Optional options which are passed directly + * through to `Meteor.users.find(query, options)` + * @return {Cursor} cursor of users in role + */ + function getUsersInRole( + role : string|string[], + group? : string, + options? : { + sort?: Mongo.SortSpecifier; + skip?: number; + limit?: number; + fields?: Mongo.FieldSpecifier; + reactive?: boolean; + transform?: Function; + }) : Mongo.Cursor; + + /** + * Remove users from roles + * + * @example + * Roles.removeUsersFromRoles(users.bob, 'admin') + * Roles.removeUsersFromRoles([users.bob, users.joe], ['editor']) + * Roles.removeUsersFromRoles([users.bob, users.joe], ['editor', 'user']) + * Roles.removeUsersFromRoles(users.eve, ['user'], 'group1') + * + * @method removeUsersFromRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles to add users to + * @param {String} [group] Optional. Group name. If supplied, only that + * group will have roles removed. + */ + function removeUsersFromRoles( + user : string|string[]|Object|Object[], + roles? : string[], + group? : string + ) : void; + + /** + * Set a users roles/permissions. + * + * @example + * Roles.setUserRoles(userId, 'admin') + * Roles.setUserRoles(userId, ['view-secrets'], 'example.com') + * Roles.setUserRoles([user1, user2], ['user','editor']) + * Roles.setUserRoles([user1, user2], ['glorious-admin', 'perform-action'], 'example.org') + * Roles.setUserRoles(userId, 'admin', Roles.GLOBAL_GROUP) + * + * @method setUserRoles + * @param {Array|String} users User id(s) or object(s) with an _id field + * @param {Array|String} roles Name(s) of roles/permissions to add users to + * @param {String} [group] Optional group name. If supplied, roles will be + * specific to that group. + * Group names can not start with '$'. + * Periods in names '.' are automatically converted + * to underscores. + * The special group Roles.GLOBAL_GROUP provides + * a convenient way to assign blanket roles/permissions + * across all groups. The roles/permissions in the + * Roles.GLOBAL_GROUP group will be automatically + * included in checks for any group. + */ + function setUserRoles ( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : void; + + /** + * Check if user has specified permissions/roles + * + * @example + * // non-group usage + * Roles.userIsInRole(user, 'admin') + * Roles.userIsInRole(user, ['admin','editor']) + * Roles.userIsInRole(userId, 'admin') + * Roles.userIsInRole(userId, ['admin','editor']) + * + * // per-group usage + * Roles.userIsInRole(user, ['admin','editor'], 'group1') + * Roles.userIsInRole(userId, ['admin','editor'], 'group1') + * Roles.userIsInRole(userId, ['admin','editor'], Roles.GLOBAL_GROUP) + * + * // this format can also be used as short-hand for Roles.GLOBAL_GROUP + * Roles.userIsInRole(user, 'admin') + * + * @method userIsInRole + * @param {String|Object} user User Id or actual user object + * @param {String|Array} roles Name of role/permission or Array of + * roles/permissions to check against. If array, + * will return true if user is in _any_ role. + * @param {String} [group] Optional. Name of group. If supplied, limits check + * to just that group. + * The user's Roles.GLOBAL_GROUP will always be checked + * whether group is specified or not. + * @return {Boolean} true if user is in _any_ of the target roles + */ + function userIsInRole( + user : string|string[]|Object|Object[], + roles : string|string[], + group? : string + ) : boolean; + + interface Role { + name : string; + } + } +} From d88053b9f98c289f0797850a14c9ee159c7d80ab Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Mon, 19 Mar 2018 22:23:46 -0400 Subject: [PATCH 09/97] Changes added for OpenFin version .29 --- types/openfin/v29/index.d.ts | 1891 ++++++++++++++++++++++ types/openfin/v29/openfin-tests.ts | 797 +++++++++ types/openfin/{v30 => v29}/tsconfig.json | 7 +- types/openfin/{v30 => v29}/tslint.json | 0 types/openfin/v30/index.d.ts | 1756 -------------------- types/openfin/v30/openfin-tests.ts | 728 --------- types/openfin/v30/v30 | 1736 -------------------- 7 files changed, 2694 insertions(+), 4221 deletions(-) create mode 100644 types/openfin/v29/index.d.ts create mode 100644 types/openfin/v29/openfin-tests.ts rename types/openfin/{v30 => v29}/tsconfig.json (83%) rename types/openfin/{v30 => v29}/tslint.json (100%) delete mode 100644 types/openfin/v30/index.d.ts delete mode 100644 types/openfin/v30/openfin-tests.ts delete mode 100644 types/openfin/v30/v30 diff --git a/types/openfin/v29/index.d.ts b/types/openfin/v29/index.d.ts new file mode 100644 index 0000000000..3ddbdf2edd --- /dev/null +++ b/types/openfin/v29/index.d.ts @@ -0,0 +1,1891 @@ +// Type definitions for OpenFin API 29.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v8.56.29.51 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "documennt" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + Frame: OpenFinFrameStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Launches the given Application manifest. + */ + createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the system tray. + */ + getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Registers a username and an app name for licensing purposes. + */ + registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: ExternalApplicationInfo) => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + + /** + * Download preload scripts from given URLs + */ + downloadPreloadScripts(scripts: Array, callback?: (downloadInfo: Array) => void, + errorCallback?: (reason: string) => void): void; + /** + * Downloads the given OpenFin Runtime. + */ + downloadRuntime(options: RuntimeDownloadOptions, onProgress?: (progress: RuntimeDownloadProgress) => void, onComplete?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Writes any unwritten cookies data to disk. + */ + flushCookieStore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the app asset. + */ + getAppAssetInfo(options: AppAssetOptions, callback?: (appAssetInfo: AppAssetInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Get additional info of cookies. + */ + getCookies(option: CookieOption, callback?: (info: Array) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns a hex encoded hash of the mac address and the currently logged in user name + */ + getDeviceUserId(callback?: (id: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns an Entity info object relating to the entity specified by the uuid and name passed in. The possible types are 'window', 'iframe', 'external connection' or 'unknown'. + */ + getEntityInfo(uuid: string, name: string, callback?: (info: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves currently focused window identity. + */ + getFocusedWindow(callback?: (focusedWindowIdentity: Identity) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the minimum (inclusive) logging level that is currently being written to the logs. + */ + getMinLogLevel(callback?: (logLevel: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + readRegistryValue(rootKey: string, subkey: string, value: string, callback?: (info: RegistryInfo) => void, + errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Set the minimum log level above which logs will be written to the OpenFin log + */ + setMinLogLevel(logLevel: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + mandatory?: boolean; + } + + interface AppAssetOptions { + alias: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface Identity { + uuid: string; + name: string; + } + + interface EntityInfo { + name: string; + uuid: string; + parent: Identity; + entityType: string; + } + + interface DownloadPreloadOption { + url: string; + } + + interface DownloadPreloadInfo { + success: boolean; + url?: string; + error: string; + } + + + interface CookieInfo { + name: string; + // expirationDate: Date; + domain: string; + path: string; + } + + interface CookieOption { + name: string; + } + + interface RegistryInfo { + data: any; + rootKey: string; + subkey: string; + type: string; + value: string; + } + + interface RuntimeDownloadOptions { + version: string; + } + + interface RuntimeDownloadProgress { + downloadedBytes: number; + totalBytes: number; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface OpenFinFrameStatic { + wrap(uuid: string, name: string): OpenFinFrame; + + getCurrent(): OpenFinFrame; + } + + interface OpenFinFrame { + name: string; + uuid: string; + + addEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + + getParentWindow(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + getInfo(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + removeEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; + } + monitorInfo: MonitorInfo + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface ExternalApplicationInfo { + parent: { + uuid: string; + name: string; + } + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} diff --git a/types/openfin/v29/openfin-tests.ts b/types/openfin/v29/openfin-tests.ts new file mode 100644 index 0000000000..2b5237c1e8 --- /dev/null +++ b/types/openfin/v29/openfin-tests.ts @@ -0,0 +1,797 @@ +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + //createFromManifest + fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { + console.log(app.uuid); + }, err => console.log(err)); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); + + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // getTrayIconInfo + application.getTrayIconInfo(info => { + console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, + info.monitorInfo.type, info.monitorInfo.reason); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); + //uuid + let hasUuid = application.uuid; +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + + // getInfo + externalApp.getInfo(info => { + console.log(info.parent.uuid, info.parent.name); + }, err => console.log(err)); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // downloadRuntime + fin.desktop.System.downloadRuntime({ version: '9.61.31.56' }, progress => { + console.log(progress.downloadedBytes, progress.downloadedBytes); + }, () => console.log('download complete'), err => console.error(err)); + // downloadPreloadScript + const preloadScripts = [ + { url: 'http://whatever.com/script.js' } + ]; + fin.desktop.System.downloadPreloadScripts(preloadScripts, info => { + const downloadInfo = info[0]; + console.log(downloadInfo.success, downloadInfo.url, downloadInfo.error); + }, err => { + console.log(err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + //flushCookieStore + fin.desktop.System.flushCookieStore(() => { + console.log('successful'); + }, err => { + console.log('failure', err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getAppAssetInfo + fin.desktop.System.getAppAssetInfo({ alias: 'myAppAsset' }, info => { + console.log(info.alias, info.args, info.mandatory, info.src, info.target, info.version); + }, err => console.log(err)); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + //getCookieInfo + fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { + const cookie1 = cookies[0]; + console.log(cookie1.name, cookie1.domain, cookie1.path); + }, err => console.log(err)); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getDeviceUserId + fin.desktop.System.getDeviceUserId(id => console.log(id), err => console.error(err)); + // getEntityInfo + fin.desktop.System.getEntityInfo('uuid', 'name', info => { + console.log(info.entityType, info.name, info.uuid, info.parent.name, info.parent.uuid); + }, err => console.log(err)); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getFocusedWindow + fin.desktop.System.getFocusedWindow(win => { + console.log(win.uuid, win.name); + }, err => console.log(err)); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + //getMinLogLevel + fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // readRegistryValue + fin.desktop.System.readRegistryValue('HKEY_SOMETHING', 'HARDWARE\\SOMETHING', 'BootSomething', info => { + console.log(info.data, info.rootKey, info.subkey, info.type, info.value); + }, err => console.log(err)); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + //setMinLogLevel + fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), err => console.error(err)); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

Hello Html

', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} + +function test_frame() { + //wrap + const frame = fin.desktop.Frame.wrap('uuid', 'name'); + //getCurrent + const currentFrame = fin.desktop.Frame.getCurrent(); + // addEventlistener + frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + //removeEventListener + frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + // getInfo + frame.getInfo(info => { + console.log(info.uuid, info.name, info.entityType, info.parent.uuid, info.parent.name); + }, err => console.error(err)); + // getParentWindow + frame.getParentWindow(parent => { + console.log(parent.uuid, parent.name, parent.entityType, parent.parent.uuid, parent.parent.name); + }, err => console.error(err)); +} diff --git a/types/openfin/v30/tsconfig.json b/types/openfin/v29/tsconfig.json similarity index 83% rename from types/openfin/v30/tsconfig.json rename to types/openfin/v29/tsconfig.json index fd3199ceb7..a590982714 100644 --- a/types/openfin/v30/tsconfig.json +++ b/types/openfin/v29/tsconfig.json @@ -14,6 +14,11 @@ "../" ], "types": [], + "paths": { + "openfin": [ + "openfin/v29" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -21,4 +26,4 @@ "index.d.ts", "openfin-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/openfin/v30/tslint.json b/types/openfin/v29/tslint.json similarity index 100% rename from types/openfin/v30/tslint.json rename to types/openfin/v29/tslint.json diff --git a/types/openfin/v30/index.d.ts b/types/openfin/v30/index.d.ts deleted file mode 100644 index 1e69b3b713..0000000000 --- a/types/openfin/v30/index.d.ts +++ /dev/null @@ -1,1756 +0,0 @@ -// Type definitions for OpenFin API 17.0 -// Project: https://openfin.co/ -// Definitions by: Chris Barker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// based on v6.49.17.14 -// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean - -/** - * JavaScript API - * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, - * can communicate with other applications and has access to sandboxed system-level features. - * - * API Ready - * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify - * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly - * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. - * - * Overview - * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. - */ -declare namespace fin { - const desktop: OpenFinDesktop; - - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - } - - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Launches the given Application manifest. - */ - createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } - - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the system tray. - */ - getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Registers a username and an app name for licensing purposes. - */ - registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * The Application's uuid - */ - uuid: string; - } - - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } - - interface SuccessObj { - httpResponseCode: number; - } - - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } - - interface ErrorInfo { - stack: string; - message: string; - } - - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } - - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, - }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right - monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate - } - - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } - - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } - - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } - - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } - - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } - - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } - - interface TrayIconInfo { - x: number; - y: number; - bounds: { - x: number; - y: number; - width: number; - height: number; - } - monitorInfo: MonitorInfo - } - - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } - - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } - - interface VirtualScreenCoordinates { - left: number; - top: number; - } - - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } - - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } - - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } - - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } - - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; - - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } - - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } - - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } - - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } - - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } - - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } - - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } - - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } - - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } - - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } - - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } - - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; -} diff --git a/types/openfin/v30/openfin-tests.ts b/types/openfin/v30/openfin-tests.ts deleted file mode 100644 index ce49b14f5c..0000000000 --- a/types/openfin/v30/openfin-tests.ts +++ /dev/null @@ -1,728 +0,0 @@ -/// - -function test_application() { - let application: fin.OpenFinApplication; - // constructor - application = new fin.desktop.Application({ - url: "application.html", - uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", - name: "Application Name", - plugins: false, - mainWindowOptions: { - defaultHeight: 600, - defaultWidth: 800, - defaultTop: 300, - defaultLeft: 300, - autoShow: true - } - }, (successObj) => { - console.log("Application successfully created, HTTP response code:", successObj); - application.run(); - }, (error) => { - console.log("Error creating application:", error); - }); - //createFromManifest - fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { - console.log(app.uuid); - }, err => console.log(err)); - // getCurrent - application = fin.desktop.Application.getCurrent(); - // wrap - application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); - // getWindow - application.getWindow(); - // addEventListener - application.addEventListener("closed", (event) => { - console.log("The application has closed"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure: " + reason); - }); - // close - application.close(); - // getChildWindows - application.getChildWindows(children => { - children.forEach(childWindow => { - console.log("Showing child: " + childWindow.name); - childWindow.show(); - }); - }); - // getGroups - application.getGroups(allGroups => { - console.log(`There are a total of ${allGroups.length} groups.`); - - let groupCounter = 1; - allGroups.forEach(windowGroup => { - console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); - ++groupCounter; - }); - }); - // getManifest - application.getManifest(manifest => { - console.log("Application manifest:"); - console.log(manifest); - }); - // getParentUuid - application.getParentUuid(parentUuid => { - console.log("UUID of parent application:"); - console.log(parentUuid); - }); - // getShortcuts - application.getShortcuts(config => { - console.log("Desktop shortcut is enabled: ", config.desktop); - console.log("Start Menu shortcut is enabled: ", config.startMenu); - console.log("System Startup shortcut is enabled: ", config.systemStartup); - }); - // getInfo - application.getInfo(info => { - console.log(`Launch mode: ${info.launchMode}`); - }); - // getTrayIconInfo - application.getTrayIconInfo(info => { - console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, - info.monitorInfo.type, info.monitorInfo.reason); - }); - // isRunning - application.isRunning(running => { - console.log("the application is", running ? "running" : "not running"); - }); - // registerCustomData - application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); - // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { - console.log("The unregistration was successful"); - }, err => { - console.log("failure:", err); - }); - // removeTrayIcon - application.removeTrayIcon(() => { - console.log("Removed the tray icon."); - }, err => { - console.log("failure:", err); - }); - // restart - application.restart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // schedule restart - application.scheduleRestart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // setShortcuts - application.setShortcuts({ - desktop: true, - startMenu: false, - systemStartup: true - }, () => { - console.log("Successfully set new shortcut states"); - }, error => { - console.log("Failed to set new shortcut states. Error: ", error); - }); - // setTrayIcon - application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { - console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); - }); - // terminate - application.terminate(); - // wait - application.addEventListener("not-responding", () => { - console.log("waiting for hung application"); - application.wait(); - }); - //uuid - let hasUuid = application.uuid; -} - -function test_external_application() { - let externalApp: fin.OpenFinExternalApplication; - // wrap - externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); - // addEventListener - externalApp.addEventListener('connected', () => { - console.log('external app connected'); - }, () => { - console.log('The registration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - // removeEventListener - const previousCallback = () => { }; - externalApp.removeEventListener('connected', previousCallback, () => { - console.log('The unregistration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); -} - -function test_inter_application_bus() { - // addSubscribeListener - fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has subscribed to ${topic}`); - }); - // addUnsubscribeListener - fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has unsubscribed to ${topic}`); - }); - // removeSubscribeListener - const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; - fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); - // removeUnsubscribeListener - fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); - // publish - fin.desktop.InterApplicationBus.publish("a topic", { - field1: "value1", - field2: "value2" - }); - // send - fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { - field1: "value1", - field2: "value2" - }); - // subscribe - fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { - console.log(`The application ${uuid} sent this message: ${message}`); - }); - // unsubscribe - const aRegisteredMessageListener = (message: any, senderUuid: string) => { - console.log(message, senderUuid); - }; - fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); -} - -function test_notification() { - let notification: fin.OpenFinNotification; - // getCurrent - notification = fin.desktop.Notification.getCurrent(); - // close - notification.close(); - // sendMessage - notification = new fin.desktop.Notification({ - duration: 10, - url: "http://localhost:5000/Account/Register", - message: "Hello", - onShow: () => { }, - // onClose: () => { }, - onDismiss: () => { }, - // onClick: () => { }, - onMessage: () => { }, - onError: () => { } - }); - // sendMessageToApplication - notification.sendMessageToApplication("some message"); -} - -function test_system() { - // addEventListener - fin.desktop.System.addEventListener('monitor-info-changed', event => { - console.log("The monitor information has changed to: ", event); - }, () => { - console.log("The registration was successful"); - }, err => { - console.log("failure: " + err); - }); - // clearCache - fin.desktop.System.clearCache({ - cache: true, - cookies: true, - localStorage: true, - appcache: true, - userData: true - }); - // deleteCacheOnExit - fin.desktop.System.deleteCacheOnExit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // downloadAsset - const dirAppAsset = { - src: 'http://local:8000/dir.zip', - alias: 'dirApp', - version: '1.23.24', - target: 'dir.bat', - args: '' - }; - fin.desktop.System.downloadAsset(dirAppAsset, progress => { - const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); - console.log(`Downloaded ${downloadedPercent}%`); - }, p => { - console.log(`Downlod complete, can be found on ${p.path}`); - // lets launch our application asset. - // launchDirApp(); - }, (reason, err) => { - console.log(reason, err); - }); - // exit - fin.desktop.System.exit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // getAllApplications - fin.desktop.System.getAllApplications(applicationInfoList => { - applicationInfoList.forEach(applicationInfo => { - console.log("Showing information for application with uuid: " - + applicationInfo.uuid); - console.log("isRunning: ", applicationInfo.isRunning); - }); - }); - // getAllExternalApplications - fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { - externalAppsInfoList.forEach(appInfo => { - console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); - }); - }); - // getAllWindows - fin.desktop.System.getAllWindows(windowInfoList => { - windowInfoList.forEach(windowInfo => { - console.log("Showing information for application with uuid: ", windowInfo.uuid); - console.log("Main window: ", windowInfo.mainWindow); - console.log("Child windows: ", windowInfo.childWindows); - }); - }); - // getCommandLineArguments - fin.desktop.System.getCommandLineArguments(args => { - console.log("The command line arguments are " + args); - }); - // getDeviceId - fin.desktop.System.getDeviceId(id => { - console.log("The id of the device is: " + id); - }); - // getEnvironmentVariable - fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { - console.log("this is the APPDATA value", variable); - }); - // getHostSpecs - fin.desktop.System.getHostSpecs(info => { - console.log(info); - }, error => { - console.log('There was an error:', error); - }); - // getLog - fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { - console.log(log); - }); - // getLogList - fin.desktop.System.getLogList(logList => { - logList.forEach(logInfo => { - console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); - }); - }); - // getMonitorInfo - fin.desktop.System.getMonitorInfo(monitorInfo => { - console.log("This object contains information about all monitors: ", monitorInfo); - }); - // getMousePosition - fin.desktop.System.getMousePosition(mousePosition => { - console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); - }); - // getProcessList - fin.desktop.System.getProcessList(list => { - list.forEach(process => { - console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); - }); - }); - // getProxySettings - fin.desktop.System.getProxySettings(proxy => { - console.log(proxy); - }); - // getRvmInfo - fin.desktop.System.getRvmInfo(rvmInfoObject => { - console.log("RVM version:", rvmInfoObject.version); - console.log("RVM has been running since:", rvmInfoObject["start-time"]); - }, err => { - console.log("Failed to get rvm info, error message:", err); - }); - // getVersion - fin.desktop.System.getVersion(version => { - console.log("The version is " + version); - }); - // launchExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - // Additionally note that the executable found in the zip file specified in appAssets - // will default to the one mentioned by appAssets.target - // If the the path below refers to a specific path it will override this default - alias: "myApp", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - alias: "myApp", - arguments: "e f g", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", - arguments: "--version", - certificate: { - trusted: true, - subject: 'O=OpenFin INC., L=New York, S=NY, C=US', - thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' - }, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // log - fin.desktop.System.log("info", "An example log message", () => { - console.log("message successfully logged"); - }, err => { - console.log(err); - }); - // monitorExternalProcess - fin.desktop.System.monitorExternalProcess({ - pid: 2508, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log("The process is now being monitored: ", payload.uuid); - }, error => { - console.log("Error:", error); - }); - // openUrlWithBrowser - fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // registerExternalConnection - fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { - console.log(args); - }); - // releaseExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // release it. - fin.desktop.System.releaseExternalProcess(result.uuid, () => { - console.log("Process has been unmapped!"); - }, reason => { - console.log("failure: " + reason); - }); - }); - // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // showDeveloperTools - fin.desktop.System.showDeveloperTools("uuid", "name", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // terminateExternalProcess - fin.desktop.System.launchExternalProcess({ - // notepad is in the system's PATH - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // Attempt to close the process. Terminate after 4 seconds if it - // has not done so. - fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { - console.log("Termination result " + info.result); - }, reason => { - console.log("failure: " + reason); - }); - }); - // updateProxySettings - fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { - console.log('success'); - }, err => { - console.log(err); - }); -} - -function test_system_clipboard() { - // availableFormats - fin.desktop.System.Clipboard.availableFormats(null, formats => { - formats.forEach(format => console.log(`The format ${format} is available to read`)); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readHtml - fin.desktop.System.Clipboard.readHtml(null, html => { - console.log(`This is the html from the clipboard: ${html}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readRtf - fin.desktop.System.Clipboard.readRtf(null, rtf => { - console.log(`This is the rtf from the clipboard: ${rtf}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readText - fin.desktop.System.Clipboard.readText(null, text => { - console.log(`This is the text from the clipboard: ${text}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // write - fin.desktop.System.Clipboard.write({ - text: 'Hello Text!', - html: '

Hello Html

', - rtf: 'Hello Rtf' - }, null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeHtml - fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeRtf - fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeText - fin.desktop.System.Clipboard.writeText('Hello World', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); -} - -function test_window() { - let finWindow: fin.OpenFinWindow; - // constructor - finWindow = new fin.desktop.Window({ - name: "childWindow", - url: "child.html", - defaultWidth: 320, - defaultHeight: 320, - defaultTop: 10, - defaultLeft: 300, - frame: false, - resizable: false, - state: "normal" - }, () => { - const _win = finWindow.getNativeWindow(); - _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); - }, error => { - console.log("Error creating window:", error); - }); - // getCurrent - finWindow = fin.desktop.Window.getCurrent(); - // getNativeWindow - let nativeWindow: Window; - nativeWindow = finWindow.getNativeWindow(); - // getParentApplication - let parentApp: fin.OpenFinApplication; - parentApp = finWindow.getParentApplication(); - // getParentWindow - let parentFinWindow: fin.OpenFinWindow; - parentFinWindow = finWindow.getParentWindow(); - // wrap - finWindow = fin.desktop.Window.wrap("uuid", "name"); - // addEventListener - finWindow.addEventListener("bounds-changed", event => { - console.log("The window has been moved or resized"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure:" + reason); - }); - // animate - finWindow.animate({ - opacity: { - opacity: 0.15, - duration: 1000 - }, - position: { - left: 10, - top: 10, - duration: 3000 - } - }, { - interrupt: false - }, evt => { - // Callback will only fire after both "opacity" and "position" have finished animating. - }); - // authenticate - finWindow.addEventListener('auth-requested', evt => { - finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { - console.log("failure:", err); - }); - }); - // blur - finWindow.blur(); - // bringToFront - finWindow.bringToFront(); - // close - finWindow.close(); - // disableFrame - finWindow.disableFrame(); - // enableFrame - finWindow.enableFrame(); - // flash - finWindow.flash(); - // focus - finWindow.focus(); - // getBounds - finWindow.getBounds(bounds => { - console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); - }); - // getOptions - finWindow.getOptions(options => { - console.log(options); - }); - // getSnapshot - finWindow.getSnapshot(base64Snapshot => { - console.log("data:image/png;base64," + base64Snapshot); - }); - // getState - finWindow.getState(state => { - console.log("state: " + state); - }); - // getZoomLevel - finWindow.getZoomLevel(level => { - console.log("zoom level: " + level); - }, error => { - console.log('error:', error); - }); - // hide - finWindow.hide(); - // isShowing - finWindow.isShowing(showing => { - console.log("the window is " + (showing ? "showing" : "hidden")); - }); - // joinGroup - let secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When mainWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow); - }); - // leaveGroup - secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When finWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow, () => { - // once we are in the group, lets leave it. - secondWindow.leaveGroup(); - }); - }); - // maximize - finWindow.maximize(); - // mergeGroups - { - const finWindowOne = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowOne", - autoShow: true - }); - const finWindowTwo = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowTwo", - autoShow: true - }); - const finWindowThree = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowThree", - autoShow: true - }); - const finWindowFour = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowFour", - autoShow: true - }); - // When finWindowOne moves or is moved, finWindowTwo moves by the same amount - finWindowOne.joinGroup(finWindowTwo); - // When finWindowThree moves or is moved, finWindowFour moves by the same amount - finWindowThree.joinGroup(finWindowFour); - // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group - finWindowOne.mergeGroups(finWindowThree); - } - // minimize - finWindow.minimize(); - // moveBy - finWindow.moveBy(10, 10); - // moveTo - finWindow.moveTo(100, 200); - // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); - // resizeBy - finWindow.resizeBy(10, 10, "top-right"); - // resizeTo - finWindow.resizeTo(10, 10, "top-right"); - // restore - finWindow.restore(); - // setAsForeground - finWindow.setAsForeground(); - // setBounds - finWindow.setBounds(100, 200, 400, 400); - // setZoomLevel - finWindow.setZoomLevel(10); - // show - finWindow.show(); - // showAt - finWindow.showAt(10, 10, false); - // stopFlashing - finWindow.stopFlashing(); - // updateOptions - finWindow.updateOptions({ - frame: false, - maxWidth: 500 - }); -} diff --git a/types/openfin/v30/v30 b/types/openfin/v30/v30 deleted file mode 100644 index 5c40c47ae0..0000000000 --- a/types/openfin/v30/v30 +++ /dev/null @@ -1,1736 +0,0 @@ -// Type definitions for OpenFin API 17.0 -// Project: https://openfin.co/ -// Definitions by: Chris Barker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// based on v6.49.17.14 -// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean - -/** - * JavaScript API - * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, - * can communicate with other applications and has access to sandboxed system-level features. - * - * API Ready - * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify - * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly - * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. - * - * Overview - * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. - */ -declare namespace fin { - const desktop: OpenFinDesktop; - - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - } - - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } - - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Passes in custom data that will be relayed to the RVM - */ - registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * The Application's uuid - */ - uuid: string; - } - - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } - - interface SuccessObj { - httpResponseCode: number; - } - - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } - - interface ErrorInfo { - stack: string; - message: string; - } - - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } - - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, - }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right - monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate - } - - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } - - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } - - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } - - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } - - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } - - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } - - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } - - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } - - interface VirtualScreenCoordinates { - left: number; - top: number; - } - - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } - - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } - - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } - - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } - - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; - - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } - - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } - - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } - - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } - - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } - - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } - - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } - - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } - - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } - - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } - - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } - - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; -} From 2de73dedb7ade81167148adf6545130b1da42ee6 Mon Sep 17 00:00:00 2001 From: tonyholt Date: Tue, 20 Mar 2018 21:23:34 -0400 Subject: [PATCH 10/97] Select2 missing dataAdapter in Select2Options interface --- types/select2/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 51e297a9a8..1fe95ee6e8 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -94,6 +94,7 @@ interface Select2Options { dropdownAdapter?: any; selectionAdapter?: any; resultsAdapter?: any; + dataAdapter?: any; } interface Select2JQueryEventObject extends JQueryEventObject { From f2d6f88dc636fe2f68b913a717a578418f354d38 Mon Sep 17 00:00:00 2001 From: Abdulsattar Mohammed Date: Wed, 21 Mar 2018 11:48:50 +0530 Subject: [PATCH 11/97] Make renderTarget in setRenderTarget optional RenderTarget can be null in `WebGLRenderer` which can be used to unbind the frame buffer. It is actually used by `WebGLRenderer#render` which accepts a `null` `renderTarget` to and calls `setRenderTarget` with that null value. --- types/three/three-core.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 31c8cbebe0..57b060c597 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -5417,7 +5417,7 @@ export class WebGLRenderer implements Renderer { * @deprecated Use {@link WebGLRenderer#getRenderTarget .getRenderTarget()} instead. */ getCurrentRenderTarget(): RenderTarget; - setRenderTarget(renderTarget: RenderTarget): void; + setRenderTarget(renderTarget?: RenderTarget): void; readRenderTargetPixels( renderTarget: RenderTarget, x: number, y: number, width: number, height: number, buffer: any ): void; /** From dbb40c14f8a9901796e293d64adcad9c1fe9b789 Mon Sep 17 00:00:00 2001 From: Michael Zabka Date: Thu, 22 Mar 2018 21:17:22 +0100 Subject: [PATCH 12/97] Allow omit second key argument in crypto-js Hash functions * Fixes DefinitelyTyped/DefinitelyTyped#24425 --- types/crypto-js/crypto-js-tests.ts | 2 ++ types/crypto-js/index.d.ts | 52 +++++++++++++++++++----------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/types/crypto-js/crypto-js-tests.ts b/types/crypto-js/crypto-js-tests.ts index 9b5dd1be6f..59f1d684ed 100644 --- a/types/crypto-js/crypto-js-tests.ts +++ b/types/crypto-js/crypto-js-tests.ts @@ -4,9 +4,11 @@ import CryptoJS = require('crypto-js'); var wordArray: CryptoJS.WordArray; wordArray = CryptoJS.MD5('some message'); wordArray = CryptoJS.MD5('some message', 'some key'); +wordArray = CryptoJS.MD5('some message', { any: true }); wordArray = CryptoJS.SHA1('some message'); wordArray = CryptoJS.SHA1('some message', 'some key', { any: true }); +wordArray = CryptoJS.SHA1('some message', { any: true }); wordArray = CryptoJS.format.OpenSSL('some message'); wordArray = CryptoJS.format.OpenSSL('some message', 'some key'); diff --git a/types/crypto-js/index.d.ts b/types/crypto-js/index.d.ts index c066204df2..db9ed6c30e 100644 --- a/types/crypto-js/index.d.ts +++ b/types/crypto-js/index.d.ts @@ -8,7 +8,6 @@ export as namespace CryptoJS; declare var CryptoJS: CryptoJS.Hashes; declare namespace CryptoJS { - type Hash = (message: string | LibWordArray, key?: string | WordArray, ...options: any[]) => WordArray; interface Cipher { encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray; decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage; @@ -54,23 +53,40 @@ declare namespace CryptoJS { interface Padding {} 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; + MD5(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + MD5(message: string | LibWordArray, ...options: any[]): WordArray; + SHA1(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA1(message: string | LibWordArray, ...options: any[]): WordArray; + SHA256(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA256(message: string | LibWordArray, ...options: any[]): WordArray; + SHA224(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA224(message: string | LibWordArray, ...options: any[]): WordArray; + SHA512(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA512(message: string | LibWordArray, ...options: any[]): WordArray; + SHA384(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA384(message: string | LibWordArray, ...options: any[]): WordArray; + SHA3(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + SHA3(message: string | LibWordArray, ...options: any[]): WordArray; + RIPEMD160(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + RIPEMD160(message: string | LibWordArray, ...options: any[]): WordArray; + HmacMD5(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacMD5(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA1(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA1(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA256(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA256(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA224(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA224(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA512(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA512(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA384(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA384(message: string | LibWordArray, ...options: any[]): WordArray; + HmacSHA3(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacSHA3(message: string | LibWordArray, ...options: any[]): WordArray; + HmacRIPEMD160(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + HmacRIPEMD160(message: string | LibWordArray, ...options: any[]): WordArray; + PBKDF2(message: string | LibWordArray, key?: string | WordArray, ...options: any[]): WordArray; + PBKDF2(message: string | LibWordArray, ...options: any[]): WordArray; AES: Cipher; DES: Cipher; TripleDES: Cipher; From e1806c890eadd0e83c4af8512feee44621b13ac1 Mon Sep 17 00:00:00 2001 From: Alvis HT Tang Date: Thu, 22 Mar 2018 23:48:26 +0000 Subject: [PATCH 13/97] highland: add the definition for the new isNil() for type guarding This commit add the definition for the a very simple, and yet essential, isNil function for type checking. This function is particularly useful in a consume handler. Example: ``` source.consume(function (err, x, push, next) { if (err) { // pass errors along the stream and consume next value push(err); next(); } else if (_.isNil(x)) { // type guard is only possible with this function // pass nil (end event) along the stream push(null, x); } else { // pass on the value only if the value passes the predicate if (f(x)) { push(null, x); } next(); } }); ``` See https://github.com/caolan/highland/pull/645 --- types/highland/index.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/types/highland/index.d.ts b/types/highland/index.d.ts index eff8fb2769..473e93880a 100644 --- a/types/highland/index.d.ts +++ b/types/highland/index.d.ts @@ -89,6 +89,17 @@ interface HighlandStatic { // UTILS // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** + * Returns true if `x` is the end of stream marker. + * + * @id isNil + * @section Streams + * @name _.isNil(x) + * @param x - the object to test + * @api public + */ + isNil(x: R | Highland.Nil): x is Highland.Nil; + /** * Returns true if `x` is a Highland Stream. * From a16cd3ea3211250b557fff6eb614a1d490e7d454 Mon Sep 17 00:00:00 2001 From: Alvis HT Tang Date: Thu, 22 Mar 2018 23:54:08 +0000 Subject: [PATCH 14/97] highland: add a test for the new isNil() --- types/highland/highland-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/highland/highland-tests.ts b/types/highland/highland-tests.ts index 5f1c734395..a1c48c944b 100644 --- a/types/highland/highland-tests.ts +++ b/types/highland/highland-tests.ts @@ -337,6 +337,8 @@ fooStream.toCallback((err: Error) => {}); // UTILS // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool = _.isNil(x); + bool = _.isStream(x); bool = _.isStream(fooStream); From 8d0bdd3e2edac1c405035243999848b3fd0ba375 Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Thu, 22 Mar 2018 22:41:18 -0400 Subject: [PATCH 15/97] Fixed review items. --- types/openfin/v29/tsconfig.json | 2 +- types/openfin/v29/tslint.json | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/types/openfin/v29/tsconfig.json b/types/openfin/v29/tsconfig.json index a590982714..df2dae8b79 100644 --- a/types/openfin/v29/tsconfig.json +++ b/types/openfin/v29/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/types/openfin/v29/tslint.json b/types/openfin/v29/tslint.json index 64aace11d6..f93cf8562a 100644 --- a/types/openfin/v29/tslint.json +++ b/types/openfin/v29/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "max-line-length": false - } + "extends": "dtslint/dt.json" } From f3b3166bb0713c90d2c37298f056b56863c3ab39 Mon Sep 17 00:00:00 2001 From: hisorange Date: Fri, 23 Mar 2018 10:16:38 +0100 Subject: [PATCH 16/97] Add missing 'bclient' type --- types/bull/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 97cb7a23df..296009c4bd 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -41,7 +41,7 @@ declare namespace Bull { * When specified, the `Queue` will use this function to create new `ioredis` client connections. * This is useful if you want to re-use connections. */ - createClient?(type: 'client' | 'subscriber', redisOpts?: Redis.RedisOptions): Redis.Redis; + createClient?(type: 'client' | 'subscriber' | 'bclient', redisOpts?: Redis.RedisOptions): Redis.Redis; /** * Prefix to use for all redis keys From 93a7241b1e82e749fcceac58e2abe8e05760f178 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 13:04:32 +0000 Subject: [PATCH 17/97] Correct casing for modernizr --- types/modernizr/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index ff88e9f523..a9cfb92f54 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -448,6 +448,6 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } declare var Modernizr: ModernizrStatic; -declare module "Modernizr" { +declare module "modernizr" { export = Modernizr; } From 54b3965d34e7bdfb63b130fe1fe20bf26837b5bb Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:20:46 +0800 Subject: [PATCH 18/97] [@types/ember-qunit] add missing definition for `setupApplicationTest` --- types/ember-qunit/index.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index a669b977e1..ea129ec3ec 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -44,6 +44,20 @@ declare module 'ember-qunit' { */ export function setResolver(resolver: Ember.Resolver): void; + /** + * Sets up acceptance tests. + * + * The `setupApplicationTest` function is used for all acceptance tests. It + * is invoked in the callback scope of a QUnit module (aka "nested module"). + * + * Once invoked, all subsequent hooks.beforeEach and test invocations will + * have access to the following: + * * `this.owner` - the owner object that been set on the test context. + * * `this.pauseTest` and `this.resumeTest` - allow easy pausing/resuming of tests. + * * `this.element` which returns the DOM element representing the application's root element. + */ + export function setupApplicationTest(hooks: NestedHooks): void; + /** * Sets up tests that need to render snippets of templates. * @@ -80,7 +94,7 @@ declare module 'ember-qunit' { */ export function setupTest(hooks: NestedHooks): void; - export class QUnitAdapter extends Ember.Test.Adapter {} + export class QUnitAdapter extends Ember.Test.Adapter { } export { module, test, skip, only, todo } from 'qunit'; } From 9526aa700f36ebea5c10c592e16506ff72b63061 Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:21:37 +0800 Subject: [PATCH 19/97] [@types/ember-qunit] improve `skip` definition to align with others --- types/ember-qunit/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index ea129ec3ec..ad12f43ffc 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -161,9 +161,10 @@ declare module 'qunit' { * ignoring the callback argument and the respective global and module's * hooks. * - * @param Title of unit being tested + * @param name Title of unit being tested + * @param callback Function to close over assertions */ - export const skip: typeof QUnit.skip; + export function skip(name: string, callback: (this: TestContext, assert: Assert) => void): void; export default QUnit; } From 371c3bad16e85ae06a2b8bd5b0ec240d02f1119f Mon Sep 17 00:00:00 2001 From: Lenny Date: Fri, 23 Mar 2018 08:39:11 -0500 Subject: [PATCH 20/97] @types\mapbox-gl Change RasterSource URL to optional. --- types/mapbox-gl/index.d.ts | 2 +- types/mapbox-gl/mapbox-gl-tests.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index a51172daec..24dca985e4 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -610,7 +610,7 @@ declare namespace mapboxgl { interface RasterSource extends Source { type: 'raster'; - url: string; + url?: string; tiles?: string[]; minzoom?: number; maxzoom?: number; diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index 422cb3913d..ce10a26564 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -205,6 +205,22 @@ var videoSourceObj = new mapboxgl.VideoSource({ map.addSource('some id', videoSourceObj); // add map.removeSource('some id'); // remove +/** + * Add Raster Source /// made URL optional to allow only tiles. + */ +map.addSource('radar', { + type: 'raster', + tiles: ['https://nowcoast.noaa.gov/arcgis/services/nowcoast/radar_meteo_imagery_nexrad_time/MapServer/WmsServer?bbox={bbox-epsg-3857}&service=WMS&request=GetMap&version=1.3.0&layers=1&styles=&format=image/png&transparent=true&height=256&width=256&crs=EPSG:3857'], + tileSize: 256 +}) + +map.addLayer({ + id: 'radar', + type: 'raster', + source: 'radar', + paint: {} +}) + /** * Popup */ From e4edb35bf5f59e24129021c27ea6a2347e582ef8 Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:39:33 +0800 Subject: [PATCH 21/97] fix: let callback be optional to pass the test case --- types/ember-qunit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index ad12f43ffc..9dc93b980b 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -164,7 +164,7 @@ declare module 'qunit' { * @param name Title of unit being tested * @param callback Function to close over assertions */ - export function skip(name: string, callback: (this: TestContext, assert: Assert) => void): void; + export function skip(name: string, callback?: (this: TestContext, assert: Assert) => void): void; export default QUnit; } From f2b858e68f4c06db40dad388805b14ddac829963 Mon Sep 17 00:00:00 2001 From: doomsower Date: Fri, 23 Mar 2018 16:49:30 +0300 Subject: [PATCH 22/97] Some changes to react-navigation --- types/react-navigation/index.d.ts | 31 ++++++++--- .../react-navigation-tests.tsx | 52 ++++++++++++++++++- 2 files changed, 73 insertions(+), 10 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 0e6bb2d94c..379a24d4ba 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -77,7 +77,7 @@ export interface NavigationState { export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute; -export interface NavigationLeafRoute { +export interface NavigationLeafRoute

{ /** * React's key used by some navigators. No need to specify these manually, * they will be defined by the router. @@ -96,7 +96,7 @@ export interface NavigationLeafRoute { * Params passed to this route when navigating to it, * e.g. `{ car_id: 123 }` in a route that displays a car. */ - params?: NavigationParams; + params?: P; } export type NavigationStateRoute = NavigationLeafRoute & NavigationState; @@ -175,6 +175,7 @@ export type NavigationScreenConfig = export type NavigationComponent = NavigationScreenComponent + | NavigationStatelessScreen | NavigationNavigator; export interface NavigationScreenComponent extends React.ComponentClass { @@ -299,7 +300,7 @@ export interface NavigationStackRouterConfig { initialRouteName?: string; initialRouteParams?: NavigationParams; paths?: NavigationPathsConfig; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; } export type NavigationStackAction = @@ -339,7 +340,7 @@ export interface NavigationPathsConfig { export interface NavigationTabRouterConfig { initialRouteName?: string; paths?: NavigationPathsConfig; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; order?: string[]; // todo: type these as the real route names rather than 'string' // Does the back button cause the router to switch to the initial tab @@ -433,7 +434,8 @@ export interface NavigationScreenProp { params?: P, action?: NavigationAction, ): boolean; - setParams: (newParams: NavigationParams) => boolean; + getParam: (param: T, fallback?: P[T]) => P[T]; + setParams: (newParams: P) => boolean; addListener: ( eventName: string, callback: NavigationEventCallback @@ -853,12 +855,25 @@ export function createNavigationContainer( * BEGIN CUSTOM CONVENIENCE INTERFACES */ -export interface NavigationScreenProps { - navigation: NavigationScreenProp; +export interface NavigationScreenProps

{ + navigation: NavigationScreenProp; screenProps?: { [key: string]: any }; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; } +export type AnyScreenOptions = + NavigationDrawerScreenOptions & + NavigationStackScreenOptions & + NavigationTabScreenOptions; + +export interface NavigationScreenStatic { + navigationOptions?: NavigationScreenConfig; +} + +export type NavigationStatelessScreen = + React.StatelessComponent> & + NavigationScreenStatic; + /** * END CUSTOM CONVENIENCE INTERFACES */ diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index d0e65dfc8e..496009688e 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -36,6 +36,10 @@ import { NavigationParams, NavigationPopAction, NavigationPopToTopAction, + NavigationScreenStatic, + NavigationScreenConfig, + AnyScreenOptions, + NavigationStatelessScreen, } from 'react-navigation'; // Constants @@ -84,12 +88,24 @@ class StartScreen extends React.Component { const ROUTE_NAME_NEXT_SCREEN = "NextScreen"; -class NextScreen extends React.Component { +interface NextScreenParams { + id: string; + name: string; +} + +class NextScreen extends React.Component> { + static navigationOptions: NavigationScreenConfig = { + tabBarLabel: 'Next tab', + drawerLabel: 'Next drawe label', + }; + render() { // Implicit type checks. const navigationStateParams = this.props.navigation.state.params; + // typeof id is any const id = this.props.navigation.state.params && this.props.navigation.state.params.id; - const name = this.props.navigation.state.params && this.props.navigation.state.params.name; + // typeof name is string + const name = this.props.navigation.getParam('name', 'Peter'); return ( @@ -97,6 +113,29 @@ class NextScreen extends React.Component { } } +const ROUTE_NAME_ANOTHER_SCREEN = "AnotherScreen"; + +interface AnotherScreenParams { + color: string; +} + +interface AnotherScreenProps { + apolloData: number[]; // Demonstrates that screen can be wrapped into HOCs +} + +// View below compiles without TS errors, because props and navigation params are strongly typed +const AnotherScreen: NavigationStatelessScreen = ({ apolloData, navigation }) => ( + +) + +// Demonstrates overriding navigationOptions on static components +AnotherScreen.navigationOptions = ({ navigation, navigationOptions }) => ({ + drawerLabel: navigation.state.params!.color + ' screen', +}); + const navigationOptions = { headerBackTitle: null, }; @@ -113,6 +152,15 @@ const routeConfigMap: NavigationRouteConfigMap = { path: "next", screen: NextScreen, }, + // Demonstrates stateless screen + [ROUTE_NAME_ANOTHER_SCREEN]: { + path: "another", + screen: AnotherScreen, + navigationOptions: { + // Demonstrates that stack entries can set optins for tab navigation (for deeper use) + tabBarVisible: false, + } + }, }; export const AppNavigator = StackNavigator( routeConfigMap, From ec2685287a29cdbcd146db59b460391d49487596 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:14:15 +0000 Subject: [PATCH 23/97] Remove module declaration --- types/modernizr/index.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index a9cfb92f54..ca5e6753f9 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -448,6 +448,4 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } declare var Modernizr: ModernizrStatic; -declare module "modernizr" { - export = Modernizr; -} +export = Modernizr; From 97b9d47d3a5cc5d8a176a05705f528a73854f2c7 Mon Sep 17 00:00:00 2001 From: doomsower Date: Fri, 23 Mar 2018 17:46:30 +0300 Subject: [PATCH 24/97] fix linter --- types/react-navigation/react-navigation-tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 496009688e..5ffabdef46 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -129,7 +129,7 @@ const AnotherScreen: NavigationStatelessScreen -) +); // Demonstrates overriding navigationOptions on static components AnotherScreen.navigationOptions = ({ navigation, navigationOptions }) => ({ @@ -159,7 +159,7 @@ const routeConfigMap: NavigationRouteConfigMap = { navigationOptions: { // Demonstrates that stack entries can set optins for tab navigation (for deeper use) tabBarVisible: false, - } + }, }, }; export const AppNavigator = StackNavigator( From 48662ad8dc57000bfa968fc021f54346615fb122 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:48:12 +0000 Subject: [PATCH 25/97] Reverse commit --- types/modernizr/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index ca5e6753f9..71046d3840 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -447,5 +447,7 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } -declare var Modernizr: ModernizrStatic; -export = Modernizr; +declare var Modernizr: ModernizrStatic;declare module "Modernizr" { +declare module "Modernizr" { + export = Modernizr; +} From ff63f28d065ff53dc50e86c9191cc33222850e57 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:55:47 +0000 Subject: [PATCH 26/97] Fix duplicate --- types/modernizr/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/modernizr/index.d.ts b/types/modernizr/index.d.ts index 71046d3840..a9cfb92f54 100644 --- a/types/modernizr/index.d.ts +++ b/types/modernizr/index.d.ts @@ -447,7 +447,7 @@ interface ModernizrAPI { interface ModernizrStatic extends ModernizrAPI, FeatureDetects { } -declare var Modernizr: ModernizrStatic;declare module "Modernizr" { -declare module "Modernizr" { +declare var Modernizr: ModernizrStatic; +declare module "modernizr" { export = Modernizr; } From 22d2e5efbb99c765d59d661f145209eaceb1b12e Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 14:57:11 +0000 Subject: [PATCH 27/97] Set declare-module tslint to true --- types/modernizr/tslint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/modernizr/tslint.json b/types/modernizr/tslint.json index 2279635eb4..bd2b0c4334 100644 --- a/types/modernizr/tslint.json +++ b/types/modernizr/tslint.json @@ -1,7 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-single-declare-module": false, + "no-single-declare-module": true, "no-empty-interface": false } } From 768b5c94e563c1fccaa9d8a72576e0b8f54cd320 Mon Sep 17 00:00:00 2001 From: Justin Chew Date: Fri, 23 Mar 2018 15:05:33 +0000 Subject: [PATCH 28/97] Fix tslint --- types/modernizr/tslint.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/modernizr/tslint.json b/types/modernizr/tslint.json index bd2b0c4334..9edbcd99ab 100644 --- a/types/modernizr/tslint.json +++ b/types/modernizr/tslint.json @@ -1,7 +1,8 @@ { "extends": "dtslint/dt.json", "rules": { - "no-single-declare-module": true, - "no-empty-interface": false + "no-single-declare-module": false, + "no-empty-interface": false, + "no-declare-current-package": false } } From 0f9cfb309b928e7b91f1fc365936631f5ee884fd Mon Sep 17 00:00:00 2001 From: Moritz Raguschat Date: Sat, 24 Mar 2018 03:09:12 +0100 Subject: [PATCH 29/97] [koa-session] ContextStore constructor takes an argument of type Koa.Context --- types/koa-session/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index 8650a07d91..2fe4a37b95 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -166,7 +166,7 @@ declare namespace session { * ContextStore must be a class which claims three instance methods demonstrated above. * new ContextStore(ctx) will be executed on every request. */ - ContextStore?: { new(): stores }; + ContextStore?: { new(ctx: Koa.Context): stores }; /** * If you want to add prefix for all external session id, you can use options.prefix, it will not work if options.genid present. From 08a358732a872a66d9c3404ce66959e791f7b302 Mon Sep 17 00:00:00 2001 From: Jan Vennemann Date: Tue, 13 Mar 2018 19:00:44 -0300 Subject: [PATCH 30/97] Update Titanium Mobile types to 7.1.0 --- types/titanium/index.d.ts | 71586 ++++++++++++++++++++++++++--- types/titanium/titanium-tests.ts | 61 +- types/titanium/tsconfig.json | 4 +- types/titanium/tslint.json | 70 +- 4 files changed, 64710 insertions(+), 7011 deletions(-) diff --git a/types/titanium/index.d.ts b/types/titanium/index.d.ts index 3cacf3c29e..b191fd2766 100644 --- a/types/titanium/index.d.ts +++ b/types/titanium/index.d.ts @@ -1,7001 +1,64767 @@ -// Type definitions for Titanium Mobile 3.5.0 -// Project: http://www.appcelerator.com/ -// Definitions by: Craig Younkins +// Type definitions for Titanium 7.1 +// Project: https://github.com/appcelerator/titanium_mobile +// Definitions by: Axway Appcelerator +// Jan Vennemann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 -declare namespace Ti { - export var apiName : string; - export var bubbleParent : boolean; - export var buildDate : string; - export var buildHash : string; - export var userAgent : string; - export var version : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createBuffer (params: CreateBufferArgs) : Ti.Buffer; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getBuildDate () : string; - export function getBuildHash () : string; - export function getUserAgent () : string; - export function getVersion () : string; - export function include (name: string) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setUserAgent (userAgent: string) : void; - export module XML { - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function parseString (xml: string) : Ti.XML.Document; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function serializeToString (node: Ti.XML.Node) : string; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Entity extends Ti.XML.Node { - notationName : string; - publicId : string; - systemId : string; - getNotationName () : string; - getPublicId () : string; - getSystemId () : string; - } - export interface Node extends Ti.Proxy { - ATTRIBUTE_NODE : number; - CDATA_SECTION_NODE : number; - COMMENT_NODE : number; - DOCUMENT_FRAGMENT_NODE : number; - DOCUMENT_NODE : number; - DOCUMENT_TYPE_NODE : number; - ELEMENT_NODE : number; - ENTITY_NODE : number; - ENTITY_REFERENCE_NODE : number; - NOTATION_NODE : number; - PROCESSING_INSTRUCTION_NODE : number; - TEXT_NODE : number; - attributes : Ti.XML.NamedNodeMap; - childNodes : Ti.XML.NodeList; - firstChild : Ti.XML.Node; - lastChild : Ti.XML.Node; - localName : string; - namespaceURI : string; - nextSibling : Ti.XML.Node; - nodeName : string; - nodeType : number; - nodeValue : string; - ownerDocument : Ti.XML.Document; - parentNode : Ti.XML.Node; - prefix : string; - previousSibling : Ti.XML.Node; - text : string; - textContent : string; - appendChild (newChild: Ti.XML.Node) : Ti.XML.Node; - cloneNode (deep: boolean) : Ti.XML.Node; - getAttributes () : Ti.XML.NamedNodeMap; - getChildNodes () : Ti.XML.NodeList; - getFirstChild () : Ti.XML.Node; - getLastChild () : Ti.XML.Node; - getLocalName () : string; - getNamespaceURI () : string; - getNextSibling () : Ti.XML.Node; - getNodeName () : string; - getNodeType () : number; - getNodeValue () : string; - getOwnerDocument () : Ti.XML.Document; - getParentNode () : Ti.XML.Node; - getPrefix () : string; - getPreviousSibling () : Ti.XML.Node; - getText () : string; - getTextContent () : string; - hasAttributes () : boolean; - hasChildNodes () : boolean; - insertBefore (newChild: Ti.XML.Node, refChild: Ti.XML.Node) : Ti.XML.Node; - isSupported (feature: string, version: string) : boolean; - normalize () : void; - removeChild (oldChild: Ti.XML.Node) : Ti.XML.Node; - replaceChild (newChild: Ti.XML.Node, oldChild: Ti.XML.Node) : Ti.XML.Node; - setLocalName (localName: string) : void; - setNodeValue (nodeValue: string) : void; - setPrefix (prefix: string) : void; - } - export enum EntityReference { +declare const Ti: typeof Titanium; - } - export interface CharacterData extends Ti.XML.Node { - data : string; - length : number; - appendData (arg: string) : void; - deleteData (offset: number, count: number) : void; - getData () : string; - getLength () : number; - insertData (offset: number, arg: string) : void; - replaceData (offset: number, count: number, arg: string) : void; - setData (data: string) : void; - substringData (offset: number, count: number) : string; - } - export interface DOMImplementation extends Ti.Proxy { - createDocument (namespaceURI: string, qualifiedName: string, doctype: Ti.XML.DocumentType) : Ti.XML.Document; - createDocumentType (qualifiedName: string, publicId: string, systemId: string) : Ti.XML.DocumentType; - hasFeature (feature: string, version: string) : boolean; - } - export interface Document extends Ti.XML.Node { - doctype : Ti.XML.DocumentType; - documentElement : Ti.XML.Element; - implementation : Ti.XML.DOMImplementation; - createAttribute (name: string) : Ti.XML.Attr; - createAttributeNS (namespaceURI: string, name: string) : Ti.XML.Attr; - createCDATASection (data: string) : Ti.XML.CDATASection; - createComment (data: string) : Ti.XML.Comment; - createDocumentFragment () : Ti.XML.DocumentFragment; - createElement (tagName: string) : Ti.XML.Element; - createElementNS (namespaceURI: string, name: string) : Ti.XML.Element; - createEntityReference (name: string) : Ti.XML.EntityReference; - createProcessingInstruction (target: string, data: string) : Ti.XML.ProcessingInstruction; - createTextNode (data: string) : Ti.XML.Text; - getDoctype () : Ti.XML.DocumentType; - getDocumentElement () : Ti.XML.Element; - getElementById (elementId: string) : Ti.XML.Element; - getElementsByTagName (tagname: string) : Ti.XML.NodeList; - getElementsByTagNameNS (namespaceURI: string, localname: string) : Ti.XML.NodeList; - getImplementation () : Ti.XML.DOMImplementation; - importNode (importedNode: Ti.XML.Node, deep: boolean) : Ti.XML.Node; - } - export interface Attr extends Ti.XML.Node { - name : string; - ownerElement : Ti.XML.Element; - specified : boolean; - value : string; - getName () : string; - getOwnerElement () : Ti.XML.Element; - getSpecified () : boolean; - getValue () : string; - setValue (value: string) : void; - } - export interface ProcessingInstruction extends Ti.Proxy { - data : string; - target : string; - getData () : string; - getTarget () : string; - setData (data: string) : void; - } - export interface NamedNodeMap extends Ti.Proxy { - length : number; - getLength () : number; - getNamedItem (name: string) : Ti.XML.Node; - getNamedItemNS (namespaceURI: string, localName: string) : Ti.XML.Node; - item (index: number) : Ti.XML.Node; - removeNamedItem (name: string) : Ti.XML.Node; - removeNamedItemNS (namespaceURI: string, localName: string) : Ti.XML.Node; - setNamedItem (node: Ti.XML.Node) : Ti.XML.Node; - setNamedItemNS (node: Ti.XML.Node) : Ti.XML.Node; - } - export enum CDATASection { +/** + * The top-level Titanium module. + */ +declare namespace Titanium { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; - } - export interface Text extends Ti.XML.CharacterData { - splitText (offset: number) : Ti.XML.Text; - } - export enum Comment { + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; - } - export enum DocumentFragment { + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; - } - export interface Notation extends Ti.Proxy { - publicId : string; - systemId : string; - getPublicId () : string; - getSystemId () : string; - } - export interface NodeList extends Ti.Proxy { - length : number; - getLength () : number; - item (index: number) : Ti.XML.Node; - } - export interface DocumentType extends Ti.XML.Node { - entities : Ti.XML.NamedNodeMap; - internalSubset : string; - name : string; - notations : Ti.XML.NamedNodeMap; - publicId : string; - systemId : string; - getEntities () : Ti.XML.NamedNodeMap; - getInternalSubset () : string; - getName () : string; - getNotations () : Ti.XML.NamedNodeMap; - getPublicId () : string; - getSystemId () : string; - } - export interface Element extends Ti.XML.Node { - tagName : string; - getAttribute (name: string) : string; - getAttributeNS (namespaceURI: string, localName: string) : string; - getAttributeNode (name: string) : Ti.XML.Attr; - getAttributeNodeNS (namespaceURI: string, localName: string) : Ti.XML.Attr; - getElementsByTagName (name: string) : Ti.XML.NodeList; - getElementsByTagNameNS (namespaceURI: string, localName: string) : Ti.XML.NodeList; - getTagName () : string; - hasAttribute (name: string) : boolean; - hasAttributeNS (namespaceURI: string, localName: string) : boolean; - removeAttribute (name: string) : void; - removeAttributeNS (namespaceURI: string, localName: string) : void; - removeAttributeNode (oldAttr: Ti.XML.Attr) : void; - setAttribute (name: string, value: string) : void; - setAttributeNS (namespaceURI: string, qualifiedName: string, value: string) : void; - setAttributeNode (newAttr: Ti.XML.Attr) : Ti.XML.Attr; - setAttributeNodeNS (newAttr: Ti.XML.Attr) : Ti.XML.Attr; - } - } - export enum BlobStream { + /** + * User-agent string used by Titanium. + */ + let userAgent: string; + + /** + * Version of Titanium that is executing. + */ + const version: string; + + /** + * Date of the Titanium build. + */ + const buildDate: string; + + /** + * Git hash of the Titanium build. + */ + const buildHash: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates a new buffer based on the params. + */ + function createBuffer(params: CreateBufferArgs): Titanium.Buffer; + + /** + * Creates and returns an instance of . + */ + function createProxy(parameters?: any): Titanium.Proxy; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getUserAgent(): string; + + /** + * Sets the value of the property. + */ + function setUserAgent(userAgent: string): void; + + /** + * Gets the value of the property. + */ + function getVersion(): string; + + /** + * Gets the value of the property. + */ + function getBuildDate(): string; + + /** + * Gets the value of the property. + */ + function getBuildHash(): string; + + /** + * The base for all Titanium objects. + */ + interface Proxy { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + readonly apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + lifecycleContainer?: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + getApiName(): string; + + /** + * Gets the value of the property. + */ + getLifecycleContainer?(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + setLifecycleContainer?(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + setLifecycleContainer?(lifecycleContainer: Titanium.UI.TabGroup): void; } - export interface IOStream extends Ti.Proxy { - close () : void; - isReadable () : boolean; - isWriteable () : boolean; - read (buffer: Ti.Buffer, offset?: number, length?: number) : number; - write (buffer: Ti.Buffer, offset?: number, length?: number) : number; - } - export module UI { - export var ANIMATION_CURVE_EASE_IN : number; - export var ANIMATION_CURVE_EASE_IN_OUT : number; - export var ANIMATION_CURVE_EASE_OUT : number; - export var ANIMATION_CURVE_LINEAR : number; - export var AUTODETECT_ADDRESS : number; - export var AUTODETECT_ALL : number; - export var AUTODETECT_CALENDAR : number; - export var AUTODETECT_LINK : number; - export var AUTODETECT_NONE : number; - export var AUTODETECT_PHONE : number; - export var AUTOLINK_ALL : number; - export var AUTOLINK_CALENDAR : number; - export var AUTOLINK_EMAIL_ADDRESSES : number; - export var AUTOLINK_MAP_ADDRESSES : number; - export var AUTOLINK_NONE : number; - export var AUTOLINK_PHONE_NUMBERS : number; - export var AUTOLINK_URLS : number; - export var BLEND_MODE_CLEAR : number; - export var BLEND_MODE_COLOR : number; - export var BLEND_MODE_COLOR_BURN : number; - export var BLEND_MODE_COLOR_DODGE : number; - export var BLEND_MODE_COPY : number; - export var BLEND_MODE_DARKEN : number; - export var BLEND_MODE_DESTINATION_ATOP : number; - export var BLEND_MODE_DESTINATION_IN : number; - export var BLEND_MODE_DESTINATION_OUT : number; - export var BLEND_MODE_DESTINATION_OVER : number; - export var BLEND_MODE_DIFFERENCE : number; - export var BLEND_MODE_EXCLUSION : number; - export var BLEND_MODE_HARD_LIGHT : number; - export var BLEND_MODE_HUE : number; - export var BLEND_MODE_LIGHTEN : number; - export var BLEND_MODE_LUMINOSITY : number; - export var BLEND_MODE_MULTIPLY : number; - export var BLEND_MODE_NORMAL : number; - export var BLEND_MODE_OVERLAY : number; - export var BLEND_MODE_PLUS_DARKER : number; - export var BLEND_MODE_PLUS_LIGHTER : number; - export var BLEND_MODE_SATURATION : number; - export var BLEND_MODE_SCREEN : number; - export var BLEND_MODE_SOFT_LIGHT : number; - export var BLEND_MODE_SOURCE_ATOP : number; - export var BLEND_MODE_SOURCE_IN : number; - export var BLEND_MODE_SOURCE_OUT : number; - export var BLEND_MODE_XOR : number; - export var EXTEND_EDGE_ALL : number; - export var EXTEND_EDGE_BOTTOM : number; - export var EXTEND_EDGE_LEFT : number; - export var EXTEND_EDGE_NONE : number; - export var EXTEND_EDGE_RIGHT : number; - export var EXTEND_EDGE_TOP : number; - export var FACE_DOWN : number; - export var FACE_UP : number; - export var FILL : string; - export var INHERIT : string; - export var INPUT_BORDERSTYLE_BEZEL : number; - export var INPUT_BORDERSTYLE_LINE : number; - export var INPUT_BORDERSTYLE_NONE : number; - export var INPUT_BORDERSTYLE_ROUNDED : number; - export var INPUT_BUTTONMODE_ALWAYS : number; - export var INPUT_BUTTONMODE_NEVER : number; - export var INPUT_BUTTONMODE_ONBLUR : number; - export var INPUT_BUTTONMODE_ONFOCUS : number; - export var KEYBOARD_APPEARANCE_ALERT : number; - export var KEYBOARD_APPEARANCE_DEFAULT : number; - export var KEYBOARD_ASCII : number; - export var KEYBOARD_DECIMAL_PAD : number; - export var KEYBOARD_DEFAULT : number; - export var KEYBOARD_EMAIL : number; - export var KEYBOARD_NAMEPHONE_PAD : number; - export var KEYBOARD_NUMBERS_PUNCTUATION : number; - export var KEYBOARD_NUMBER_PAD : number; - export var KEYBOARD_PHONE_PAD : number; - export var KEYBOARD_URL : number; - export var LANDSCAPE_LEFT : number; - export var LANDSCAPE_RIGHT : number; - export var LIST_ACCESSORY_TYPE_CHECKMARK : number; - export var LIST_ACCESSORY_TYPE_DETAIL : number; - export var LIST_ACCESSORY_TYPE_DISCLOSURE : number; - export var LIST_ACCESSORY_TYPE_NONE : number; - export var LIST_ITEM_TEMPLATE_CONTACTS : number; - export var LIST_ITEM_TEMPLATE_DEFAULT : number; - export var LIST_ITEM_TEMPLATE_SETTINGS : number; - export var LIST_ITEM_TEMPLATE_SUBTITLE : number; - export var NOTIFICATION_DURATION_LONG : number; - export var NOTIFICATION_DURATION_SHORT : number; - export var PICKER_TYPE_COUNT_DOWN_TIMER : number; - export var PICKER_TYPE_DATE : number; - export var PICKER_TYPE_DATE_AND_TIME : number; - export var PICKER_TYPE_PLAIN : number; - export var PICKER_TYPE_TIME : number; - export var PORTRAIT : number; - export var RETURNKEY_DEFAULT : number; - export var RETURNKEY_DONE : number; - export var RETURNKEY_EMERGENCY_CALL : number; - export var RETURNKEY_GO : number; - export var RETURNKEY_GOOGLE : number; - export var RETURNKEY_JOIN : number; - export var RETURNKEY_NEXT : number; - export var RETURNKEY_ROUTE : number; - export var RETURNKEY_SEARCH : number; - export var RETURNKEY_SEND : number; - export var RETURNKEY_YAHOO : number; - export var SIZE : string; - export var TEXT_ALIGNMENT_CENTER : any; - export var TEXT_ALIGNMENT_LEFT : any; - export var TEXT_ALIGNMENT_RIGHT : any; - export var TEXT_AUTOCAPITALIZATION_ALL : number; - export var TEXT_AUTOCAPITALIZATION_NONE : number; - export var TEXT_AUTOCAPITALIZATION_SENTENCES : number; - export var TEXT_AUTOCAPITALIZATION_WORDS : number; - export var TEXT_STYLE_BODY : string; - export var TEXT_STYLE_CAPTION1 : string; - export var TEXT_STYLE_CAPTION2 : string; - export var TEXT_STYLE_FOOTNOTE : string; - export var TEXT_STYLE_HEADLINE : string; - export var TEXT_STYLE_SUBHEADLINE : string; - export var TEXT_VERTICAL_ALIGNMENT_BOTTOM : any; - export var TEXT_VERTICAL_ALIGNMENT_CENTER : any; - export var TEXT_VERTICAL_ALIGNMENT_TOP : any; - export var UNIT_CM : string; - export var UNIT_DIP : string; - export var UNIT_IN : string; - export var UNIT_MM : string; - export var UNIT_PX : string; - export var UNKNOWN : number; - export var UPSIDE_PORTRAIT : number; - export var URL_ERROR_AUTHENTICATION : number; - export var URL_ERROR_BAD_URL : number; - export var URL_ERROR_CONNECT : number; - export var URL_ERROR_FILE : number; - export var URL_ERROR_FILE_NOT_FOUND : number; - export var URL_ERROR_HOST_LOOKUP : number; - export var URL_ERROR_REDIRECT_LOOP : number; - export var URL_ERROR_SSL_FAILED : number; - export var URL_ERROR_TIMEOUT : number; - export var URL_ERROR_UNKNOWN : number; - export var URL_ERROR_UNSUPPORTED_SCHEME : number; - export var apiName : string; - export var backgroundColor : string; - export var backgroundImage : string; - export var bubbleParent : boolean; - export var currentTab : Ti.UI.Tab; - export var currentWindow : Ti.UI.Window; - export var orientation : number; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function convertUnits (convertFromValue: string, convertToUnits: number) : number; - export function create2DMatrix (parameters?: MatrixCreationDict) : Ti.UI._2DMatrix; - export function create3DMatrix (parameters?: Dictionary) : Ti.UI._3DMatrix; - export function createActivityIndicator (parameters?: Dictionary) : Ti.UI.ActivityIndicator; - export function createAlertDialog (parameters?: Dictionary) : Ti.UI.AlertDialog; - export function createAnimation (parameters?: Dictionary) : Ti.UI.Animation; - export function createButton (parameters?: Dictionary) : Ti.UI.Button; - export function createButtonBar (parameters?: Dictionary) : Ti.UI.ButtonBar; - export function createCoverFlowView (parameters?: Dictionary) : Ti.UI.CoverFlowView; - export function createDashboardItem (parameters?: Dictionary) : Ti.UI.DashboardItem; - export function createDashboardView (parameters?: Dictionary) : Ti.UI.DashboardView; - export function createEmailDialog (parameters?: Dictionary) : Ti.UI.EmailDialog; - export function createImageView (parameters?: Dictionary) : Ti.UI.ImageView; - export function createLabel (parameters?: Dictionary) : Ti.UI.Label; - export function createListSection (parameters?: Dictionary) : Ti.UI.ListSection; - export function createListView (parameters?: Dictionary) : Ti.UI.ListView; - export function createMaskedImage (parameters?: Dictionary) : Ti.UI.MaskedImage; - export function createNotification (parameters?: Dictionary) : Ti.UI.Notification; - export function createOptionDialog (parameters?: Dictionary) : Ti.UI.OptionDialog; - export function createPicker (parameters?: Dictionary) : Ti.UI.Picker; - export function createPickerColumn (parameters?: Dictionary) : Ti.UI.PickerColumn; - export function createPickerRow (parameters?: Dictionary) : Ti.UI.PickerRow; - export function createProgressBar (parameters?: Dictionary) : Ti.UI.ProgressBar; - export function createRefreshControl (parameters?: Dictionary) : Ti.UI.RefreshControl; - export function createSMSDialog (parameters?: Dictionary) : Ti.UI.SMSDialog; - export function createScrollView (parameters?: Dictionary) : Ti.UI.ScrollView; - export function createScrollableView (parameters?: Dictionary) : Ti.UI.ScrollableView; - export function createSearchBar (parameters?: Dictionary) : Ti.UI.SearchBar; - export function createSlider (parameters?: Dictionary) : Ti.UI.Slider; - export function createSwitch (parameters?: Dictionary) : Ti.UI.Switch; - export function createTab (parameters?: Dictionary) : Ti.UI.Tab; - export function createTabGroup (parameters?: Dictionary) : Ti.UI.TabGroup; - export function createTabbedBar (parameters?: Dictionary) : Ti.UI.TabbedBar; - export function createTableView (parameters?: Dictionary) : Ti.UI.TableView; - export function createTableViewRow (parameters?: Dictionary) : Ti.UI.TableViewRow; - export function createTableViewSection (parameters?: Dictionary) : Ti.UI.TableViewSection; - export function createTextArea (parameters?: Dictionary) : Ti.UI.TextArea; - export function createTextField (parameters?: Dictionary) : Ti.UI.TextField; - export function createToolbar (parameters?: Dictionary) : Ti.UI.Toolbar; - export function createView (parameters?: Dictionary) : Ti.UI.View; - export function createWebView (parameters?: Dictionary) : Ti.UI.WebView; - export function createWindow (parameters?: Dictionary) : Ti.UI.Window; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBackgroundColor () : string; - export function getBackgroundImage () : string; - export function getBubbleParent () : boolean; - export function getCurrentTab () : Ti.UI.Tab; - export function getCurrentWindow () : Ti.UI.Window; - export function getOrientation () : number; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBackgroundColor (backgroundColor: string) : void; - export function setBackgroundImage (backgroundImage: string) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setCurrentTab (currentTab: Ti.UI.Tab) : void; - export function setOrientation (orientation: number) : void; - export module iPad { - export var POPOVER_ARROW_DIRECTION_ANY : number; - export var POPOVER_ARROW_DIRECTION_DOWN : number; - export var POPOVER_ARROW_DIRECTION_LEFT : number; - export var POPOVER_ARROW_DIRECTION_RIGHT : number; - export var POPOVER_ARROW_DIRECTION_UNKNOWN : number; - export var POPOVER_ARROW_DIRECTION_UP : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createDocumentViewer (parameters?: Dictionary) : Ti.UI.iPad.DocumentViewer; - export function createPopover (parameters?: Dictionary) : Ti.UI.iPad.Popover; - export function createSplitWindow (parameters?: Dictionary) : Ti.UI.iPad.SplitWindow; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface SplitWindow extends Ti.UI.Window { - detailView : Ti.UI.View; - masterView : Ti.UI.View; - showMasterInPortrait : boolean; - getDetailView () : Ti.UI.View; - getMasterView () : Ti.UI.View; - getShowMasterInPortrait () : boolean; - setShowMasterInPortrait (showMasterInPortrait: boolean) : void; - } - export interface DocumentViewer extends Ti.UI.View { - setUrl (url: string) : void; - show () : void; - } - export interface Popover extends Ti.Proxy { - arrowDirection : number; - contentView : Ti.UI.View; - height : any; - leftNavButton : any; - passthroughViews : Array; - rightNavButton : any; - title : string; - width : any; - add () : void; - getArrowDirection () : number; - getContentView () : Ti.UI.View; - getHeight () : any; - getLeftNavButton () : any; - getPassthroughViews () : Array; - getRightNavButton () : any; - getTitle () : string; - getWidth () : any; - hide (options: PopoverParams) : void; - remove () : void; - setArrowDirection (arrowDirection: number) : void; - setContentView (contentView: Ti.UI.View) : void; - setHeight (height: number) : void; - setHeight (height: string) : void; - setLeftNavButton (leftNavButton: any) : void; - setPassthroughViews (passthroughViews: Array) : void; - setRightNavButton (rightNavButton: any) : void; - setTitle (title: string) : void; - setWidth (width: number) : void; - setWidth (width: string) : void; - show (params: PopoverParams) : void; - } - } - export module iOS { - export var AD_SIZE_LANDSCAPE : string; - export var AD_SIZE_PORTRAIT : string; - export var ANIMATION_CURVE_EASE_IN : number; - export var ANIMATION_CURVE_EASE_IN_OUT : number; - export var ANIMATION_CURVE_EASE_OUT : number; - export var ANIMATION_CURVE_LINEAR : number; - export var ATTRIBUTE_BACKGROUND_COLOR : number; - export var ATTRIBUTE_BASELINE_OFFSET : number; - export var ATTRIBUTE_EXPANSION : number; - export var ATTRIBUTE_FONT : number; - export var ATTRIBUTE_FOREGROUND_COLOR : number; - export var ATTRIBUTE_KERN : number; - export var ATTRIBUTE_LETTERPRESS_STYLE : number; - export var ATTRIBUTE_LIGATURE : number; - export var ATTRIBUTE_LINK : number; - export var ATTRIBUTE_OBLIQUENESS : number; - export var ATTRIBUTE_SHADOW : number; - export var ATTRIBUTE_STRIKETHROUGH_COLOR : number; - export var ATTRIBUTE_STRIKETHROUGH_STYLE : number; - export var ATTRIBUTE_STROKE_COLOR : number; - export var ATTRIBUTE_STROKE_WIDTH : number; - export var ATTRIBUTE_TEXT_EFFECT : number; - export var ATTRIBUTE_UNDERLINES_STYLE : number; - export var ATTRIBUTE_UNDERLINE_BY_WORD : number; - export var ATTRIBUTE_UNDERLINE_COLOR : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_DASH : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_DOT : number; - export var ATTRIBUTE_UNDERLINE_PATTERN_SOLID : number; - export var ATTRIBUTE_UNDERLINE_STYLE_DOUBLE : number; - export var ATTRIBUTE_UNDERLINE_STYLE_NONE : number; - export var ATTRIBUTE_UNDERLINE_STYLE_SINGLE : number; - export var ATTRIBUTE_UNDERLINE_STYLE_THICK : number; - export var ATTRIBUTE_WRITING_DIRECTION : number; - export var ATTRIBUTE_WRITING_DIRECTION_EMBEDDING : number; - export var ATTRIBUTE_WRITING_DIRECTION_LEFT_TO_RIGHT : number; - export var ATTRIBUTE_WRITING_DIRECTION_NATURAL : number; - export var ATTRIBUTE_WRITING_DIRECTION_OVERRIDE : number; - export var ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT : number; - export var AUTODETECT_ADDRESS : number; - export var AUTODETECT_ALL : number; - export var AUTODETECT_CALENDAR : number; - export var AUTODETECT_LINK : number; - export var AUTODETECT_NONE : number; - export var AUTODETECT_PHONE : number; - export var BLEND_MODE_CLEAR : number; - export var BLEND_MODE_COLOR : number; - export var BLEND_MODE_COLOR_BURN : number; - export var BLEND_MODE_COLOR_DODGE : number; - export var BLEND_MODE_COPY : number; - export var BLEND_MODE_DARKEN : number; - export var BLEND_MODE_DESTINATION_ATOP : number; - export var BLEND_MODE_DESTINATION_IN : number; - export var BLEND_MODE_DESTINATION_OUT : number; - export var BLEND_MODE_DESTINATION_OVER : number; - export var BLEND_MODE_DIFFERENCE : number; - export var BLEND_MODE_EXCLUSION : number; - export var BLEND_MODE_HARD_LIGHT : number; - export var BLEND_MODE_HUE : number; - export var BLEND_MODE_LIGHTEN : number; - export var BLEND_MODE_LUMINOSITY : number; - export var BLEND_MODE_MULTIPLY : number; - export var BLEND_MODE_NORMAL : number; - export var BLEND_MODE_OVERLAY : number; - export var BLEND_MODE_PLUS_DARKER : number; - export var BLEND_MODE_PLUS_LIGHTER : number; - export var BLEND_MODE_SATURATION : number; - export var BLEND_MODE_SCREEN : number; - export var BLEND_MODE_SOFT_LIGHT : number; - export var BLEND_MODE_SOURCE_ATOP : number; - export var BLEND_MODE_SOURCE_IN : number; - export var BLEND_MODE_SOURCE_OUT : number; - export var BLEND_MODE_XOR : number; - export var CLIP_MODE_DEFAULT : number; - export var CLIP_MODE_DISABLED : number; - export var CLIP_MODE_ENABLED : number; - export var COLLISION_MODE_ALL : number; - export var COLLISION_MODE_BOUNDARY : number; - export var COLLISION_MODE_ITEM : number; - export var COLOR_GROUP_TABLEVIEW_BACKGROUND : string; - export var COLOR_SCROLLVIEW_BACKGROUND : string; - export var COLOR_UNDER_PAGE_BACKGROUND : string; - export var COLOR_VIEW_FLIPSIDE_BACKGROUND : string; - export var PUSH_MODE_CONTINUOUS : number; - export var PUSH_MODE_INSTANTANEOUS : number; - export var SCROLL_DECELERATION_RATE_FAST : number; - export var SCROLL_DECELERATION_RATE_NORMAL : number; - export var WEBVIEW_NAVIGATIONTYPE_BACK_FORWARD : number; - export var WEBVIEW_NAVIGATIONTYPE_FORM_RESUBMITTED : number; - export var WEBVIEW_NAVIGATIONTYPE_FORM_SUBMITTED : number; - export var WEBVIEW_NAVIGATIONTYPE_LINK_CLICKED : number; - export var WEBVIEW_NAVIGATIONTYPE_OTHER : number; - export var WEBVIEW_NAVIGATIONTYPE_RELOAD : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function create3DMatrix (parameters?: Dictionary) : Ti.UI.iOS._3DMatrix; - export function createAdView (parameters?: Dictionary) : Ti.UI.iOS.AdView; - export function createAnchorAttachmentBehavior (parameters?: Dictionary) : Ti.UI.iOS.AnchorAttachmentBehavior; - export function createAnimator (parameters?: Dictionary) : Ti.UI.iOS.Animator; - export function createAttributedString (parameters?: Dictionary) : Ti.UI.iOS.AttributedString; - export function createCollisionBehavior (parameters?: Dictionary) : Ti.UI.iOS.CollisionBehavior; - export function createCoverFlowView (parameters?: Dictionary) : Ti.UI.iOS.CoverFlowView; - export function createDocumentViewer (parameters?: Dictionary) : Ti.UI.iOS.DocumentViewer; - export function createDynamicItemBehavior (parameters?: Dictionary) : Ti.UI.iOS.DynamicItemBehavior; - export function createGravityBehavior (parameters?: Dictionary) : Ti.UI.iOS.GravityBehavior; - export function createNavigationWindow (parameters?: Dictionary) : Ti.UI.iOS.NavigationWindow; - export function createPushBehavior (parameters?: Dictionary) : Ti.UI.iOS.PushBehavior; - export function createSnapBehavior (parameters?: Dictionary) : Ti.UI.iOS.SnapBehavior; - export function createTabbedBar (parameters?: Dictionary) : Ti.UI.iOS.TabbedBar; - export function createToolbar (parameters?: Dictionary) : Ti.UI.iOS.Toolbar; - export function createTransitionAnimation (transition: transitionAnimationParam) : Ti.Proxy; - export function createViewAttachmentBehavior (parameters?: Dictionary) : Ti.UI.iOS.ViewAttachmentBehavior; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Animator extends Ti.Proxy { - behaviors : Array; - referenceView : Ti.UI.View; - running : boolean; - addBehavior (behavior: Ti.Proxy) : void; - getBehaviors () : Array; - getReferenceView () : Ti.UI.View; - getRunning () : boolean; - removeAllBehaviors () : void; - removeBehavior (behavior: Ti.Proxy) : void; - setBehaviors (behaviors: Array) : void; - setReferenceView (referenceView: Ti.UI.View) : void; - startAnimator () : void; - stopAnimator () : void; - updateItemUsingCurrentState (item: Ti.UI.View) : void; - } - export interface DynamicItemBehavior extends Ti.Proxy { - allowsRotation : boolean; - angularResistance : number; - density : number; - elasticity : number; - friction : number; - items : Array; - resistance : number; - addAngularVelocityForItem (item: Ti.UI.View, velocity: number) : void; - addItem (item: Ti.UI.View) : void; - addLinearVelocityForItem (item: Ti.UI.View, velocity: Point) : void; - angularVelocityForItem (item: Ti.UI.View) : number; - getAllowsRotation () : boolean; - getAngularResistance () : number; - getDensity () : number; - getElasticity () : number; - getFriction () : number; - getItems () : Array; - getResistance () : number; - linearVelocityForItem (item: Ti.UI.View) : Point; - removeItem (item: Ti.UI.View) : void; - setAllowsRotation (allowsRotation: boolean) : void; - setAngularResistance (angularResistance: number) : void; - setDensity (density: number) : void; - setElasticity (elasticity: number) : void; - setFriction (friction: number) : void; - setResistance (resistance: number) : void; - } - export interface SnapBehavior extends Ti.Proxy { - damping : number; - item : Ti.UI.View; - snapPoint : Point; - getDamping () : number; - getItem () : Ti.UI.View; - getSnapPoint () : Point; - setDamping (damping: number) : void; - setItem (item: Ti.UI.View) : void; - setSnapPoint (snapPoint: Point) : void; - } - export interface GravityBehavior extends Ti.Proxy { - angle : number; - gravityDirection : Point; - items : Array; - magnitude : number; - addItem (item: Ti.UI.View) : void; - getAngle () : number; - getGravityDirection () : Point; - getItems () : Array; - getMagnitude () : number; - removeItem (item: Ti.UI.View) : void; - setAngle (angle: number) : void; - setGravityDirection (gravityDirection: Point) : void; - setMagnitude (magnitude: number) : void; - } - export interface CollisionBehavior extends Ti.Proxy { - boundaryIdentifiers : Array; - collisionMode : number; - items : Array; - referenceInsets : ReferenceInsets; - treatReferenceAsBoundary : boolean; - addBoundary (boundary: BoundaryIdentifier) : void; - addItem (item: Ti.UI.View) : void; - getBoundaryIdentifiers () : Array; - getCollisionMode () : number; - getItems () : Array; - getReferenceInsets () : ReferenceInsets; - getTreatReferenceAsBoundary () : boolean; - removeAllBoundaries () : void; - removeBoundary (boundary: BoundaryIdentifier) : void; - removeItem (item: Ti.UI.View) : void; - setCollisionMode (collisionMode: number) : void; - setReferenceInsets (referenceInsets: ReferenceInsets) : void; - setTreatReferenceAsBoundary (treatReferenceAsBoundary: boolean) : void; - } - export interface Toolbar extends Ti.UI.View { - barColor : string; - borderBottom : boolean; - borderTop : boolean; - extendBackground : boolean; - items : Array; - translucent : boolean; - getBarColor () : string; - getBorderBottom () : boolean; - getBorderTop () : boolean; - getExtendBackground () : boolean; - getItems () : Array; - getTranslucent () : boolean; - setBarColor (barColor: string) : void; - setBorderBottom (borderBottom: boolean) : void; - setBorderTop (borderTop: boolean) : void; - setItems (items: Array) : void; - setTranslucent (translucent: boolean) : void; - } - export interface ViewAttachmentBehavior extends Ti.Proxy { - anchorItem : Ti.UI.View; - anchorOffset : Point; - damping : number; - distance : number; - frequency : number; - item : Ti.UI.View; - itemOffset : Point; - getAnchorItem () : Ti.UI.View; - getAnchorOffset () : Point; - getDamping () : number; - getDistance () : number; - getFrequency () : number; - getItem () : Ti.UI.View; - getItemOffset () : Point; - setAnchorItem (anchorItem: Ti.UI.View) : void; - setAnchorOffset (anchorOffset: Point) : void; - setDamping (damping: number) : void; - setDistance (distance: number) : void; - setFrequency (frequency: number) : void; - setItem (item: Ti.UI.View) : void; - setItemOffset (itemOffset: Point) : void; - } - export interface PushBehavior extends Ti.Proxy { - active : boolean; - angle : number; - items : Array; - magnitude : number; - pushDirection : Point; - pushMode : number; - addItem (item: Ti.UI.View) : void; - getActive () : boolean; - getAngle () : number; - getItems () : Array; - getMagnitude () : number; - getPushDirection () : Point; - getPushMode () : number; - removeItem (item: Ti.UI.View) : void; - setActive (active: boolean) : void; - setAngle (angle: number) : void; - setMagnitude (magnitude: number) : void; - setPushDirection (pushDirection: Point) : void; - setPushMode (pushMode: number) : void; - } - export interface CoverFlowView extends Ti.UI.View { - images : any; - selected : number; - getImages () : any; - getSelected () : number; - setImage (index: number, image: string) : void; - setImage (image: Ti.Blob) : void; - setImage (image: Ti.Filesystem.File) : void; - setImage (index: number, image: CoverFlowImageType) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setSelected (selected: number) : void; - } - export interface DocumentViewer extends Ti.UI.View { - name : string; - url : string; - getName () : string; - getUrl () : string; - hide (options?: DocumentViewerOptions) : void; - setUrl (url: string) : void; - show (options?: DocumentViewerOptions) : void; - } - export interface NavigationWindow extends Ti.UI.Window { - window : Ti.UI.Window; - closeWindow (window: Ti.UI.Window, options: Dictionary) : void; - getWindow () : Ti.UI.Window; - openWindow (window: Ti.UI.Window, options: Dictionary) : void; - } - export interface AttributedString extends Ti.Proxy { - attributes : Array; - text : string; - addAttribute (attribute: Attribute) : void; - getAttributes () : Array; - getText () : string; - setAttributes (attributes: Array) : void; - setText (text: string) : void; - } - export interface AnchorAttachmentBehavior extends Ti.Proxy { - anchor : Point; - damping : number; - distance : number; - frequency : number; - item : Ti.UI.View; - offset : Point; - getAnchor () : Point; - getDamping () : number; - getDistance () : number; - getFrequency () : number; - getItem () : Ti.UI.View; - getOffset () : Point; - setAnchor (anchor: Point) : void; - setDamping (damping: number) : void; - setDistance (distance: number) : void; - setFrequency (frequency: number) : void; - setItem (item: Ti.UI.View) : void; - setOffset (offset: Point) : void; - } - export interface TabbedBar extends Ti.UI.View { - index : number; - labels : any; - style : number; - getIndex () : number; - getLabels () : any; - getStyle () : number; - setIndex (index: number) : void; - setLabels (labels: Array) : void; - setLabels (labels: Array) : void; - setStyle (style: number) : void; - } - export interface _3DMatrix extends Ti.Proxy { - m11 : number; - m12 : number; - m13 : number; - m14 : number; - m21 : number; - m22 : number; - m23 : number; - m24 : number; - m31 : number; - m32 : number; - m33 : number; - m34 : number; - m41 : number; - m42 : number; - m43 : number; - m44 : number; - getM11 () : number; - getM12 () : number; - getM13 () : number; - getM14 () : number; - getM21 () : number; - getM22 () : number; - getM23 () : number; - getM24 () : number; - getM31 () : number; - getM32 () : number; - getM33 () : number; - getM34 () : number; - getM41 () : number; - getM42 () : number; - getM43 () : number; - getM44 () : number; - invert () : Ti.UI._3DMatrix; - multiply (t2: Ti.UI._3DMatrix) : Ti.UI._3DMatrix; - rotate (angle: number, x: number, y: number, z: number) : Ti.UI._3DMatrix; - scale (sx: number, sy: number, sz: number) : Ti.UI._3DMatrix; - setM11 (m11: number) : void; - setM12 (m12: number) : void; - setM13 (m13: number) : void; - setM14 (m14: number) : void; - setM21 (m21: number) : void; - setM22 (m22: number) : void; - setM23 (m23: number) : void; - setM24 (m24: number) : void; - setM31 (m31: number) : void; - setM32 (m32: number) : void; - setM33 (m33: number) : void; - setM34 (m34: number) : void; - setM41 (m41: number) : void; - setM42 (m42: number) : void; - setM43 (m43: number) : void; - setM44 (m44: number) : void; - translate (tx: number, ty: number, tz: number) : Ti.UI._3DMatrix; - } - export interface AdView extends Ti.UI.View { - adSize : string; - cancelAction () : void; - getAdSize () : string; - setAdSize (adSize: string) : void; - } - } - export module iPhone { - export var MODAL_PRESENTATION_CURRENT_CONTEXT : number; - export var MODAL_PRESENTATION_FORMSHEET : number; - export var MODAL_PRESENTATION_FULLSCREEN : number; - export var MODAL_PRESENTATION_PAGESHEET : number; - export var MODAL_TRANSITION_STYLE_COVER_VERTICAL : number; - export var MODAL_TRANSITION_STYLE_CROSS_DISSOLVE : number; - export var MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL : number; - export var MODAL_TRANSITION_STYLE_PARTIAL_CURL : number; - export var apiName : string; - export var appBadge : number; - export var appSupportsShakeToEdit : boolean; - export var bubbleParent : boolean; - export var statusBarHidden : boolean; - export var statusBarStyle : number; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createNavigationGroup (parameters?: Dictionary) : Ti.UI.iPhone.NavigationGroup; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getAppBadge () : number; - export function getAppSupportsShakeToEdit () : boolean; - export function getBubbleParent () : boolean; - export function getStatusBarHidden () : boolean; - export function getStatusBarStyle () : number; - export function hideStatusBar (params?: hideStatusBarParams) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setAppBadge (appBadge: number) : void; - export function setAppSupportsShakeToEdit (appSupportsShakeToEdit: boolean) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function showStatusBar (params?: showStatusBarParams) : void; - export enum ScrollIndicatorStyle { - BLACK, - DEFAULT, - WHITE - } - export enum SystemButtonStyle { - BAR, - BORDERED, - DONE, - PLAIN - } - export enum ListViewStyle { - GROUPED, - PLAIN - } - export enum StatusBar { - ANIMATION_STYLE_FADE, - ANIMATION_STYLE_NONE, - ANIMATION_STYLE_SLIDE, - DEFAULT, - GRAY, - GREY, - LIGHT_CONTENT, - OPAQUE_BLACK, - TRANSLUCENT_BLACK - } - export enum SystemButton { - ACTION, - ACTIVITY, - ADD, - BOOKMARKS, - CAMERA, - CANCEL, - COMPOSE, - CONTACT_ADD, - DISCLOSURE, - DONE, - EDIT, - FAST_FORWARD, - FIXED_SPACE, - FLEXIBLE_SPACE, - INFO_DARK, - INFO_LIGHT, - ORGANIZE, - PAUSE, - PLAY, - REFRESH, - REPLY, - REWIND, - SAVE, - SPINNER, - STOP, - TRASH - } - export enum TableViewStyle { - GROUPED, - PLAIN - } - export enum SystemIcon { - BOOKMARKS, - CONTACTS, - DOWNLOADS, - FAVORITES, - FEATURED, - HISTORY, - MORE, - MOST_RECENT, - MOST_VIEWED, - RECENTS, - SEARCH, - TOP_RATED - } - export enum ActivityIndicatorStyle { - BIG, - DARK, - PLAIN - } - export enum ProgressBarStyle { - BAR, - DEFAULT, - PLAIN - } - export enum ListViewSeparatorStyle { - NONE, - SINGLE_LINE - } - export enum RowAnimationStyle { - BOTTOM, - FADE, - LEFT, - NONE, - RIGHT, - TOP - } - export enum AnimationStyle { - CURL_DOWN, - CURL_UP, - FLIP_FROM_LEFT, - FLIP_FROM_RIGHT, - NONE - } - export interface NavigationGroup extends Ti.UI.View { - window : Ti.UI.Window; - close (window: Ti.UI.Window, options: Dictionary) : void; - getWindow () : Ti.UI.Window; - open (window: Ti.UI.Window, options: Dictionary) : void; - } - export enum TableViewScrollPosition { - BOTTOM, - MIDDLE, - NONE, - TOP - } - export enum AlertDialogStyle { - DEFAULT, - LOGIN_AND_PASSWORD_INPUT, - PLAIN_TEXT_INPUT, - SECURE_TEXT_INPUT - } - export enum ListViewScrollPosition { - BOTTOM, - MIDDLE, - NONE, - TOP - } - export enum TableViewCellSelectionStyle { - BLUE, - GRAY, - NONE - } - export enum ListViewCellSelectionStyle { - BLUE, - GRAY, - NONE - } - export enum TableViewSeparatorStyle { - NONE, - SINGLE_LINE - } - } - export interface TextArea extends Ti.UI.View { - appearance : number; - attributedString : Ti.UI.iOS.AttributedString; - autoLink : number; - autocapitalization : number; - autocorrect : boolean; - clearOnEdit : boolean; - color : string; - editable : boolean; - ellipsize : boolean; - enableReturnKey : boolean; - font : Font; - handleLinks : boolean; - hintText : string; - keyboardToolbar : any; - keyboardToolbarColor : string; - keyboardToolbarHeight : number; - keyboardType : number; - maxLength : number; - returnKeyType : number; - scrollable : boolean; - scrollsToTop : boolean; - selection : textAreaSelectedParams; - suppressReturn : boolean; - textAlign : any; - value : string; - verticalAlign : any; - blur () : void; - focus () : void; - getAppearance () : number; - getAttributedString () : Ti.UI.iOS.AttributedString; - getAutoLink () : number; - getAutocapitalization () : number; - getAutocorrect () : boolean; - getClearOnEdit () : boolean; - getColor () : string; - getEditable () : boolean; - getEllipsize () : boolean; - getEnableReturnKey () : boolean; - getFont () : Font; - getHandleLinks () : boolean; - getHintText () : string; - getKeyboardToolbar () : any; - getKeyboardToolbarColor () : string; - getKeyboardToolbarHeight () : number; - getKeyboardType () : number; - getMaxLength () : number; - getReturnKeyType () : number; - getScrollable () : boolean; - getScrollsToTop () : boolean; - getSelection () : textAreaSelectedParams; - getSuppressReturn () : boolean; - getTextAlign () : any; - getValue () : string; - getVerticalAlign () : any; - hasText () : boolean; - setAppearance (appearance: number) : void; - setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; - setAutoLink (autoLink: number) : void; - setAutocapitalization (autocapitalization: number) : void; - setAutocorrect (autocorrect: boolean) : void; - setClearOnEdit (clearOnEdit: boolean) : void; - setColor (color: string) : void; - setEditable (editable: boolean) : void; - setEllipsize (ellipsize: boolean) : void; - setEnableReturnKey (enableReturnKey: boolean) : void; - setFont (font: Font) : void; - setHandleLinks (handleLinks: boolean) : void; - setHintText (hintText: string) : void; - setKeyboardToolbar (keyboardToolbar: Array) : void; - setKeyboardToolbar (keyboardToolbar: Ti.UI.iOS.Toolbar) : void; - setKeyboardToolbarColor (keyboardToolbarColor: string) : void; - setKeyboardToolbarHeight (keyboardToolbarHeight: number) : void; - setKeyboardType (keyboardType: number) : void; - setMaxLength (maxLength: number) : void; - setReturnKeyType (returnKeyType: number) : void; - setScrollable (scrollable: boolean) : void; - setScrollsToTop (scrollsToTop: boolean) : void; - setSelection (start: number, end: number) : void; - setSuppressReturn (suppressReturn: boolean) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setValue (value: string) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - } - export interface View extends Ti.Proxy { - accessibilityHidden : boolean; - accessibilityHint : string; - accessibilityLabel : string; - accessibilityValue : string; - anchorPoint : Point; - animatedCenter : Point; - backgroundColor : string; - backgroundDisabledColor : string; - backgroundDisabledImage : string; - backgroundFocusedColor : string; - backgroundFocusedImage : string; - backgroundGradient : Gradient; - backgroundImage : string; - backgroundLeftCap : number; - backgroundRepeat : boolean; - backgroundSelectedColor : string; - backgroundSelectedImage : string; - backgroundTopCap : number; - borderColor : string; - borderRadius : number; - borderWidth : number; - bottom : any; - center : Point; - children : Array; - clipMode : number; - enabled : boolean; - focusable : boolean; - height : any; - horizontalWrap : boolean; - keepScreenOn : boolean; - layout : string; - left : any; - opacity : number; - overrideCurrentAnimation : boolean; - pullBackgroundColor : string; - rect : Dimension; - right : any; - size : Dimension; - softKeyboardOnFocus : number; - tintColor : any; - top : any; - touchEnabled : boolean; - transform : any; - viewShadowColor : string; - viewShadowOffset : Point; - viewShadowRadius : number; - visible : boolean; - width : any; - zIndex : number; - add (view: Ti.UI.View) : void; - animate (animation: Ti.UI.Animation, callback: (...args : any[]) => any) : void; - animate (animation: Dictionary, callback: (...args : any[]) => any) : void; - convertPointToView (point: Point, destinationView: Ti.UI.View) : Point; - finishLayout () : void; - getAccessibilityHidden () : boolean; - getAccessibilityHint () : string; - getAccessibilityLabel () : string; - getAccessibilityValue () : string; - getAnchorPoint () : Point; - getAnimatedCenter () : Point; - getBackgroundColor () : string; - getBackgroundDisabledColor () : string; - getBackgroundDisabledImage () : string; - getBackgroundFocusedColor () : string; - getBackgroundFocusedImage () : string; - getBackgroundGradient () : Gradient; - getBackgroundImage () : string; - getBackgroundLeftCap () : number; - getBackgroundRepeat () : boolean; - getBackgroundSelectedColor () : string; - getBackgroundSelectedImage () : string; - getBackgroundTopCap () : number; - getBorderColor () : string; - getBorderRadius () : number; - getBorderWidth () : number; - getBottom () : any; - getCenter () : Point; - getChildren () : Array; - getClipMode () : number; - getEnabled () : boolean; - getFocusable () : boolean; - getHeight () : any; - getHorizontalWrap () : boolean; - getKeepScreenOn () : boolean; - getLayout () : string; - getLeft () : any; - getOpacity () : number; - getOverrideCurrentAnimation () : boolean; - getPullBackgroundColor () : string; - getRect () : Dimension; - getRight () : any; - getSize () : Dimension; - getSoftKeyboardOnFocus () : number; - getTintColor () : string; - getTop () : any; - getTouchEnabled () : boolean; - getTransform () : any; - getViewShadowColor () : string; - getViewShadowOffset () : Point; - getViewShadowRadius () : number; - getVisible () : boolean; - getWidth () : any; - getZIndex () : number; - hide () : void; - remove (view: Ti.UI.View) : void; - removeAllChildren () : void; - setAccessibilityHidden (accessibilityHidden: boolean) : void; - setAccessibilityHint (accessibilityHint: string) : void; - setAccessibilityLabel (accessibilityLabel: string) : void; - setAccessibilityValue (accessibilityValue: string) : void; - setAnchorPoint (anchorPoint: Point) : void; - setBackgroundColor (backgroundColor: string) : void; - setBackgroundDisabledColor (backgroundDisabledColor: string) : void; - setBackgroundDisabledImage (backgroundDisabledImage: string) : void; - setBackgroundFocusedColor (backgroundFocusedColor: string) : void; - setBackgroundFocusedImage (backgroundFocusedImage: string) : void; - setBackgroundGradient (backgroundGradient: Gradient) : void; - setBackgroundImage (backgroundImage: string) : void; - setBackgroundLeftCap (backgroundLeftCap: number) : void; - setBackgroundRepeat (backgroundRepeat: boolean) : void; - setBackgroundSelectedColor (backgroundSelectedColor: string) : void; - setBackgroundSelectedImage (backgroundSelectedImage: string) : void; - setBackgroundTopCap (backgroundTopCap: number) : void; - setBorderColor (borderColor: string) : void; - setBorderRadius (borderRadius: number) : void; - setBorderWidth (borderWidth: number) : void; - setBottom (bottom: number) : void; - setBottom (bottom: string) : void; - setCenter (center: Point) : void; - setClipMode (clipMode: number) : void; - setEnabled (enabled: boolean) : void; - setFocusable (focusable: boolean) : void; - setHeight (height: number) : void; - setHeight (height: string) : void; - setHorizontalWrap (horizontalWrap: boolean) : void; - setKeepScreenOn (keepScreenOn: boolean) : void; - setLayout (layout: string) : void; - setLeft (left: number) : void; - setLeft (left: string) : void; - setOpacity (opacity: number) : void; - setPullBackgroundColor (pullBackgroundColor: string) : void; - setRight (right: number) : void; - setRight (right: string) : void; - setSoftKeyboardOnFocus (softKeyboardOnFocus: number) : void; - setTintColor (tintColor: string) : void; - setTop (top: number) : void; - setTop (top: string) : void; - setTouchEnabled (touchEnabled: boolean) : void; - setTransform (transform: Ti.UI._2DMatrix) : void; - setTransform (transform: Ti.UI._3DMatrix) : void; - setViewShadowColor (viewShadowColor: string) : void; - setViewShadowOffset (viewShadowOffset: Point) : void; - setViewShadowRadius (viewShadowRadius: number) : void; - setVisible (visible: boolean) : void; - setWidth (width: number) : void; - setWidth (width: string) : void; - setZIndex (zIndex: number) : void; - show () : void; - startLayout () : void; - toImage (callback?: (...args : any[]) => any, honorScaleFactor?: boolean) : Ti.Blob; - updateLayout (params: Dictionary) : void; - } - export enum ActivityIndicatorStyle { - BIG, - BIG_DARK, - DARK, - PLAIN - } - export interface Switch extends Ti.UI.View { - color : string; - font : Font; - onTintColor : string; - style : number; - textAlign : any; - thumbTintColor : string; - tintColor : string; - title : string; - titleOff : string; - titleOn : string; - value : boolean; - verticalAlign : any; - getColor () : string; - getFont () : Font; - getOnTintColor () : string; - getStyle () : number; - getTextAlign () : any; - getThumbTintColor () : string; - getTitle () : string; - getTitleOff () : string; - getTitleOn () : string; - getValue () : boolean; - getVerticalAlign () : any; - setColor (color: string) : void; - setFont (font: Font) : void; - setOnTintColor (onTintColor: string) : void; - setStyle (style: number) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setThumbTintColor (thumbTintColor: string) : void; - setTitle (title: string) : void; - setTitleOff (titleOff: string) : void; - setTitleOn (titleOn: string) : void; - setValue (value: boolean) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - } - export interface DashboardItem extends Ti.Proxy { - badge : number; - canDelete : boolean; - image : any; - selectedImage : any; - getBadge () : number; - getCanDelete () : boolean; - getImage () : any; - getSelectedImage () : any; - setBadge (badge: number) : void; - setCanDelete (canDelete: boolean) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setSelectedImage (selectedImage: string) : void; - setSelectedImage (selectedImage: Ti.Blob) : void; - } - export interface Tab extends Ti.UI.View { - active : boolean; - activeIcon : string; - activeIconIsMask : any; - badge : string; - icon : string; - iconIsmask : any; - title : string; - titleid : string; - window : Ti.UI.Window; - close (window: Ti.UI.Window, options?: any) : void; - getActive () : boolean; - getActiveIcon () : string; - getActiveIconIsMask () : boolean; - getBadge () : string; - getIcon () : string; - getIconIsmask () : boolean; - getTitle () : string; - getTitleid () : string; - getWindow () : Ti.UI.Window; - open (window: Ti.UI.Window, options: any) : void; - setActive (active: boolean) : void; - setActiveIcon (activeIcon: string) : void; - setActiveIconIsMask (activeIconIsMask: boolean) : void; - setBadge (badge: string) : void; - setIcon (icon: string) : void; - setIconIsmask (iconIsmask: boolean) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - setWindow (window: Ti.UI.Window) : void; - } - export interface TableViewRow extends Ti.UI.View { - className : string; - color : string; - editable : boolean; - font : Font; - hasCheck : boolean; - hasChild : boolean; - hasDetail : boolean; - indentionLevel : number; - leftImage : string; - moveable : boolean; - rightImage : string; - selectedBackgroundColor : string; - selectedBackgroundImage : string; - selectedColor : string; - selectionStyle : number; - title : string; - getClassName () : string; - getColor () : string; - getEditable () : boolean; - getFont () : Font; - getHasCheck () : boolean; - getHasChild () : boolean; - getHasDetail () : boolean; - getIndentionLevel () : number; - getLeftImage () : string; - getMoveable () : boolean; - getRightImage () : string; - getSelectedBackgroundColor () : string; - getSelectedBackgroundImage () : string; - getSelectedColor () : string; - getSelectionStyle () : number; - getTitle () : string; - setClassName (className: string) : void; - setColor (color: string) : void; - setEditable (editable: boolean) : void; - setFont (font: Font) : void; - setHasCheck (hasCheck: boolean) : void; - setHasChild (hasChild: boolean) : void; - setHasDetail (hasDetail: boolean) : void; - setIndentionLevel (indentionLevel: number) : void; - setLeftImage (leftImage: string) : void; - setMoveable (moveable: boolean) : void; - setRightImage (rightImage: string) : void; - setSelectedBackgroundColor (selectedBackgroundColor: string) : void; - setSelectedBackgroundImage (selectedBackgroundImage: string) : void; - setSelectedColor (selectedColor: string) : void; - setSelectionStyle (selectionStyle: number) : void; - setTitle (title: string) : void; - } - export interface PickerRow extends Ti.UI.View { - color : string; - font : Font; - fontSize : number; - title : string; - getColor () : string; - getFont () : Font; - getFontSize () : number; - getTitle () : string; - setColor (color: string) : void; - setFont (font: Font) : void; - setFontSize (fontSize: number) : void; - setTitle (title: string) : void; - } - export interface ButtonBar extends Ti.UI.View { - index : number; - labels : any; - style : number; - getIndex () : number; - getLabels () : any; - getStyle () : number; - setIndex (index: number) : void; - setLabels (labels: Array) : void; - setLabels (labels: Array) : void; - setStyle (style: number) : void; - } - export interface Slider extends Ti.UI.View { - disabledLeftTrackImage : string; - disabledRightTrackImage : string; - disabledThumbImage : string; - highlightedLeftTrackImage : string; - highlightedRightTrackImage : string; - highlightedThumbImage : string; - leftTrackImage : string; - leftTrackLeftCap : number; - leftTrackTopCap : number; - max : number; - maxRange : number; - min : number; - minRange : number; - rightTrackImage : string; - rightTrackLeftCap : number; - rightTrackTopCap : number; - selectedLeftTrackImage : string; - selectedRightTrackImage : string; - selectedThumbImage : string; - thumbImage : any; - value : string; - getDisabledLeftTrackImage () : string; - getDisabledRightTrackImage () : string; - getDisabledThumbImage () : string; - getHighlightedLeftTrackImage () : string; - getHighlightedRightTrackImage () : string; - getHighlightedThumbImage () : string; - getLeftTrackImage () : string; - getLeftTrackLeftCap () : number; - getLeftTrackTopCap () : number; - getMax () : number; - getMaxRange () : number; - getMin () : number; - getMinRange () : number; - getRightTrackImage () : string; - getRightTrackLeftCap () : number; - getRightTrackTopCap () : number; - getSelectedLeftTrackImage () : string; - getSelectedRightTrackImage () : string; - getSelectedThumbImage () : string; - getThumbImage () : any; - getValue () : string; - setDisabledLeftTrackImage (disabledLeftTrackImage: string) : void; - setDisabledRightTrackImage (disabledRightTrackImage: string) : void; - setDisabledThumbImage (disabledThumbImage: string) : void; - setHighlightedLeftTrackImage (highlightedLeftTrackImage: string) : void; - setHighlightedRightTrackImage (highlightedRightTrackImage: string) : void; - setHighlightedThumbImage (highlightedThumbImage: string) : void; - setLeftTrackImage (leftTrackImage: string) : void; - setLeftTrackLeftCap (leftTrackLeftCap: number) : void; - setLeftTrackTopCap (leftTrackTopCap: number) : void; - setMax (max: number) : void; - setMaxRange (maxRange: number) : void; - setMin (min: number) : void; - setMinRange (minRange: number) : void; - setRightTrackImage (rightTrackImage: string) : void; - setRightTrackLeftCap (rightTrackLeftCap: number) : void; - setRightTrackTopCap (rightTrackTopCap: number) : void; - setSelectedLeftTrackImage (selectedLeftTrackImage: string) : void; - setSelectedRightTrackImage (selectedRightTrackImage: string) : void; - setSelectedThumbImage (selectedThumbImage: string) : void; - setThumbImage (thumbImage: string) : void; - setThumbImage (thumbImage: Ti.Blob) : void; - setValue (value: number, options?: Dictionary) : void; - } - export module Android { - export var LINKIFY_ALL : number; - export var LINKIFY_EMAIL_ADDRESSES : number; - export var LINKIFY_MAP_ADDRESSES : number; - export var LINKIFY_PHONE_NUMBERS : number; - export var LINKIFY_WEB_URLS : number; - export var OVER_SCROLL_ALWAYS : number; - export var OVER_SCROLL_IF_CONTENT_SCROLLS : number; - export var OVER_SCROLL_NEVER : number; - export var PIXEL_FORMAT_A_8 : number; - export var PIXEL_FORMAT_LA_88 : number; - export var PIXEL_FORMAT_L_8 : number; - export var PIXEL_FORMAT_OPAQUE : number; - export var PIXEL_FORMAT_RGBA_4444 : number; - export var PIXEL_FORMAT_RGBA_5551 : number; - export var PIXEL_FORMAT_RGBA_8888 : number; - export var PIXEL_FORMAT_RGBX_8888 : number; - export var PIXEL_FORMAT_RGB_332 : number; - export var PIXEL_FORMAT_RGB_565 : number; - export var PIXEL_FORMAT_RGB_888 : number; - export var PIXEL_FORMAT_TRANSLUCENT : number; - export var PIXEL_FORMAT_TRANSPARENT : number; - export var PIXEL_FORMAT_UNKNOWN : number; - export var PROGRESS_INDICATOR_DETERMINANT : number; - export var PROGRESS_INDICATOR_DIALOG : number; - export var PROGRESS_INDICATOR_INDETERMINANT : number; - export var PROGRESS_INDICATOR_STATUS_BAR : number; - export var SOFT_INPUT_ADJUST_PAN : number; - export var SOFT_INPUT_ADJUST_RESIZE : number; - export var SOFT_INPUT_ADJUST_UNSPECIFIED : number; - export var SOFT_INPUT_STATE_ALWAYS_HIDDEN : number; - export var SOFT_INPUT_STATE_ALWAYS_VISIBLE : number; - export var SOFT_INPUT_STATE_HIDDEN : number; - export var SOFT_INPUT_STATE_UNSPECIFIED : number; - export var SOFT_INPUT_STATE_VISIBLE : number; - export var SOFT_KEYBOARD_DEFAULT_ON_FOCUS : number; - export var SOFT_KEYBOARD_HIDE_ON_FOCUS : number; - export var SOFT_KEYBOARD_SHOW_ON_FOCUS : number; - export var SWITCH_STYLE_CHECKBOX : number; - export var SWITCH_STYLE_TOGGLEBUTTON : number; - export var WEBVIEW_LOAD_CACHE_ELSE_NETWORK : number; - export var WEBVIEW_LOAD_CACHE_ONLY : number; - export var WEBVIEW_LOAD_DEFAULT : number; - export var WEBVIEW_LOAD_NO_CACHE : number; - export var WEBVIEW_PLUGINS_OFF : number; - export var WEBVIEW_PLUGINS_ON : number; - export var WEBVIEW_PLUGINS_ON_DEMAND : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createProgressIndicator (parameters?: Dictionary) : Ti.UI.Android.ProgressIndicator; - export function createSearchView (parameters?: Dictionary) : Ti.UI.Android.SearchView; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function hideSoftKeyboard () : void; - export function openPreferences () : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface SearchView extends Ti.UI.View { - hintText : string; - iconified : boolean; - iconifiedByDefault : boolean; - submitEnabled : boolean; - value : string; - blur () : void; - focus () : void; - getHintText () : string; - getIconified () : boolean; - getIconifiedByDefault () : boolean; - getSubmitEnabled () : boolean; - getValue () : string; - setHintText (hintText: string) : void; - setIconified (iconified: boolean) : void; - setIconifiedByDefault (iconifiedByDefault: boolean) : void; - setSubmitEnabled (submitEnabled: boolean) : void; - setValue (value: string) : void; - } - export interface ProgressIndicator extends Ti.Proxy { - cancelable : boolean; - location : number; - max : number; - message : string; - messageid : string; - min : number; - type : number; - getCancelable () : boolean; - getLocation () : number; - getMax () : number; - getMessage () : string; - getMessageid () : string; - getMin () : number; - getType () : number; - hide () : void; - setCancelable (cancelable: boolean) : void; - setLocation (location: number) : void; - setMax (max: number) : void; - setMessage (message: string) : void; - setMessageid (messageid: string) : void; - setMin (min: number) : void; - setType (type: number) : void; - show () : void; - } - } - export interface DashboardView extends Ti.UI.View { - columnCount : number; - data : Array; - editable : boolean; - rowCount : number; - wobble : boolean; - getColumnCount () : number; - getData () : Array; - getEditable () : boolean; - getRowCount () : number; - getWobble () : boolean; - setData (data: Array) : void; - setEditable (editable: boolean) : void; - setWobble (wobble: boolean) : void; - startEditing () : void; - stopEditing () : void; - } - export interface ListItem extends Ti.Proxy { - accessoryType : number; - backgroundColor : string; - backgroundGradient : Gradient; - backgroundImage : string; - canEdit : boolean; - canMove : boolean; - color : string; - font : Font; - height : any; - image : string; - itemId : string; - searchableText : string; - selectedBackgroundColor : string; - selectedBackgroundGradient : Gradient; - selectedBackgroundImage : string; - selectionStyle : number; - subtitle : string; - title : string; - } - export interface AlertDialog extends Ti.Proxy { - androidView : Ti.UI.View; - buttonNames : Array; - cancel : number; - message : string; - messageid : string; - ok : string; - okid : string; - persistent : boolean; - style : number; - title : string; - titleid : string; - getAndroidView () : Ti.UI.View; - getButtonNames () : Array; - getCancel () : number; - getMessage () : string; - getOk () : string; - getPersistent () : boolean; - getStyle () : number; - getTitle () : string; - hide () : void; - setAndroidView (androidView: Ti.UI.View) : void; - setCancel (cancel: number) : void; - setMessage (message: string) : void; - setOk (ok: string) : void; - setPersistent (persistent: boolean) : void; - setStyle (style: number) : void; - setTitle (title: string) : void; - show () : void; - } - export interface _2DMatrix extends Ti.Proxy { - a : number; - b : number; - c : number; - d : number; - tx : number; - ty : number; - getA () : number; - getB () : number; - getC () : number; - getD () : number; - getTx () : number; - getTy () : number; - invert () : Ti.UI._2DMatrix; - multiply (t2: Ti.UI._2DMatrix) : Ti.UI._2DMatrix; - rotate (angle: number, toAngle?: number) : Ti.UI._2DMatrix; - scale (sx: number, sy: number, toSx?: number, toSy?: number) : Ti.UI._2DMatrix; - setA (a: number) : void; - setB (b: number) : void; - setC (c: number) : void; - setD (d: number) : void; - setTx (tx: number) : void; - setTy (ty: number) : void; - translate (tx: number, ty: number) : Ti.UI._2DMatrix; - } - export interface TabbedBar extends Ti.UI.View { - index : number; - labels : any; - style : number; - getIndex () : number; - getLabels () : any; - getStyle () : number; - setIndex (index: number) : void; - setLabels (labels: Array) : void; - setLabels (labels: Array) : void; - setStyle (style: number) : void; - } - export interface Window extends Ti.UI.View { - activity : Ti.Android.Activity; - autoAdjustScrollViewInsets : boolean; - backButtonTitle : string; - backButtonTitleImage : any; - barColor : string; - barImage : string; - exitOnClose : boolean; - extendEdges : Array; - flagSecure : boolean; - fullscreen : boolean; - hideShadow : boolean; - includeOpaqueBars : boolean; - leftNavButton : Ti.UI.View; - leftNavButtons : Array; - modal : boolean; - navBarHidden : boolean; - navTintColor : any; - orientation : number; - orientationModes : Array; - rightNavButton : Ti.UI.View; - rightNavButtons : Array; - shadowImage : string; - statusBarStyle : any; - tabBarHidden : boolean; - theme : string; - title : string; - titleAttributes : titleAttributesParams; - titleControl : Ti.UI.View; - titleImage : string; - titlePrompt : string; - titleid : string; - titlepromptid : string; - toolbar : Array; - transitionAnimation : Ti.Proxy; - translucent : boolean; - url : string; - windowFlags : number; - windowPixelFormat : number; - windowSoftInputMode : number; - close (params?: Dictionary) : void; - close (params?: closeWindowParams) : void; - getActivity () : Ti.Android.Activity; - getAutoAdjustScrollViewInsets () : boolean; - getBackButtonTitle () : string; - getBackButtonTitleImage () : any; - getBarColor () : string; - getBarImage () : string; - getExitOnClose () : boolean; - getExtendEdges () : Array; - getFlagSecure () : boolean; - getFullscreen () : boolean; - getHideShadow () : boolean; - getIncludeOpaqueBars () : boolean; - getLeftNavButton () : Ti.UI.View; - getLeftNavButtons () : Array; - getModal () : boolean; - getNavBarHidden () : boolean; - getNavTintColor () : string; - getOrientation () : number; - getOrientationModes () : Array; - getRightNavButton () : Ti.UI.View; - getRightNavButtons () : Array; - getShadowImage () : string; - getStatusBarStyle () : number; - getTabBarHidden () : boolean; - getTheme () : string; - getTitle () : string; - getTitleAttributes () : titleAttributesParams; - getTitleControl () : Ti.UI.View; - getTitleImage () : string; - getTitlePrompt () : string; - getTitleid () : string; - getTitlepromptid () : string; - getToolbar () : Array; - getTransitionAnimation () : Ti.Proxy; - getTranslucent () : boolean; - getUrl () : string; - getWindowFlags () : number; - getWindowPixelFormat () : number; - getWindowSoftInputMode () : number; - hideNavBar (options?: Dictionary) : void; - hideTabBar () : void; - open (params?: openWindowParams) : void; - setAutoAdjustScrollViewInsets (autoAdjustScrollViewInsets: boolean) : void; - setBackButtonTitle (backButtonTitle: string) : void; - setBackButtonTitleImage (backButtonTitleImage: string) : void; - setBackButtonTitleImage (backButtonTitleImage: Ti.Blob) : void; - setBarColor (barColor: string) : void; - setBarImage (barImage: string) : void; - setExitOnClose (exitOnClose: boolean) : void; - setExtendEdges (extendEdges: Array) : void; - setFullscreen (fullscreen: boolean) : void; - setHideShadow (hideShadow: boolean) : void; - setIncludeOpaqueBars (includeOpaqueBars: boolean) : void; - setLeftNavButton (leftNavButton: Ti.UI.View) : void; - setLeftNavButtons (leftNavButtons: Array) : void; - setModal (modal: boolean) : void; - setNavBarHidden (navBarHidden: boolean) : void; - setNavTintColor (navTintColor: string) : void; - setOrientationModes (orientationModes: Array) : void; - setRightNavButton (rightNavButton: Ti.UI.View) : void; - setRightNavButtons (rightNavButtons: Array) : void; - setShadowImage (shadowImage: string) : void; - setStatusBarStyle (statusBarStyle: number) : void; - setTabBarHidden (tabBarHidden: boolean) : void; - setTitle (title: string) : void; - setTitleAttributes (titleAttributes: titleAttributesParams) : void; - setTitleControl (titleControl: Ti.UI.View) : void; - setTitleImage (titleImage: string) : void; - setTitlePrompt (titlePrompt: string) : void; - setTitleid (titleid: string) : void; - setTitlepromptid (titlepromptid: string) : void; - setToolbar (items: Array, params?: windowToolbarParam) : void; - setTransitionAnimation (transitionAnimation: Ti.Proxy) : void; - setTranslucent (translucent: boolean) : void; - setWindowPixelFormat (windowPixelFormat: number) : void; - showNavBar (options?: Dictionary) : void; - } - export interface TextField extends Ti.UI.View { - appearance : number; - attributedHintText : Ti.UI.iOS.AttributedString; - attributedString : Ti.UI.iOS.AttributedString; - autoLink : number; - autocapitalization : number; - autocorrect : boolean; - borderStyle : number; - clearButtonMode : number; - clearOnEdit : boolean; - color : string; - editable : boolean; - ellipsize : boolean; - enableReturnKey : boolean; - font : Font; - hintText : string; - keyboardToolbar : any; - keyboardToolbarColor : string; - keyboardToolbarHeight : number; - keyboardType : number; - leftButton : any; - leftButtonMode : number; - leftButtonPadding : number; - maxLength : number; - minimumFontSize : number; - paddingLeft : number; - paddingRight : number; - passwordMask : boolean; - returnKeyType : number; - rightButton : any; - rightButtonMode : number; - rightButtonPadding : number; - selection : textFieldSelectedParams; - suppressReturn : boolean; - textAlign : any; - value : string; - verticalAlign : any; - blur () : void; - focus () : void; - getAppearance () : number; - getAttributedHintText () : Ti.UI.iOS.AttributedString; - getAttributedString () : Ti.UI.iOS.AttributedString; - getAutoLink () : number; - getAutocapitalization () : number; - getAutocorrect () : boolean; - getBorderStyle () : number; - getClearButtonMode () : number; - getClearOnEdit () : boolean; - getColor () : string; - getEditable () : boolean; - getEllipsize () : boolean; - getEnableReturnKey () : boolean; - getFont () : Font; - getHintText () : string; - getKeyboardToolbar () : any; - getKeyboardToolbarColor () : string; - getKeyboardToolbarHeight () : number; - getKeyboardType () : number; - getLeftButton () : any; - getLeftButtonMode () : number; - getLeftButtonPadding () : number; - getMaxLength () : number; - getMinimumFontSize () : number; - getPaddingLeft () : number; - getPaddingRight () : number; - getPasswordMask () : boolean; - getReturnKeyType () : number; - getRightButton () : any; - getRightButtonMode () : number; - getRightButtonPadding () : number; - getSelection () : textFieldSelectedParams; - getSuppressReturn () : boolean; - getTextAlign () : any; - getValue () : string; - getVerticalAlign () : any; - hasText () : boolean; - setAppearance (appearance: number) : void; - setAttributedHintText (attributedHintText: Ti.UI.iOS.AttributedString) : void; - setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; - setAutoLink (autoLink: number) : void; - setAutocapitalization (autocapitalization: number) : void; - setAutocorrect (autocorrect: boolean) : void; - setBorderStyle (borderStyle: number) : void; - setClearButtonMode (clearButtonMode: number) : void; - setClearOnEdit (clearOnEdit: boolean) : void; - setColor (color: string) : void; - setEditable (editable: boolean) : void; - setEllipsize (ellipsize: boolean) : void; - setEnableReturnKey (enableReturnKey: boolean) : void; - setFont (font: Font) : void; - setHintText (hintText: string) : void; - setKeyboardToolbar (keyboardToolbar: Array) : void; - setKeyboardToolbar (keyboardToolbar: Ti.UI.iOS.Toolbar) : void; - setKeyboardToolbarColor (keyboardToolbarColor: string) : void; - setKeyboardToolbarHeight (keyboardToolbarHeight: number) : void; - setKeyboardType (keyboardType: number) : void; - setLeftButton (leftButton: any) : void; - setLeftButtonMode (leftButtonMode: number) : void; - setLeftButtonPadding (leftButtonPadding: number) : void; - setMaxLength (maxLength: number) : void; - setMinimumFontSize (minimumFontSize: number) : void; - setPaddingLeft (paddingLeft: number) : void; - setPaddingRight (paddingRight: number) : void; - setPasswordMask (passwordMask: boolean) : void; - setReturnKeyType (returnKeyType: number) : void; - setRightButton (rightButton: any) : void; - setRightButtonMode (rightButtonMode: number) : void; - setRightButtonPadding (rightButtonPadding: number) : void; - setSelection (start: number, end: number) : void; - setSuppressReturn (suppressReturn: boolean) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setValue (value: string) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - } - export interface _3DMatrix extends Ti.Proxy { - m11 : number; - m12 : number; - m13 : number; - m14 : number; - m21 : number; - m22 : number; - m23 : number; - m24 : number; - m31 : number; - m32 : number; - m33 : number; - m34 : number; - m41 : number; - m42 : number; - m43 : number; - m44 : number; - getM11 () : number; - getM12 () : number; - getM13 () : number; - getM14 () : number; - getM21 () : number; - getM22 () : number; - getM23 () : number; - getM24 () : number; - getM31 () : number; - getM32 () : number; - getM33 () : number; - getM34 () : number; - getM41 () : number; - getM42 () : number; - getM43 () : number; - getM44 () : number; - invert () : Ti.UI._3DMatrix; - multiply (t2: Ti.UI._3DMatrix) : Ti.UI._3DMatrix; - rotate (angle: number, x: number, y: number, z: number) : Ti.UI._3DMatrix; - scale (sx: number, sy: number, sz: number) : Ti.UI._3DMatrix; - setM11 (m11: number) : void; - setM12 (m12: number) : void; - setM13 (m13: number) : void; - setM14 (m14: number) : void; - setM21 (m21: number) : void; - setM22 (m22: number) : void; - setM23 (m23: number) : void; - setM24 (m24: number) : void; - setM31 (m31: number) : void; - setM32 (m32: number) : void; - setM33 (m33: number) : void; - setM34 (m34: number) : void; - setM41 (m41: number) : void; - setM42 (m42: number) : void; - setM43 (m43: number) : void; - setM44 (m44: number) : void; - translate (tx: number, ty: number, tz: number) : Ti.UI._3DMatrix; - } - export interface WebView extends Ti.UI.View { - cacheMode : number; - data : any; - disableBounce : boolean; - enableZoomControls : boolean; - handlePlatformUrl : boolean; - hideLoadIndicator : boolean; - html : string; - ignoreSslError : boolean; - lightTouchEnabled : boolean; - loading : boolean; - onCreateWindow : (...args : any[]) => any; - overScrollMode : number; - pluginState : number; - scalesPageToFit : boolean; - scrollsToTop : boolean; - showScrollbars : boolean; - url : string; - userAgent : string; - willHandleTouches : boolean; - canGoBack () : boolean; - canGoForward () : boolean; - evalJS (code: string) : string; - getCacheMode () : number; - getData () : any; - getDisableBounce () : boolean; - getEnableZoomControls () : boolean; - getHandlePlatformUrl () : boolean; - getHideLoadIndicator () : boolean; - getHtml () : string; - getIgnoreSslError () : boolean; - getLightTouchEnabled () : boolean; - getLoading () : boolean; - getOnCreateWindow () : (...args : any[]) => any; - getOverScrollMode () : number; - getPluginState () : number; - getScalesPageToFit () : boolean; - getScrollsToTop () : boolean; - getShowScrollbars () : boolean; - getUrl () : string; - getUserAgent () : string; - getWillHandleTouches () : boolean; - goBack () : void; - goForward () : void; - pause () : void; - release () : void; - reload () : void; - repaint () : void; - resume () : void; - setBasicAuthentication (username: string, password: string) : void; - setCacheMode (cacheMode: number) : void; - setData (data: Ti.Blob) : void; - setData (data: Ti.Filesystem.File) : void; - setDisableBounce (disableBounce: boolean) : void; - setEnableZoomControls (enableZoomControls: boolean) : void; - setHandlePlatformUrl (handlePlatformUrl: boolean) : void; - setHideLoadIndicator (hideLoadIndicator: boolean) : void; - setHtml (html: any, options?: Dictionary) : void; - setIgnoreSslError (ignoreSslError: boolean) : void; - setLightTouchEnabled (lightTouchEnabled: boolean) : void; - setLoading (loading: boolean) : void; - setOnCreateWindow (onCreateWindow: (...args : any[]) => any) : void; - setOverScrollMode (overScrollMode: number) : void; - setPluginState (pluginState: number) : void; - setScalesPageToFit (scalesPageToFit: boolean) : void; - setScrollsToTop (scrollsToTop: boolean) : void; - setShowScrollbars (showScrollbars: boolean) : void; - setUrl (url: string) : void; - setUserAgent (userAgent: string) : void; - setWillHandleTouches (willHandleTouches: boolean) : void; - stopLoading (hardStop: boolean) : void; - } - export interface Clipboard { - clearData (type?: string) : void; - clearText () : void; - getData (type: string) : any; - getText () : string; - hasData (type: string) : boolean; - hasText () : any; - setData (type: string, data: any) : void; - setText (text: string) : void; - } - export interface ScrollableView extends Ti.UI.View { - cacheSize : number; - clipViews : boolean; - currentPage : number; - disableBounce : boolean; - hitRect : Dimension; - overScrollMode : number; - overlayEnabled : boolean; - pagingControlAlpha : number; - pagingControlColor : string; - pagingControlHeight : number; - pagingControlOnTop : boolean; - pagingControlTimeout : number; - scrollingEnabled : boolean; - showPagingControl : boolean; - views : Array; - addView (view: Ti.UI.View) : void; - getCacheSize () : number; - getClipViews () : boolean; - getCurrentPage () : number; - getDisableBounce () : boolean; - getHitRect () : Dimension; - getOverScrollMode () : number; - getOverlayEnabled () : boolean; - getPagingControlAlpha () : number; - getPagingControlColor () : string; - getPagingControlHeight () : number; - getPagingControlOnTop () : boolean; - getPagingControlTimeout () : number; - getScrollingEnabled () : boolean; - getShowPagingControl () : boolean; - getViews () : Array; - moveNext () : void; - movePrevious () : void; - removeView (view: number) : void; - removeView (view: Ti.UI.View) : void; - scrollToView (view: number) : void; - scrollToView (view: Ti.UI.View) : void; - setCacheSize (cacheSize: number) : void; - setCurrentPage (currentPage: number) : void; - setDisableBounce (disableBounce: boolean) : void; - setHitRect (hitRect: Dimension) : void; - setOverScrollMode (overScrollMode: number) : void; - setOverlayEnabled (overlayEnabled: boolean) : void; - setPagingControlAlpha (pagingControlAlpha: number) : void; - setPagingControlColor (pagingControlColor: string) : void; - setPagingControlHeight (pagingControlHeight: number) : void; - setPagingControlOnTop (pagingControlOnTop: boolean) : void; - setScrollingEnabled (scrollingEnabled: boolean) : void; - setShowPagingControl (showPagingControl: boolean) : void; - setViews (views: Array) : void; - } - export interface ListSection extends Ti.Proxy { - footerTitle : string; - footerView : Ti.UI.View; - headerTitle : string; - headerView : Ti.UI.View; - items : Array; - appendItems (dataItems: Array, animation?: ListViewAnimationProperties) : void; - deleteItemsAt (itemIndex: number, count: number, animation?: ListViewAnimationProperties) : void; - getFooterTitle () : string; - getFooterView () : Ti.UI.View; - getHeaderTitle () : string; - getHeaderView () : Ti.UI.View; - getItemAt (itemIndex: number) : ListDataItem; - getItems () : Array; - insertItemsAt (itemIndex: number, dataItems: Array, animation?: ListViewAnimationProperties) : void; - replaceItemsAt (index: number, count: number, dataItems: Array, animation?: ListViewAnimationProperties) : void; - setFooterTitle (footerTitle: string) : void; - setFooterView (footerView: Ti.UI.View) : void; - setHeaderTitle (headerTitle: string) : void; - setHeaderView (headerView: Ti.UI.View) : void; - setItems (dataItems: Array, animation?: ListViewAnimationProperties) : void; - updateItemAt (index: number, dataItem: ListDataItem, animation?: ListViewAnimationProperties) : void; - } - export interface ScrollView extends Ti.UI.View { - canCancelEvents : boolean; - contentHeight : any; - contentOffset : Dictionary; - contentWidth : any; - decelerationRate : number; - disableBounce : boolean; - horizontalBounce : boolean; - maxZoomScale : number; - minZoomScale : number; - overScrollMode : number; - scrollIndicatorStyle : number; - scrollType : string; - scrollingEnabled : boolean; - scrollsToTop : boolean; - showHorizontalScrollIndicator : boolean; - showVerticalScrollIndicator : boolean; - verticalBounce : boolean; - zoomScale : number; - getCanCancelEvents () : boolean; - getContentHeight () : any; - getContentOffset () : Dictionary; - getContentWidth () : any; - getDecelerationRate () : number; - getDisableBounce () : boolean; - getHorizontalBounce () : boolean; - getMaxZoomScale () : number; - getMinZoomScale () : number; - getOverScrollMode () : number; - getScrollIndicatorStyle () : number; - getScrollType () : string; - getScrollingEnabled () : boolean; - getScrollsToTop () : boolean; - getShowHorizontalScrollIndicator () : boolean; - getShowVerticalScrollIndicator () : boolean; - getVerticalBounce () : boolean; - getZoomScale () : number; - scrollTo (x: number, y: number) : void; - scrollToBottom () : void; - setCanCancelEvents (canCancelEvents: boolean) : void; - setContentHeight (contentHeight: number) : void; - setContentHeight (contentHeight: string) : void; - setContentOffset (contentOffset: Dictionary, animated?: contentOffsetOption) : void; - setContentWidth (contentWidth: number) : void; - setContentWidth (contentWidth: string) : void; - setDecelerationRate (decelerationRate: number) : void; - setDisableBounce (disableBounce: boolean) : void; - setHorizontalBounce (horizontalBounce: boolean) : void; - setMaxZoomScale (maxZoomScale: number) : void; - setMinZoomScale (minZoomScale: number) : void; - setOverScrollMode (overScrollMode: number) : void; - setScrollIndicatorStyle (scrollIndicatorStyle: number) : void; - setScrollingEnabled (scrollingEnabled: boolean) : void; - setScrollsToTop (scrollsToTop: boolean) : void; - setShowHorizontalScrollIndicator (showHorizontalScrollIndicator: boolean) : void; - setShowVerticalScrollIndicator (showVerticalScrollIndicator: boolean) : void; - setVerticalBounce (verticalBounce: boolean) : void; - setZoomScale (zoomScale: number, animated?: zoomScaleOption) : void; - } - export interface ListView extends Ti.UI.View { - allowsSelection : boolean; - canScroll : boolean; - caseInsensitiveSearch : boolean; - defaultItemTemplate : any; - editing : boolean; - footerDividersEnabled : boolean; - footerTitle : string; - footerView : Ti.UI.View; - headerDividersEnabled : boolean; - headerTitle : string; - headerView : Ti.UI.View; - keepSectionsInSearch : boolean; - pruneSectionsOnEdit : boolean; - pullView : Ti.UI.View; - refreshControl : Ti.UI.RefreshControl; - scrollIndicatorStyle : number; - searchText : string; - searchView : any; - sectionCount : number; - sectionIndexTitles : Array; - sections : Array; - separatorColor : string; - separatorInsets : Dictionary; - separatorStyle : number; - showVerticalScrollIndicator : boolean; - style : number; - templates : Dictionary; - willScrollOnStatusTap : boolean; - appendSection (section: Ti.UI.ListSection, animation?: ListViewAnimationProperties) : void; - appendSection (section: Array, animation?: ListViewAnimationProperties) : void; - deleteSectionAt (sectionIndex: number, animation?: ListViewAnimationProperties) : void; - deselectItem (sectionIndex: number, itemIndex: number) : void; - getAllowsSelection () : boolean; - getCanScroll () : boolean; - getCaseInsensitiveSearch () : boolean; - getDefaultItemTemplate () : any; - getEditing () : boolean; - getFooterDividersEnabled () : boolean; - getFooterTitle () : string; - getFooterView () : Ti.UI.View; - getHeaderDividersEnabled () : boolean; - getHeaderTitle () : string; - getHeaderView () : Ti.UI.View; - getKeepSectionsInSearch () : boolean; - getPruneSectionsOnEdit () : boolean; - getPullView () : Ti.UI.View; - getRefreshControl () : Ti.UI.RefreshControl; - getScrollIndicatorStyle () : number; - getSearchText () : string; - getSearchView () : any; - getSectionCount () : number; - getSectionIndexTitles () : Array; - getSections () : Array; - getSeparatorColor () : string; - getSeparatorInsets () : Dictionary; - getSeparatorStyle () : number; - getShowVerticalScrollIndicator () : boolean; - getStyle () : number; - getTemplates () : Dictionary; - getWillScrollOnStatusTap () : boolean; - insertSectionAt (sectionIndex: number, section: Ti.UI.ListSection, animation?: ListViewAnimationProperties) : void; - insertSectionAt (sectionIndex: number, section: Array, animation?: ListViewAnimationProperties) : void; - replaceSectionAt (sectionIndex: number, section: Ti.UI.ListSection, animation: ListViewAnimationProperties) : void; - scrollToItem (sectionIndex: number, itemIndex: number, animation?: ListViewAnimationProperties) : void; - selectItem (sectionIndex: number, itemIndex: number) : void; - setAllowsSelection (allowsSelection: boolean) : void; - setCanScroll (canScroll: boolean) : void; - setCaseInsensitiveSearch (caseInsensitiveSearch: boolean) : void; - setContentInsets (edgeInsets: ListViewEdgeInsets, animated?: ListViewContentInsetOption) : void; - setDefaultItemTemplate (defaultItemTemplate: string) : void; - setDefaultItemTemplate (defaultItemTemplate: number) : void; - setEditing (editing: boolean) : void; - setFooterTitle (footerTitle: string) : void; - setFooterView (footerView: Ti.UI.View) : void; - setHeaderTitle (headerTitle: string) : void; - setHeaderView (headerView: Ti.UI.View) : void; - setKeepSectionsInSearch (keepSectionsInSearch: boolean) : void; - setMarker (markerProps: ListViewMarkerProps) : void; - setPruneSectionsOnEdit (pruneSectionsOnEdit: boolean) : void; - setPullView (pullView: Ti.UI.View) : void; - setRefreshControl (refreshControl: Ti.UI.RefreshControl) : void; - setScrollIndicatorStyle (scrollIndicatorStyle: number) : void; - setSearchText (searchText: string) : void; - setSearchView (searchView: Ti.UI.SearchBar) : void; - setSearchView (searchView: Ti.UI.Android.SearchView) : void; - setSectionIndexTitles (sectionIndexTitles: Array) : void; - setSections (sections: Array) : void; - setSeparatorColor (separatorColor: string) : void; - setSeparatorInsets (separatorInsets: Dictionary) : void; - setSeparatorStyle (separatorStyle: number) : void; - setShowVerticalScrollIndicator (showVerticalScrollIndicator: boolean) : void; - setWillScrollOnStatusTap (willScrollOnStatusTap: boolean) : void; - } - export interface TabGroup extends Ti.UI.View { - activeTab : Ti.UI.Tab; - activeTabBackgroundColor : string; - activeTabBackgroundDisabledColor : string; - activeTabBackgroundDisabledImage : string; - activeTabBackgroundFocusedColor : string; - activeTabBackgroundFocusedImage : string; - activeTabBackgroundImage : string; - activeTabBackgroundSelectedColor : string; - activeTabBackgroundSelectedImage : string; - activeTabIconTint : string; - activity : Ti.Android.Activity; - allowUserCustomization : boolean; - barColor : string; - editButtonTitle : string; - exitOnClose : boolean; - navBarHidden : boolean; - navTintColor : any; - shadowImage : string; - tabDividerColor : string; - tabDividerWidth : any; - tabHeight : any; - tabs : Array; - tabsAtBottom : boolean; - tabsBackgroundColor : string; - tabsBackgroundDisabledColor : string; - tabsBackgroundDisabledImage : string; - tabsBackgroundFocusedColor : string; - tabsBackgroundFocusedImage : string; - tabsBackgroundImage : string; - tabsBackgroundSelectedColor : string; - tabsBackgroundSelectedImage : string; - tabsTintColor : any; - title : string; - titleAttributes : titleAttributesParams; - translucent : boolean; - windowSoftInputMode : number; - addTab (tab: Ti.UI.Tab) : void; - close () : void; - getActiveTab () : Ti.UI.Tab; - getActiveTabBackgroundColor () : string; - getActiveTabBackgroundDisabledColor () : string; - getActiveTabBackgroundDisabledImage () : string; - getActiveTabBackgroundFocusedColor () : string; - getActiveTabBackgroundFocusedImage () : string; - getActiveTabBackgroundImage () : string; - getActiveTabBackgroundSelectedColor () : string; - getActiveTabBackgroundSelectedImage () : string; - getActiveTabIconTint () : string; - getActivity () : Ti.Android.Activity; - getAllowUserCustomization () : boolean; - getBarColor () : string; - getEditButtonTitle () : string; - getExitOnClose () : boolean; - getNavBarHidden () : boolean; - getNavTintColor () : string; - getShadowImage () : string; - getTabDividerColor () : string; - getTabDividerWidth () : any; - getTabHeight () : any; - getTabs () : Array; - getTabsAtBottom () : boolean; - getTabsBackgroundColor () : string; - getTabsBackgroundDisabledColor () : string; - getTabsBackgroundDisabledImage () : string; - getTabsBackgroundFocusedColor () : string; - getTabsBackgroundFocusedImage () : string; - getTabsBackgroundImage () : string; - getTabsBackgroundSelectedColor () : string; - getTabsBackgroundSelectedImage () : string; - getTabsTintColor () : string; - getTitle () : string; - getTitleAttributes () : titleAttributesParams; - getTranslucent () : boolean; - getWindowSoftInputMode () : number; - open () : void; - removeTab (tab: Ti.UI.Tab) : void; - setActiveTab (indexOrObject: number) : void; - setActiveTab (indexOrObject: Ti.UI.Tab) : void; - setActiveTabBackgroundColor (activeTabBackgroundColor: string) : void; - setActiveTabBackgroundDisabledColor (activeTabBackgroundDisabledColor: string) : void; - setActiveTabBackgroundDisabledImage (activeTabBackgroundDisabledImage: string) : void; - setActiveTabBackgroundFocusedColor (activeTabBackgroundFocusedColor: string) : void; - setActiveTabBackgroundFocusedImage (activeTabBackgroundFocusedImage: string) : void; - setActiveTabBackgroundImage (activeTabBackgroundImage: string) : void; - setActiveTabBackgroundSelectedColor (activeTabBackgroundSelectedColor: string) : void; - setActiveTabBackgroundSelectedImage (activeTabBackgroundSelectedImage: string) : void; - setActiveTabIconTint (activeTabIconTint: string) : void; - setAllowUserCustomization (allowUserCustomization: boolean) : void; - setBarColor (barColor: string) : void; - setEditButtonTitle (editButtonTitle: string) : void; - setExitOnClose (exitOnClose: boolean) : void; - setNavBarHidden (navBarHidden: boolean) : void; - setNavTintColor (navTintColor: string) : void; - setShadowImage (shadowImage: string) : void; - setTabDividerColor (tabDividerColor: string) : void; - setTabDividerWidth (tabDividerWidth: number) : void; - setTabDividerWidth (tabDividerWidth: string) : void; - setTabHeight (tabHeight: number) : void; - setTabHeight (tabHeight: string) : void; - setTabs (tabs: Array) : void; - setTabsAtBottom (tabsAtBottom: boolean) : void; - setTabsBackgroundColor (tabsBackgroundColor: string) : void; - setTabsBackgroundDisabledColor (tabsBackgroundDisabledColor: string) : void; - setTabsBackgroundDisabledImage (tabsBackgroundDisabledImage: string) : void; - setTabsBackgroundFocusedColor (tabsBackgroundFocusedColor: string) : void; - setTabsBackgroundFocusedImage (tabsBackgroundFocusedImage: string) : void; - setTabsBackgroundImage (tabsBackgroundImage: string) : void; - setTabsBackgroundSelectedColor (tabsBackgroundSelectedColor: string) : void; - setTabsBackgroundSelectedImage (tabsBackgroundSelectedImage: string) : void; - setTabsTintColor (tabsTintColor: string) : void; - setTitle (title: string) : void; - setTitleAttributes (titleAttributes: titleAttributesParams) : void; - setTranslucent (translucent: boolean) : void; - } - export interface TableView extends Ti.UI.View { - allowsSelection : boolean; - allowsSelectionDuringEditing : boolean; - data : any; - editable : boolean; - editing : boolean; - filterAnchored : boolean; - filterAttribute : string; - filterCaseInsensitive : boolean; - footerDividersEnabled : boolean; - footerTitle : string; - footerView : Ti.UI.View; - headerDividersEnabled : boolean; - headerPullView : Ti.UI.View; - headerTitle : string; - headerView : Ti.UI.View; - hideSearchOnSelection : boolean; - index : Array; - maxRowHeight : number; - minRowHeight : number; - moveable : boolean; - moving : boolean; - overScrollMode : number; - refreshControl : Ti.UI.RefreshControl; - rowHeight : number; - scrollIndicatorStyle : number; - scrollable : boolean; - scrollsToTop : boolean; - search : any; - searchAsChild : boolean; - searchHidden : boolean; - sectionCount : number; - sections : Array; - separatorColor : string; - separatorInsets : Dictionary; - separatorStyle : number; - showVerticalScrollIndicator : boolean; - style : number; - appendRow (row: Ti.UI.TableViewRow, animation?: TableViewAnimationProperties) : void; - appendRow (row: Dictionary, animation?: TableViewAnimationProperties) : void; - appendRow (row: Array, animation?: TableViewAnimationProperties) : void; - appendRow (row: Array>, animation?: TableViewAnimationProperties) : void; - appendSection (section: Ti.UI.TableViewSection, animation?: TableViewAnimationProperties) : void; - appendSection (section: Dictionary, animation?: TableViewAnimationProperties) : void; - appendSection (section: Array, animation?: TableViewAnimationProperties) : void; - appendSection (section: Array>, animation?: TableViewAnimationProperties) : void; - deleteRow (row: number, animation?: TableViewAnimationProperties) : void; - deleteRow (row: Ti.UI.TableViewRow, animation?: TableViewAnimationProperties) : void; - deleteSection (section: number, animation?: TableViewAnimationProperties) : void; - deselectRow (row: number) : void; - getAllowsSelection () : boolean; - getAllowsSelectionDuringEditing () : boolean; - getData () : any; - getEditable () : boolean; - getEditing () : boolean; - getFilterAnchored () : boolean; - getFilterAttribute () : string; - getFilterCaseInsensitive () : boolean; - getFooterDividersEnabled () : boolean; - getFooterTitle () : string; - getFooterView () : Ti.UI.View; - getHeaderDividersEnabled () : boolean; - getHeaderPullView () : Ti.UI.View; - getHeaderTitle () : string; - getHeaderView () : Ti.UI.View; - getHideSearchOnSelection () : boolean; - getIndex () : Array; - getMaxRowHeight () : number; - getMinRowHeight () : number; - getMoveable () : boolean; - getMoving () : boolean; - getOverScrollMode () : number; - getRefreshControl () : Ti.UI.RefreshControl; - getRowHeight () : number; - getScrollIndicatorStyle () : number; - getScrollable () : boolean; - getScrollsToTop () : boolean; - getSearch () : any; - getSearchAsChild () : boolean; - getSearchHidden () : boolean; - getSectionCount () : number; - getSections () : Array; - getSeparatorColor () : string; - getSeparatorInsets () : Dictionary; - getSeparatorStyle () : number; - getShowVerticalScrollIndicator () : boolean; - getStyle () : number; - insertRowAfter (index: number, row: Ti.UI.TableViewRow, animation?: TableViewAnimationProperties) : void; - insertRowAfter (index: number, row: Dictionary, animation?: TableViewAnimationProperties) : void; - insertRowBefore (index: number, row: Ti.UI.TableViewRow, animation?: TableViewAnimationProperties) : void; - insertRowBefore (index: number, row: Dictionary, animation?: TableViewAnimationProperties) : void; - insertSectionAfter (index: number, section: Ti.UI.TableViewSection, animation?: TableViewAnimationProperties) : void; - insertSectionAfter (index: number, section: Dictionary, animation?: TableViewAnimationProperties) : void; - insertSectionBefore (index: number, section: Ti.UI.TableViewSection, animation?: TableViewAnimationProperties) : void; - insertSectionBefore (index: number, section: Dictionary, animation?: TableViewAnimationProperties) : void; - scrollToIndex (index: number, animation?: TableViewAnimationProperties) : void; - scrollToTop (top: number, animation?: TableViewAnimationProperties) : void; - selectRow (row: number) : void; - setAllowsSelection (allowsSelection: boolean) : void; - setAllowsSelectionDuringEditing (allowsSelectionDuringEditing: boolean) : void; - setContentInsets (edgeInsets: TableViewEdgeInsets, animated?: TableViewContentInsetOption) : void; - setData (data: Array, animation: TableViewAnimationProperties) : void; - setData (data: Array>, animation: TableViewAnimationProperties) : void; - setData (data: Array, animation: TableViewAnimationProperties) : void; - setEditable (editable: boolean) : void; - setEditing (editing: boolean) : void; - setFilterAnchored (filterAnchored: boolean) : void; - setFilterAttribute (filterAttribute: string) : void; - setFilterCaseInsensitive (filterCaseInsensitive: boolean) : void; - setFooterTitle (footerTitle: string) : void; - setFooterView (footerView: Ti.UI.View) : void; - setHeaderPullView (view: Ti.UI.View) : void; - setHeaderTitle (headerTitle: string) : void; - setHeaderView (headerView: Ti.UI.View) : void; - setHideSearchOnSelection (hideSearchOnSelection: boolean) : void; - setIndex (index: Array) : void; - setMaxRowHeight (maxRowHeight: number) : void; - setMinRowHeight (minRowHeight: number) : void; - setMoveable (moveable: boolean) : void; - setMoving (moving: boolean) : void; - setOverScrollMode (overScrollMode: number) : void; - setRefreshControl (refreshControl: Ti.UI.RefreshControl) : void; - setRowHeight (rowHeight: number) : void; - setScrollIndicatorStyle (scrollIndicatorStyle: number) : void; - setScrollable (scrollable: boolean) : void; - setScrollsToTop (scrollsToTop: boolean) : void; - setSearch (search: Ti.UI.SearchBar) : void; - setSearch (search: Ti.UI.Android.SearchView) : void; - setSearchAsChild (searchAsChild: boolean) : void; - setSearchHidden (searchHidden: boolean) : void; - setSections (sections: Array) : void; - setSeparatorColor (separatorColor: string) : void; - setSeparatorInsets (separatorInsets: Dictionary) : void; - setSeparatorStyle (separatorStyle: number) : void; - setShowVerticalScrollIndicator (showVerticalScrollIndicator: boolean) : void; - setStyle (style: number) : void; - updateRow (index: number, row: Ti.UI.TableViewRow, animation: TableViewAnimationProperties) : void; - updateSection (index: number, section: Ti.UI.TableViewSection, animation: TableViewAnimationProperties) : void; - } - export interface Button extends Ti.UI.View { - color : string; - disabledColor : string; - font : Font; - image : any; - selectedColor : string; - shadowColor : string; - shadowOffset : Dictionary; - shadowRadius : number; - style : number; - systemButton : number; - textAlign : any; - title : string; - titleid : string; - verticalAlign : any; - getColor () : string; - getDisabledColor () : string; - getFont () : Font; - getImage () : any; - getSelectedColor () : string; - getShadowColor () : string; - getShadowOffset () : Dictionary; - getShadowRadius () : number; - getStyle () : number; - getSystemButton () : number; - getTextAlign () : any; - getTitle () : string; - getTitleid () : string; - getVerticalAlign () : any; - setColor (color: string) : void; - setDisabledColor (disabledColor: string) : void; - setFont (font: Font) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setSelectedColor (selectedColor: string) : void; - setShadowColor (shadowColor: string) : void; - setShadowOffset (shadowOffset: Dictionary) : void; - setShadowRadius (shadowRadius: number) : void; - setStyle (style: number) : void; - setSystemButton (systemButton: number) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - } - export interface OptionDialog extends Ti.Proxy { - androidView : Ti.UI.View; - buttonNames : Array; - cancel : number; - destructive : number; - opaquebackground : boolean; - options : Array; - persistent : boolean; - selectedIndex : number; - title : string; - titleid : string; - getAndroidView () : Ti.UI.View; - getButtonNames () : Array; - getCancel () : number; - getDestructive () : number; - getOpaquebackground () : boolean; - getOptions () : Array; - getPersistent () : boolean; - getSelectedIndex () : number; - getTitle () : string; - getTitleid () : string; - hide (params?: hideParams) : void; - setAndroidView (androidView: Ti.UI.View) : void; - setCancel (cancel: number) : void; - setOpaquebackground (opaquebackground: boolean) : void; - setPersistent (persistent: boolean) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - show (params?: showParams) : void; - } - export interface RefreshControl extends Ti.Proxy { - tintColor : string; - title : Ti.UI.iOS.AttributedString; - beginRefreshing () : void; - endRefreshing () : void; - getTintColor () : string; - getTitle () : Ti.UI.iOS.AttributedString; - setTintColor (tintColor: string) : void; - setTitle (title: Ti.UI.iOS.AttributedString) : void; - } - export interface EmailDialog extends Ti.Proxy { - CANCELLED : number; - FAILED : number; - SAVED : number; - SENT : number; - barColor : string; - bccRecipients : Array; - ccRecipients : Array; - html : boolean; - messageBody : string; - subject : string; - toRecipients : Array; - addAttachment (attachment: Ti.Blob) : void; - addAttachment (attachment: Ti.Filesystem.File) : void; - getBarColor () : string; - getBccRecipients () : Array; - getCcRecipients () : Array; - getHtml () : boolean; - getMessageBody () : string; - getSubject () : string; - getToRecipients () : Array; - isSupported () : boolean; - open (properties: any) : void; - setBarColor (barColor: string) : void; - setBccRecipients (bccRecipients: Array) : void; - setCcRecipients (ccRecipients: Array) : void; - setHtml (html: boolean) : void; - setMessageBody (messageBody: string) : void; - setSubject (subject: string) : void; - setToRecipients (toRecipients: Array) : void; - } - export interface CoverFlowView extends Ti.UI.View { - images : any; - selected : number; - getImages () : any; - getSelected () : number; - setImage (index: number, image: string) : void; - setImage (image: Ti.Blob) : void; - setImage (image: Ti.Filesystem.File) : void; - setImage (index: number, image: CoverFlowImageType) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setSelected (selected: number) : void; - } - export interface ImageView extends Ti.UI.View { - animating : boolean; - autorotate : boolean; - decodeRetries : number; - defaultImage : string; - duration : number; - enableZoomControls : boolean; - hires : boolean; - image : any; - images : any; - paused : boolean; - preventDefaultImage : boolean; - repeatCount : number; - reverse : boolean; - url : string; - getAnimating () : boolean; - getAutorotate () : boolean; - getDecodeRetries () : number; - getDefaultImage () : string; - getDuration () : number; - getEnableZoomControls () : boolean; - getHires () : boolean; - getImage () : any; - getImages () : any; - getPaused () : boolean; - getPreventDefaultImage () : boolean; - getRepeatCount () : number; - getReverse () : boolean; - getUrl () : string; - pause () : void; - resume () : void; - setDecodeRetries (decodeRetries: number) : void; - setDefaultImage (defaultImage: string) : void; - setDuration (duration: number) : void; - setEnableZoomControls (enableZoomControls: boolean) : void; - setHires (hires: boolean) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setImage (image: Ti.Filesystem.File) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setImages (images: Array) : void; - setPreventDefaultImage (preventDefaultImage: boolean) : void; - setRepeatCount (repeatCount: number) : void; - setReverse (reverse: boolean) : void; - setUrl (url: string) : void; - start () : void; - stop () : void; - toBlob () : void; - } - export interface MaskedImage extends Ti.UI.View { - image : string; - mask : string; - mode : number; - tint : string; - getImage () : string; - getMask () : string; - getMode () : number; - getTint () : string; - setImage (image: string) : void; - setMask (mask: string) : void; - setMode (mode: number) : void; - setTint (tint: string) : void; - } - export interface ProgressBar extends Ti.UI.View { - color : string; - font : Font; - max : number; - message : string; - min : number; - style : number; - value : number; - getColor () : string; - getFont () : Font; - getMax () : number; - getMessage () : string; - getMin () : number; - getStyle () : number; - getValue () : number; - setColor (color: string) : void; - setFont (font: Font) : void; - setMax (max: number) : void; - setMessage (message: string) : void; - setMin (min: number) : void; - setStyle (style: number) : void; - setValue (value: number) : void; - } - export module MobileWeb { - export var apiName : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createNavigationGroup (parameters?: Dictionary) : Ti.UI.MobileWeb.NavigationGroup; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export enum TableViewSeparatorStyle { - NONE, - SINGLE_LINE - } - export interface NavigationGroup extends Ti.UI.View { - navBarAtTop : boolean; - window : Ti.UI.Window; - close (window: Ti.UI.Window, options: Dictionary) : void; - getNavBarAtTop () : boolean; - getWindow () : Ti.UI.Window; - open (window: Ti.UI.Window, options: Dictionary) : void; - setNavBarAtTop (navBarAtTop: boolean) : void; - } - } - export interface Label extends Ti.UI.View { - attributedString : Ti.UI.iOS.AttributedString; - autoLink : number; - backgroundPaddingBottom : number; - backgroundPaddingLeft : number; - backgroundPaddingRight : number; - backgroundPaddingTop : number; - color : string; - ellipsize : boolean; - font : Font; - highlightedColor : string; - html : string; - includeFontPadding : boolean; - minimumFontSize : number; - shadowColor : string; - shadowOffset : Dictionary; - shadowRadius : number; - text : string; - textAlign : any; - textid : string; - verticalAlign : any; - wordWrap : boolean; - getAttributedString () : Ti.UI.iOS.AttributedString; - getAutoLink () : number; - getBackgroundPaddingBottom () : number; - getBackgroundPaddingLeft () : number; - getBackgroundPaddingRight () : number; - getBackgroundPaddingTop () : number; - getColor () : string; - getEllipsize () : boolean; - getFont () : Font; - getHighlightedColor () : string; - getHtml () : string; - getIncludeFontPadding () : boolean; - getMinimumFontSize () : number; - getShadowColor () : string; - getShadowOffset () : Dictionary; - getShadowRadius () : number; - getText () : string; - getTextAlign () : any; - getTextid () : string; - getVerticalAlign () : any; - getWordWrap () : boolean; - setAttributedString (attributedString: Ti.UI.iOS.AttributedString) : void; - setAutoLink (autoLink: number) : void; - setBackgroundPaddingBottom (backgroundPaddingBottom: number) : void; - setBackgroundPaddingLeft (backgroundPaddingLeft: number) : void; - setBackgroundPaddingRight (backgroundPaddingRight: number) : void; - setBackgroundPaddingTop (backgroundPaddingTop: number) : void; - setColor (color: string) : void; - setEllipsize (ellipsize: boolean) : void; - setFont (font: Font) : void; - setHighlightedColor (highlightedColor: string) : void; - setHtml (html: string) : void; - setIncludeFontPadding (includeFontPadding: boolean) : void; - setMinimumFontSize (minimumFontSize: number) : void; - setShadowColor (shadowColor: string) : void; - setShadowOffset (shadowOffset: Dictionary) : void; - setShadowRadius (shadowRadius: number) : void; - setText (text: string) : void; - setTextAlign (textAlign: string) : void; - setTextAlign (textAlign: number) : void; - setTextid (textid: string) : void; - setVerticalAlign (verticalAlign: number) : void; - setVerticalAlign (verticalAlign: string) : void; - setWordWrap (wordWrap: boolean) : void; - } - export interface SearchBar extends Ti.UI.View { - autocapitalization : number; - autocorrect : boolean; - barColor : string; - hintText : string; - hinttextid : string; - keyboardType : number; - prompt : string; - promptid : string; - showBookmark : boolean; - showCancel : boolean; - value : string; - blur () : void; - focus () : void; - getAutocapitalization () : number; - getAutocorrect () : boolean; - getBarColor () : string; - getHintText () : string; - getHinttextid () : string; - getKeyboardType () : number; - getPrompt () : string; - getPromptid () : string; - getShowBookmark () : boolean; - getShowCancel () : boolean; - getValue () : string; - setAutocapitalization (autocapitalization: number) : void; - setAutocorrect (autocorrect: boolean) : void; - setBarColor (barColor: string) : void; - setHintText (hintText: string) : void; - setHinttextid (hinttextid: string) : void; - setKeyboardType (keyboardType: number) : void; - setPrompt (prompt: string) : void; - setPromptid (promptid: string) : void; - setShowBookmark (showBookmark: boolean) : void; - setShowCancel (showCancel: boolean, animated?: Dictionary) : void; - setValue (value: string) : void; - } - export interface SMSDialog extends Ti.Proxy { - CANCELLED : number; - FAILED : number; - SENT : number; - messageBody : string; - toRecipients : Array; - getMessageBody () : string; - getToRecipients () : Array; - isSupported () : boolean; - open () : void; - setMessageBody (messageBody: string) : void; - setToRecipients (toRecipients: Array) : void; - } - export interface TableViewSection extends Ti.Proxy { - footerTitle : string; - footerView : Ti.UI.View; - headerTitle : string; - headerView : Ti.UI.View; - rowCount : number; - rows : Array; - add (row: Ti.UI.TableViewRow) : void; - getFooterTitle () : string; - getFooterView () : Ti.UI.View; - getHeaderTitle () : string; - getHeaderView () : Ti.UI.View; - getRowCount () : number; - getRows () : Array; - remove (row: Ti.UI.TableViewRow) : void; - rowAtIndex (index: number) : Ti.UI.TableViewRow; - setFooterTitle (footerTitle: string) : void; - setFooterView (footerView: Ti.UI.View) : void; - setHeaderTitle (headerTitle: string) : void; - setHeaderView (headerView: Ti.UI.View) : void; - } - export interface Animation extends Ti.Proxy { - anchorPoint : Point; - autoreverse : boolean; - backgroundColor : string; - bottom : number; - center : any; - color : string; - curve : number; - delay : number; - duration : number; - height : number; - left : number; - opacity : number; - opaque : boolean; - repeat : number; - right : number; - top : number; - transform : any; - transition : number; - view : Ti.UI.View; - visible : boolean; - width : number; - zIndex : number; - getAnchorPoint () : Point; - getAutoreverse () : boolean; - getBackgroundColor () : string; - getBottom () : number; - getCenter () : any; - getColor () : string; - getCurve () : number; - getDelay () : number; - getDuration () : number; - getHeight () : number; - getLeft () : number; - getOpacity () : number; - getOpaque () : boolean; - getRepeat () : number; - getRight () : number; - getTop () : number; - getTransform () : any; - getTransition () : number; - getView () : Ti.UI.View; - getVisible () : boolean; - getWidth () : number; - getZIndex () : number; - setAnchorPoint (anchorPoint: Point) : void; - setAutoreverse (autoreverse: boolean) : void; - setBackgroundColor (backgroundColor: string) : void; - setBottom (bottom: number) : void; - setCenter (center: any) : void; - setColor (color: string) : void; - setCurve (curve: number) : void; - setDelay (delay: number) : void; - setDuration (duration: number) : void; - setHeight (height: number) : void; - setLeft (left: number) : void; - setOpacity (opacity: number) : void; - setOpaque (opaque: boolean) : void; - setRepeat (repeat: number) : void; - setRight (right: number) : void; - setTop (top: number) : void; - setTransform (transform: Ti.UI._2DMatrix) : void; - setTransform (transform: Ti.UI._3DMatrix) : void; - setTransition (transition: number) : void; - setView (view: Ti.UI.View) : void; - setVisible (visible: boolean) : void; - setWidth (width: number) : void; - setZIndex (zIndex: number) : void; - } - export interface Toolbar extends Ti.UI.View { - barColor : string; - borderBottom : boolean; - borderTop : boolean; - items : Array; - translucent : boolean; - getBarColor () : string; - getBorderBottom () : boolean; - getBorderTop () : boolean; - getItems () : Array; - getTranslucent () : boolean; - setBarColor (barColor: string) : void; - setBorderBottom (borderBottom: boolean) : void; - setBorderTop (borderTop: boolean) : void; - setItems (items: Array) : void; - setTranslucent (translucent: boolean) : void; - } - export interface Notification extends Ti.UI.View { - duration : number; - horizontalMargin : number; - message : string; - verticalMargin : number; - xOffset : number; - yOffset : number; - getDuration () : number; - getHorizontalMargin () : number; - getMessage () : string; - getVerticalMargin () : number; - getXOffset () : number; - getYOffset () : number; - setDuration (duration: number) : void; - setHorizontalMargin (horizontalMargin: number) : void; - setMessage (message: string) : void; - setVerticalMargin (verticalMargin: number) : void; - setXOffset (xOffset: number) : void; - setYOffset (yOffset: number) : void; - } - export interface PickerColumn extends Ti.UI.View { - font : Font; - rowCount : number; - rows : Array; - selectedRow : Ti.UI.PickerRow; - addRow (row: Ti.UI.PickerRow) : void; - getFont () : Font; - getRowCount () : number; - getRows () : Array; - getSelectedRow () : Ti.UI.PickerRow; - removeRow (row: Ti.UI.PickerRow) : void; - setFont (font: Font) : void; - setSelectedRow (selectedRow: Ti.UI.PickerRow) : void; - } - export interface ActivityIndicator extends Ti.Proxy { - bottom : any; - color : string; - font : Font; - height : string; - indicatorColor : string; - indicatorDiameter : string; - left : any; - message : string; - messageid : string; - right : any; - style : number; - top : any; - width : string; - add () : void; - getBottom () : any; - getColor () : string; - getFont () : Font; - getHeight () : string; - getIndicatorColor () : string; - getIndicatorDiameter () : string; - getLeft () : any; - getMessage () : string; - getMessageid () : string; - getRight () : any; - getStyle () : number; - getTop () : any; - getWidth () : string; - hide () : void; - remove () : void; - setBottom (bottom: number) : void; - setBottom (bottom: string) : void; - setColor (color: string) : void; - setFont (font: Font) : void; - setHeight (height: string) : void; - setIndicatorColor (indicatorColor: string) : void; - setIndicatorDiameter (indicatorDiameter: string) : void; - setLeft (left: number) : void; - setLeft (left: string) : void; - setMessage (message: string) : void; - setMessageid (messageid: string) : void; - setRight (right: number) : void; - setRight (right: string) : void; - setStyle (style: number) : void; - setTop (top: number) : void; - setTop (top: string) : void; - setWidth (width: string) : void; - show () : void; - } - export interface Picker extends Ti.UI.View { - calendarViewShown : boolean; - columns : Array; - countDownDuration : number; - font : Font; - format24 : boolean; - locale : string; - maxDate : Date; - minDate : Date; - minuteInterval : number; - selectionIndicator : boolean; - type : number; - useSpinner : boolean; - value : Date; - visibleItems : number; - add (data: Array) : void; - add (data: Ti.UI.PickerRow) : void; - add (data: Array) : void; - add (data: Ti.UI.PickerColumn) : void; - getCalendarViewShown () : boolean; - getColumns () : Array; - getCountDownDuration () : number; - getFont () : Font; - getFormat24 () : boolean; - getLocale () : string; - getMaxDate () : Date; - getMinDate () : Date; - getMinuteInterval () : number; - getSelectedRow (index: number) : Ti.UI.PickerRow; - getSelectionIndicator () : boolean; - getType () : number; - getUseSpinner () : boolean; - getValue () : Date; - getVisibleItems () : number; - reloadColumn (column: Ti.UI.PickerColumn) : void; - setCalendarViewShown (calendarViewShown: boolean) : void; - setColumns (columns: Array) : void; - setCountDownDuration (countDownDuration: number) : void; - setFont (font: Font) : void; - setFormat24 (format24: boolean) : void; - setLocale (locale: string) : void; - setMaxDate (maxDate: Date) : void; - setMinDate (minDate: Date) : void; - setMinuteInterval (minuteInterval: number) : void; - setSelectedRow (column: number, row: number, animated?: boolean) : void; - setSelectionIndicator (selectionIndicator: boolean) : void; - setType (type: number) : void; - setUseSpinner (useSpinner: boolean) : void; - setValue (date: any, suppressEvent: boolean) : Ti.UI.PickerRow; - setVisibleItems (visibleItems: number) : void; - showDatePickerDialog (dictObj: any) : void; - showTimePickerDialog (dictObj: any) : void; - } - } - export enum Module { + + /** + * A container for binary data. + */ + interface Blob extends Titanium.Proxy { + /** + * File object represented by this blob, or `null` if this blob is not + * associated with a file. + */ + readonly file: Titanium.Filesystem.File; + + /** + * Length of this blob in bytes. + */ + readonly length: number; + + /** + * UTF-8 string representation of the data in this blob. + */ + readonly text: string; + + /** + * Mime type of the data in this blob. + */ + readonly mimeType: string; + + /** + * If this blob represents an image, this is the height of the image in pixels. + */ + readonly height: number; + + /** + * If this blob represents an image, this is the width of the image in pixels. + */ + readonly width: number; + + /** + * If this blob represents a [File](Titanium.Filesystem.File), this is the file URL + * that represents it. + */ + readonly nativePath: string; + + /** + * Size of the blob in pixels (for image blobs) or bytes (for all other blobs). + */ + readonly size: number; + + /** + * Returns a string representation of this blob. + */ + toString(): string; + + /** + * Appends the data from another blob to this blob. + */ + append(blob: Titanium.Blob): void; + + /** + * Creates a new blob by cropping the underlying image to the specified dimensions. + */ + imageAsCropped(options: any): Titanium.Blob; + + /** + * Creates a new blob by resizing and scaling the underlying image to the specified dimensions. + */ + imageAsResized(width: number, height: number): Titanium.Blob; + + /** + * Creates a new blob by compressing the underlying image to the specified quality. + */ + imageAsCompressed(quality: number): Titanium.Blob; + + /** + * Returns a thumbnail version of the underlying image, optionally with a border and rounded corners. + */ + imageAsThumbnail(size: number, borderSize?: number, cornerRadius?: number): Titanium.Blob; + + /** + * Returns a copy of the underlying image with an added alpha channel. + */ + imageWithAlpha(): Titanium.Blob; + + /** + * Returns a copy of the underlying image with rounded corners added. + */ + imageWithRoundedCorner(cornerSize: number, borderSize?: number): Titanium.Blob; + + /** + * Returns a copy of the underlying image with an added transparent border. + */ + imageWithTransparentBorder(size: number): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getFile(): Titanium.Filesystem.File; + + /** + * Gets the value of the property. + */ + getLength(): number; + + /** + * Gets the value of the property. + */ + getText(): string; + + /** + * Gets the value of the property. + */ + getMimeType(): string; + + /** + * Gets the value of the property. + */ + getHeight(): number; + + /** + * Gets the value of the property. + */ + getWidth(): number; + + /** + * Gets the value of the property. + */ + getNativePath(): string; + + /** + * Gets the value of the property. + */ + getSize(): number; } - export interface API { - debug (message: Array) : void; - debug (message: string) : void; - error (message: Array) : void; - error (message: string) : void; - info (message: Array) : void; - info (message: string) : void; - log (level: string, message: Array) : void; - log (level: string, message: string) : void; - timestamp (message: Array) : void; - timestamp (message: string) : void; - trace (message: Array) : void; - trace (message: string) : void; - warn (message: Array) : void; - warn (message: string) : void; + + /** + * Wrapper around that implements the interface. + */ + interface BlobStream extends Titanium.Proxy { + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * Closes this stream. + */ + close(): void; + } - export module Geolocation { - export var ACCURACY_BEST : number; - export var ACCURACY_BEST_FOR_NAVIGATION : number; - export var ACCURACY_HIGH : number; - export var ACCURACY_HUNDRED_METERS : number; - export var ACCURACY_KILOMETER : number; - export var ACCURACY_LOW : number; - export var ACCURACY_NEAREST_TEN_METERS : number; - export var ACCURACY_THREE_KILOMETERS : number; - export var ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION : string; - export var ACTIVITYTYPE_FITNESS : string; - export var ACTIVITYTYPE_OTHER : string; - export var ACTIVITYTYPE_OTHER_NAVIGATION : string; - export var AUTHORIZATION_ALWAYS : number; - export var AUTHORIZATION_AUTHORIZED : number; - export var AUTHORIZATION_DENIED : number; - export var AUTHORIZATION_RESTRICTED : number; - export var AUTHORIZATION_UNKNOWN : number; - export var AUTHORIZATION_WHEN_IN_USE : number; - export var ERROR_DENIED : number; - export var ERROR_HEADING_FAILURE : number; - export var ERROR_LOCATION_UNKNOWN : number; - export var ERROR_NETWORK : number; - export var ERROR_REGION_MONITORING_DELAYED : number; - export var ERROR_REGION_MONITORING_DENIED : number; - export var ERROR_REGION_MONITORING_FAILURE : number; - export var ERROR_TIMEOUT : number; - export var PROVIDER_GPS : string; - export var PROVIDER_NETWORK : string; - export var PROVIDER_PASSIVE : string; - export var accuracy : number; - export var activityType : number; - export var apiName : string; - export var bubbleParent : boolean; - export var distanceFilter : number; - export var frequency : number; - export var hasCompass : boolean; - export var headingFilter : number; - export var lastGeolocation : string; - export var locationServicesAuthorization : number; - export var locationServicesEnabled : boolean; - export var pauseLocationUpdateAutomatically : boolean; - export var preferredProvider : string; - export var purpose : string; - export var showCalibration : boolean; - export var trackSignificantLocationChange : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function forwardGeocoder (address: string, callback: (...args : any[]) => any) : void; - export function getAccuracy () : number; - export function getActivityType () : number; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getCurrentHeading (callback: (...args : any[]) => any) : void; - export function getCurrentPosition (callback: (...args : any[]) => any) : void; - export function getDistanceFilter () : number; - export function getFrequency () : number; - export function getHasCompass () : boolean; - export function getHeadingFilter () : number; - export function getLastGeolocation () : string; - export function getLocationServicesAuthorization () : number; - export function getLocationServicesEnabled () : boolean; - export function getPauseLocationUpdateAutomatically () : boolean; - export function getPreferredProvider () : string; - export function getPurpose () : string; - export function getShowCalibration () : boolean; - export function getTrackSignificantLocationChange () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function reverseGeocoder (latitude: number, longitude: number, callback: (...args : any[]) => any) : void; - export function setAccuracy (accuracy: number) : void; - export function setActivityType (activityType: number) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setDistanceFilter (distanceFilter: number) : void; - export function setFrequency (frequency: number) : void; - export function setHeadingFilter (headingFilter: number) : void; - export function setLocationServicesAuthorization (locationServicesAuthorization: number) : void; - export function setPauseLocationUpdateAutomatically (pauseLocationUpdateAutomatically: boolean) : void; - export function setPreferredProvider (preferredProvider: string) : void; - export function setPurpose (purpose: string) : void; - export function setShowCalibration (showCalibration: boolean) : void; - export function setTrackSignificantLocationChange (trackSignificantLocationChange: boolean) : void; - export module Android { - export var apiName : string; - export var bubbleParent : boolean; - export var manualMode : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function addLocationProvider (provider: Ti.Geolocation.Android.LocationProvider) : void; - export function addLocationRule (rule: Ti.Geolocation.Android.LocationRule) : void; - export function applyProperties (props: Dictionary) : void; - export function createLocationProvider (parameters?: Dictionary) : Ti.Geolocation.Android.LocationProvider; - export function createLocationRule (parameters?: Dictionary) : Ti.Geolocation.Android.LocationRule; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getManualMode () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function removeLocationProvider (provider: Ti.Geolocation.Android.LocationProvider) : void; - export function removeLocationRule (rule: Ti.Geolocation.Android.LocationRule) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setManualMode (manualMode: boolean) : void; - export interface LocationProvider extends Ti.Proxy { - minUpdateDistance : number; - minUpdateTime : number; - name : string; - getMinUpdateDistance () : number; - getMinUpdateTime () : number; - getName () : string; - setMinUpdateDistance (minUpdateDistance: number) : void; - setMinUpdateTime (minUpdateTime: number) : void; - setName (name: string) : void; + + /** + * Buffer is a mutable, resizable container for raw data. + */ + interface Buffer extends Titanium.Proxy { + /** + * Length of the buffer in bytes. + */ + length: number; + + /** + * Data to be encoded. + */ + value: number | string; + + /** + * The type of data encoding to use with `value`. + */ + type: string; + + /** + * Byte order of this buffer. + */ + byteOrder: number; + + /** + * Appends `sourceBuffer` to the this buffer. + */ + append(sourceBuffer: Titanium.Buffer, sourceOffset?: number, sourceLength?: number): number; + + /** + * Inserts data from `sourceBuffer` into this buffer at `offset`. + */ + insert(sourceBuffer: Titanium.Buffer, offset: number, sourceOffset?: number, sourceLength?: number): number; + + /** + * Copies data from `sourceBuffer` into the current buffer at `offset`. + */ + copy(sourceBuffer: Titanium.Buffer, offset: number, sourceOffset?: number, sourceLength?: number): number; + + /** + * Creates a complete or partial copy of this buffer. + */ + clone(offset?: number, length?: number): Titanium.Buffer; + + /** + * Fills this buffer with the specified byte value. + */ + fill(fillByte: number, offset?: number, length?: number): void; + + /** + * Clears this buffer's contents but does not change the size of the buffer. + */ + clear(): void; + + /** + * Releases the space allocated to the buffer, and sets its length to 0. + */ + release(): void; + + /** + * Converts this buffer to a String. + */ + toString(): string; + + /** + * Converts this buffer to a . + */ + toBlob(): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getLength(): number; + + /** + * Sets the value of the property. + */ + setLength(length: number): void; + + /** + * Gets the value of the property. + */ + getValue(): number | string; + + /** + * Sets the value of the property. + */ + setValue(value: number): void; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getType(): string; + + /** + * Sets the value of the property. + */ + setType(type: string): void; + + /** + * Gets the value of the property. + */ + getByteOrder(): number; + + /** + * Sets the value of the property. + */ + setByteOrder(byteOrder: number): void; + + } + + /** + * Wrapper around that implements the interface. + */ + interface BufferStream extends Titanium.Proxy { + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * Closes this stream. + */ + close(): void; + + } + + /** + * The base type for all Titanium events. + */ + interface Event { + /** + * Source object that fired the event. + */ + readonly source: any; + + /** + * Name of the event fired. + */ + readonly type: string; + + /** + * True if the event will try to bubble up if possible. + */ + readonly bubbles: boolean; + + /** + * Set to true to stop the event from bubbling. + */ + cancelBubble: boolean; + + } + + /** + * IOStream is the interface that all stream types implement. + */ + // tslint:disable-next-line:interface-name + interface IOStream extends Titanium.Proxy { + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * Closes this stream. + */ + close(): void; + + } + + + /** + * The main module. + */ + namespace UI { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * slowly and speeds up. + */ + const ANIMATION_CURVE_EASE_IN: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * slowly, and speeds up, then slows down at the end of the animation. + */ + const ANIMATION_CURVE_EASE_IN_OUT: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * quickly, then slows down at the end of the animation. + */ + const ANIMATION_CURVE_EASE_OUT: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that proceeds + * at a constant rate. + */ + const ANIMATION_CURVE_LINEAR: number; + + /** + * Use with to specify a font. + */ + const ATTRIBUTE_FONT: number; + + /** + * Use with to specify a font color. + */ + const ATTRIBUTE_FOREGROUND_COLOR: number; + + /** + * Use with to specify a background color. + */ + const ATTRIBUTE_BACKGROUND_COLOR: number; + + /** + * Use with to enable or disable ligatures. + */ + const ATTRIBUTE_LIGATURE: number; + + /** + * Use with to use a letterpress text effect. + */ + const ATTRIBUTE_LETTERPRESS_STYLE: number; + + /** + * Use with to specify kerning (space between characters). + */ + const ATTRIBUTE_KERN: number; + + /** + * Use with to place a horizontal line through the text. + */ + const ATTRIBUTE_STRIKETHROUGH_STYLE: number; + + /** + * Use with to place a horizontal line under the text. + */ + const ATTRIBUTE_UNDERLINES_STYLE: number; + + /** + * Use with to place the text in an upper position. + */ + const ATTRIBUTE_SUPERSCRIPT_STYLE: number; + + /** + * Use with to place the text in a lower position. + */ + const ATTRIBUTE_SUBSCRIPT_STYLE: number; + + /** + * Use with to specify a color for the stroke text. + */ + const ATTRIBUTE_STROKE_COLOR: number; + + /** + * Use with to specify the width of the stroke text. + */ + const ATTRIBUTE_STROKE_WIDTH: number; + + /** + * Use with to display a shadow behind the text. + */ + const ATTRIBUTE_SHADOW: number; + + /** + * Use with to control the direction of the text. + */ + const ATTRIBUTE_WRITING_DIRECTION: number; + + /** + * Use with to apply a text effect. + */ + const ATTRIBUTE_TEXT_EFFECT: number; + + /** + * Use with to create a link. + */ + const ATTRIBUTE_LINK: number; + + /** + * Use with to apply a different baseline to the text. + */ + const ATTRIBUTE_BASELINE_OFFSET: number; + + /** + * Use with to change the color of the horizontal line. + */ + const ATTRIBUTE_UNDERLINE_COLOR: number; + + /** + * Use with to change the color of the horizontal line. + */ + const ATTRIBUTE_STRIKETHROUGH_COLOR: number; + + /** + * Use with to skew the text. + */ + const ATTRIBUTE_OBLIQUENESS: number; + + /** + * Use with to stretch the text horizontally. + */ + const ATTRIBUTE_EXPANSION: number; + + /** + * Use with to wrap and truncate the text. + */ + const ATTRIBUTE_LINE_BREAK: number; + + /** + * Use with to not draw a line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_NONE: number; + + /** + * Use with to draw a single line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_SINGLE: number; + + /** + * Use with to draw a thick line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_THICK: number; + + /** + * Use with to draw a double line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_DOUBLE: number; + + /** + * Use with to draw a solid line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_SOLID: number; + + /** + * Use with to draw a dotted line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DOT: number; + + /** + * Use with to draw a dashed line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH: number; + + /** + * Use with to draw an alternating line of dashes and dots. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT: number; + + /** + * Use with to draw an alternating line of dashes and two dots. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT: number; + + /** + * Use with to draw a line only underneath or through words. + */ + const ATTRIBUTE_UNDERLINE_BY_WORD: number; + + /** + * Use with to use the embedded text direction. + */ + const ATTRIBUTE_WRITING_DIRECTION_EMBEDDING: number; + + /** + * Use with to override the text direction. + */ + const ATTRIBUTE_WRITING_DIRECTION_OVERRIDE: number; + + /** + * Use with to use the + * [Unicode Bidirection Algorithm rules P2 and P3](http://www.unicode.org/reports/tr9/#The_Paragraph_Level) + * to determine which direction to use. + */ + const ATTRIBUTE_WRITING_DIRECTION_NATURAL: number; + + /** + * Use with to write text left to right. + */ + const ATTRIBUTE_WRITING_DIRECTION_LEFT_TO_RIGHT: number; + + /** + * Use with to write text right to left. + */ + const ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT: number; + + /** + * Use with to wrap words at word boundaries. + */ + const ATTRIBUTE_LINE_BREAK_BY_WORD_WRAPPING: number; + + /** + * Use with to wrap words at word boundaries. + */ + const ATTRIBUTE_LINE_BREAK_BY_CHAR_WRAPPING: number; + + /** + * Use with to set lines to not draw past the edge of the text container. + */ + const ATTRIBUTE_LINE_BREAK_BY_CLIPPING: number; + + /** + * Use with to use ellipsis glyph at the beginning of the line for missing text. + */ + const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_HEAD: number; + + /** + * Use with to use ellipsis glyph at the middle of the line for missing text. + */ + const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_MIDDLE: number; + + /** + * Use with to use ellipsis glyph at the end of the line for missing text. + */ + const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_TAIL: number; + + /** + * Converts strings formatted as addresses into clickable links. + */ + const AUTODETECT_ADDRESS: number; + + /** + * Converts all detectable types of data into clickable links. + */ + const AUTODETECT_ALL: number; + + /** + * Converts strings formatted as calendar events into clickable links. + */ + const AUTODETECT_CALENDAR: number; + + /** + * Converts strings formatted as URLs into clickable links. + */ + const AUTODETECT_LINK: number; + + /** + * Disables converting strings into clickable links. + */ + const AUTODETECT_NONE: number; + + /** + * Converts strings formatted as phone numbers into clickable links. + */ + const AUTODETECT_PHONE: number; + + /** + * Specifies the expectation of an account or login name. + */ + const AUTOFILL_TYPE_USERNAME: string; + + /** + * Specifies the expectation of a password. + */ + const AUTOFILL_TYPE_PASSWORD: string; + + /** + * Specifies the expectation of a name. + */ + const AUTOFILL_TYPE_NAME: string; + + /** + * Specifies the expectation of a prefix or title, such as 'Dr.' + */ + const AUTOFILL_TYPE_NAME_PREFIX: string; + + /** + * Specifies the expectation of a given name. + */ + const AUTOFILL_TYPE_GIVEN_NAME: string; + + /** + * Specifies the expectation of a middle name. + */ + const AUTOFILL_TYPE_MIDDLE_NAME: string; + + /** + * Specifies the expectation of a family name. + */ + const AUTOFILL_TYPE_FAMILY_NAME: string; + + /** + * Specifies the expectation of a suffix, such as 'Jr.' + */ + const AUTOFILL_TYPE_NAME_SUFFIX: string; + + /** + * Specifies the expectation of a nickname. + */ + const AUTOFILL_TYPE_NICKNAME: string; + + /** + * Specifies the expectation of a job title. + */ + const AUTOFILL_TYPE_JOB_TITLE: string; + + /** + * Specifies the expectation of an organization name. + */ + const AUTOFILL_TYPE_ORGANIZATION_NAME: string; + + /** + * Specifies the expectation of a location, such as a point of interest, an address, or another way to identify a location. + */ + const AUTOFILL_TYPE_LOCATION: string; + + /** + * Specifies the expectation of an address. + */ + const AUTOFILL_TYPE_ADDRESS: string; + + /** + * Specifies the expectation of the first line of a street address. + */ + const AUTOFILL_TYPE_ADDRESS_LINE1: string; + + /** + * Specifies the expectation of the second line of a street address. + */ + const AUTOFILL_TYPE_ADDRESS_LINE2: string; + + /** + * Specifies the expectation of a city name. + */ + const AUTOFILL_TYPE_ADDRESS_CITY: string; + + /** + * Specifies the expectation of a state name. + */ + const AUTOFILL_TYPE_ADDRESS_STATE: string; + + /** + * Specifies the expectation of a city name combined with a state name. + */ + const AUTOFILL_TYPE_ADDRESS_CITY_STATE: string; + + /** + * Specifies the expectation of a sublocality. + */ + const AUTOFILL_TYPE_SUBLOCALITY: string; + + /** + * Specifies the expectation of a country name. + */ + const AUTOFILL_TYPE_COUNTRY_NAME: string; + + /** + * Specifies the expectation of a postal code. + */ + const AUTOFILL_TYPE_POSTAL_CODE: string; + + /** + * Specifies the expectation of a telephone number. + */ + const AUTOFILL_TYPE_PHONE: string; + + /** + * Specifies the expectation of an email address. + */ + const AUTOFILL_TYPE_EMAIL: string; + + /** + * Specifies the expectation of a URL. + */ + const AUTOFILL_TYPE_URL: string; + + /** + * Specifies the expectation of a card number. + */ + const AUTOFILL_TYPE_CARD_NUMBER: string; + + /** + * Specifies the expectation of a card security code. + */ + const AUTOFILL_TYPE_CARD_SECURITY_CODE: string; + + /** + * Specifies the expectation of a card expiration date. + */ + const AUTOFILL_TYPE_CARD_EXPIRATION_DATE: string; + + /** + * Specifies the expectation of a card expectation day. + */ + const AUTOFILL_TYPE_CARD_EXPIRATION_DAY: string; + + /** + * Specifies the expectation of a card expectation month. + */ + const AUTOFILL_TYPE_CARD_EXPIRATION_MONTH: string; + + /** + * Specifies the expectation of a card expectation year. + */ + const AUTOFILL_TYPE_CARD_EXPIRATION_YEAR: string; + + /** + * Converts strings formatted as addresses into clickable links. + */ + const AUTOLINK_MAP_ADDRESSES: number; + + /** + * Converts all detectable types of data into clickable links. + */ + const AUTOLINK_ALL: number; + + /** + * Converts strings formatted as calendar events into clickable links. + */ + const AUTOLINK_CALENDAR: number; + + /** + * Converts strings formatted as URLs into clickable links. + */ + const AUTOLINK_URLS: number; + + /** + * Disables converting strings into clickable links. + */ + const AUTOLINK_NONE: number; + + /** + * Converts strings formatted as phone numbers into clickable links. + */ + const AUTOLINK_PHONE_NUMBERS: number; + + /** + * Converts strings formatted as email addresses into clickable links. + */ + const AUTOLINK_EMAIL_ADDRESSES: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_CLEAR: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR_BURN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR_DODGE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COPY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DARKEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_ATOP: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_IN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_OUT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_OVER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DIFFERENCE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_EXCLUSION: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_HARD_LIGHT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_HUE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_LIGHTEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_LUMINOSITY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_MULTIPLY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_NORMAL: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_OVERLAY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_PLUS_DARKER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_PLUS_LIGHTER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SATURATION: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SCREEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOFT_LIGHT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_ATOP: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_IN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_OUT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_XOR: number; + + /** + * Use when creating a TextField to specify the hintType as static. + */ + const HINT_TYPE_STATIC: number; + + /** + * Use when creating a TextField to specify the hintType as animated. + */ + const HINT_TYPE_ANIMATED: number; + + /** + * Add ellipses at word boundaries, unless the word itself doesn't fit on a single line. + */ + const TEXT_ELLIPSIZE_TRUNCATE_WORD_WRAP: number; + + /** + * Add ellipses before the first character that doesnt fit. + */ + const TEXT_ELLIPSIZE_TRUNCATE_CHAR_WRAP: number; + + /** + * Lines are simply not drawn past the edge of the text container. + */ + const TEXT_ELLIPSIZE_TRUNCATE_CLIP: number; + + /** + * Add ellipses at the beginning of the label if the text is too large to fit. + */ + const TEXT_ELLIPSIZE_TRUNCATE_START: number; + + /** + * Add ellipses in the middle of the label if the text is too large to fit. + */ + const TEXT_ELLIPSIZE_TRUNCATE_MIDDLE: number; + + /** + * Add ellipses at the end of the label if the text is too large to fit. + */ + const TEXT_ELLIPSIZE_TRUNCATE_END: number; + + /** + * Turns on a marquee effect of the label if the text is too large to fit. (This requires to be true) + */ + const TEXT_ELLIPSIZE_TRUNCATE_MARQUEE: number; + + /** + * Disables ellipsizing of the label. The text will be cut off if it is too long. + */ + const TEXT_ELLIPSIZE_TRUNCATE_NONE: number; + + /** + * Specifies that the top edge of the window can extend. + */ + const EXTEND_EDGE_TOP: number; + + /** + * Specifies that the bottom edge of the window can extend. + */ + const EXTEND_EDGE_BOTTOM: number; + + /** + * Specifies that the left edge of the window can extend. + */ + const EXTEND_EDGE_LEFT: number; + + /** + * Specifies that the right edge of the window can extend. + */ + const EXTEND_EDGE_RIGHT: number; + + /** + * Specifies that none of the edges of the window can extend. + */ + const EXTEND_EDGE_NONE: number; + + /** + * Specifies that all the edges of the window can extend. + */ + const EXTEND_EDGE_ALL: number; + + /** + * Constant value for face-down orientation. + */ + const FACE_DOWN: number; + + /** + * Constant value for face-up orientation. + */ + const FACE_UP: number; + + /** + * FILL behavior for UI layout. + */ + const FILL: string; + + /** + * Release free space when hiding an object. + */ + const HIDDEN_BEHAVIOR_GONE: number; + + /** + * Keeps free space when hiding an object. + */ + const HIDDEN_BEHAVIOR_INVISIBLE: number; + + /** + * Use a bezel-style border on the input field. + */ + const INPUT_BORDERSTYLE_BEZEL: number; + + /** + * Use a simple line border on the input field. + */ + const INPUT_BORDERSTYLE_LINE: number; + + /** + * Use no border on the input field. + */ + const INPUT_BORDERSTYLE_NONE: number; + + /** + * Use a rounded-rectangle border on the input field. + */ + const INPUT_BORDERSTYLE_ROUNDED: number; + + /** + * Always show buttons on the input field. + */ + const INPUT_BUTTONMODE_ALWAYS: number; + + /** + * Never show buttons on the input field. + */ + const INPUT_BUTTONMODE_NEVER: number; + + /** + * Show buttons on the input field when it loses focus. + */ + const INPUT_BUTTONMODE_ONBLUR: number; + + /** + * Show buttons on the input field when it gains focus. + */ + const INPUT_BUTTONMODE_ONFOCUS: number; + + /** + * Use a keyboard with a number pad only, with the pad keyboard layout. Accepts only numbers. + */ + const INPUT_TYPE_CLASS_NUMBER: number; + + /** + * Use an ASCII keyboard, with the standard keyboard layout. + */ + const INPUT_TYPE_CLASS_TEXT: number; + + /** + * Use a keyboard appearance suitable for entering text on an alert. + */ + const KEYBOARD_APPEARANCE_ALERT: number; + + /** + * Use the platform-specific default keyboard appearance. + */ + const KEYBOARD_APPEARANCE_DEFAULT: number; + + /** + * Use the platform-specific dark keyboard appearance. + */ + const KEYBOARD_APPEARANCE_DARK: number; + + /** + * Use the platform-specific light keyboard appearance. + */ + const KEYBOARD_APPEARANCE_LIGHT: number; + + /** + * Use an ASCII keyboard, with the standard keyboard layout. + */ + const KEYBOARD_ASCII: number; + + /** + * Use a keyboard with decimal numbers only, with the pad keyboard layout. + */ + const KEYBOARD_DECIMAL_PAD: number; + + /** + * Use the default keyboard, depending on the platform. + */ + const KEYBOARD_DEFAULT: number; + + /** + * Use a keyboard suitable for composing email, with the standard keyboard layout. + */ + const KEYBOARD_EMAIL: number; + + /** + * Use a keyboard suitable for entering names and phone numbers, with the pad keyboard layout. + */ + const KEYBOARD_NAMEPHONE_PAD: number; + + /** + * Use a keyboard with numbers and punctuation only, with the standard keyboard layout. + */ + const KEYBOARD_NUMBERS_PUNCTUATION: number; + + /** + * Use a keyboard with a number pad only, with the pad keyboard layout. + */ + const KEYBOARD_NUMBER_PAD: number; + + /** + * Use a keyboard with a phone-style number pad, with the pad keyboard layout. + */ + const KEYBOARD_PHONE_PAD: number; + + /** + * Use a keyboard optimized for entering URLs, with the standard keyboard layout. + */ + const KEYBOARD_URL: number; + + /** + * Use a keyboard with decimal numbers only, with the pad keyboard layout. + */ + const KEYBOARD_TYPE_DECIMAL_PAD: number; + + /** + * Use an ASCII keyboard, with the standard keyboard layout. + */ + const KEYBOARD_TYPE_ASCII: number; + + /** + * Use the default keyboard, depending on the platform. + */ + const KEYBOARD_TYPE_DEFAULT: number; + + /** + * Use a keyboard suitable for composing email, with the standard keyboard layout. + */ + const KEYBOARD_TYPE_EMAIL: number; + + /** + * Use a keyboard suitable for entering names and phone numbers, with the pad keyboard layout. + */ + const KEYBOARD_TYPE_NAMEPHONE_PAD: number; + + /** + * Use a keyboard with numbers and punctuation only, with the standard keyboard layout. + */ + const KEYBOARD_TYPE_NUMBERS_PUNCTUATION: number; + + /** + * Use a keyboard with a number pad only, with the pad keyboard layout. + */ + const KEYBOARD_TYPE_NUMBER_PAD: number; + + /** + * Use a keyboard with a phone-style number pad, with the pad keyboard layout. + */ + const KEYBOARD_TYPE_PHONE_PAD: number; + + /** + * Use a keyboard optimized for web search terms and URL entry. + */ + const KEYBOARD_TYPE_WEBSEARCH: number; + + /** + * Use a keyboard optimized for twitter text entry, with easy access to the @ and + */ + const KEYBOARD_TYPE_TWITTER: number; + + /** + * Use a keyboard optimized for entering URLs, with the standard keyboard layout. + */ + const KEYBOARD_TYPE_URL: number; + + /** + * Standard landscape orientation (home button on left). + */ + const LANDSCAPE_LEFT: number; + + /** + * Reverse landscape orientation (home button on right). + */ + const LANDSCAPE_RIGHT: number; + + /** + * Do not display anything on the right side of an item in a list view. + */ + const LIST_ACCESSORY_TYPE_NONE: number; + + /** + * Displays a checkmark on the right side of an item in a list view. + */ + const LIST_ACCESSORY_TYPE_CHECKMARK: number; + + /** + * Displays a detail disclosure button on the right side of an item in a list view. + */ + const LIST_ACCESSORY_TYPE_DETAIL: number; + + /** + * Displays a disclosure indicator on the right side of an item in a list view. + */ + const LIST_ACCESSORY_TYPE_DISCLOSURE: number; + + /** + * A built-in style for an item with an image view and left-aligned title label. + */ + const LIST_ITEM_TEMPLATE_DEFAULT: number; + + /** + * A built-in style for a item with an image view; a left-aligned title label; and a + * right-aligned subtitle label. + */ + const LIST_ITEM_TEMPLATE_SETTINGS: number; + + /** + * A built-in style for an item with a right-aligned title label on the left side of the cell, + * which is next to a left-aligned subtitle label. + */ + const LIST_ITEM_TEMPLATE_CONTACTS: number; + + /** + * A built-in style for an item with an image view; a black, left-aligned title label across the + * top of the cell and a subtitle label below it. + */ + const LIST_ITEM_TEMPLATE_SUBTITLE: number; + + /** + * Specifies a long duration for an Android Toast notification (). + */ + const NOTIFICATION_DURATION_LONG: number; + + /** + * Specifies a short duration for an Android Toast notification (). + */ + const NOTIFICATION_DURATION_SHORT: number; + + /** + * Specifies that the clipboard items should not be available to other devices through Handoff. + */ + const CLIPBOARD_OPTION_LOCAL_ONLY: string; + + /** + * Specifies the time and date that you want the system to remove the clipboard items from the clipboard. + */ + const CLIPBOARD_OPTION_EXPIRATION_DATE: string; + + /** + * Use a picker with a countdown timer appearance, showing hours and minutes. + */ + const PICKER_TYPE_COUNT_DOWN_TIMER: number; + + /** + * Use a date picker. + */ + const PICKER_TYPE_DATE: number; + + /** + * Use a date and time picker. + */ + const PICKER_TYPE_DATE_AND_TIME: number; + + /** + * Use a plain picker (for values other than date or time). + */ + const PICKER_TYPE_PLAIN: number; + + /** + * Use a time picker. + */ + const PICKER_TYPE_TIME: number; + + /** + * Orientation constant for portrait mode orientation. + */ + const PORTRAIT: number; + + /** + * Set the return key text to "Continue". + */ + const RETURNKEY_CONTINUE: number; + + /** + * Use the default return key on the virtual keyboard. + */ + const RETURNKEY_DEFAULT: number; + + /** + * Set the return key text to "Done". + */ + const RETURNKEY_DONE: number; + + /** + * Set the return key text to "Emergency Call". + */ + const RETURNKEY_EMERGENCY_CALL: number; + + /** + * Set the return key text to "Go". + */ + const RETURNKEY_GO: number; + + /** + * Set the return key text to "Google". + */ + const RETURNKEY_GOOGLE: number; + + /** + * Set the return key text to "Join". + */ + const RETURNKEY_JOIN: number; + + /** + * Set the return key text to "Next". + */ + const RETURNKEY_NEXT: number; + + /** + * Set the return key text to "Route". + */ + const RETURNKEY_ROUTE: number; + + /** + * Set the return key text to "Search". + */ + const RETURNKEY_SEARCH: number; + + /** + * Set the return key text to "Send". + */ + const RETURNKEY_SEND: number; + + /** + * Set the return key text to "Yahoo". + */ + const RETURNKEY_YAHOO: number; + + /** + * SIZE behavior for UI layout. + */ + const SIZE: string; + + /** + * The row divider is hidden. + */ + const TABLE_VIEW_SEPARATOR_STYLE_NONE: number; + + /** + * The row divider is shown as a single line. + */ + const TABLE_VIEW_SEPARATOR_STYLE_SINGLE_LINE: number; + + /** + * Center align text. + */ + const TEXT_ALIGNMENT_CENTER: number | string; + + /** + * Justify align text. + */ + const TEXT_ALIGNMENT_JUSTIFY: number | string; + + /** + * Left align text. + */ + const TEXT_ALIGNMENT_LEFT: number | string; + + /** + * Right align text. + */ + const TEXT_ALIGNMENT_RIGHT: number | string; + + /** + * Auto-capitalize all text in the input field. + */ + const TEXT_AUTOCAPITALIZATION_ALL: number; + + /** + * Do not auto-capitalize. + */ + const TEXT_AUTOCAPITALIZATION_NONE: number; + + /** + * Use sentence-style auto-capitalization in the input field. + */ + const TEXT_AUTOCAPITALIZATION_SENTENCES: number; + + /** + * Auto-capitalize the first letter of each word in the input field. + */ + const TEXT_AUTOCAPITALIZATION_WORDS: number; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_HEADLINE: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_SUBHEADLINE: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_BODY: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_FOOTNOTE: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_CAPTION1: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_CAPTION2: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_CALLOUT: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_TITLE1: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_TITLE2: string; + + /** + * Specifies the text style for the Object. + */ + const TEXT_STYLE_TITLE3: string; + + /** + * Align text to the bottom of the view. + */ + const TEXT_VERTICAL_ALIGNMENT_BOTTOM: number | string; + + /** + * Vertically align text to the center of the view. + */ + const TEXT_VERTICAL_ALIGNMENT_CENTER: number | string; + + /** + * Align text to the top of the view. + */ + const TEXT_VERTICAL_ALIGNMENT_TOP: number | string; + + /** + * Unit constant representing units in centimeters. + */ + const UNIT_CM: string; + + /** + * Unit constant representing units in density-independent pixels. + */ + const UNIT_DIP: string; + + /** + * Unit constant representing units in inches. + */ + const UNIT_IN: string; + + /** + * Unit constant representing units in millimeters. + */ + const UNIT_MM: string; + + /** + * Unit constant representing units in pixels. + */ + const UNIT_PX: string; + + /** + * Orientation constant representing an unknown orientation. + */ + const UNKNOWN: number; + + /** + * Orientation constant for inverted portait orientation. + */ + const UPSIDE_PORTRAIT: number; + + /** + * Authentication error code reported via . + */ + const URL_ERROR_AUTHENTICATION: number; + + /** + * Bad url error code reported via . + */ + const URL_ERROR_BAD_URL: number; + + /** + * Error code reported via for a failure to connect to host. + */ + const URL_ERROR_CONNECT: number; + + /** + * Error code reported via for an SSL failure. + */ + const URL_ERROR_SSL_FAILED: number; + + /** + * Error code reported via for a failure to access a file resource on a host, except "file not found", which has its own constant. + */ + const URL_ERROR_FILE: number; + + /** + * Error code reported via when a requested file does not exist on the host. + */ + const URL_ERROR_FILE_NOT_FOUND: number; + + /** + * Error code reported via when a host name cannot be resolved, such as via a DNS lookup error. + */ + const URL_ERROR_HOST_LOOKUP: number; + + /** + * Error code reported via when a redirect loop is detected. + */ + const URL_ERROR_REDIRECT_LOOP: number; + + /** + * Error code reported via when a timeout occurs. + */ + const URL_ERROR_TIMEOUT: number; + + /** + * Error code reported via when an unknown error occurs. + */ + const URL_ERROR_UNKNOWN: number; + + /** + * Error code reported via when a url contains an unsupported scheme. + */ + const URL_ERROR_UNSUPPORTED_SCHEME: number; + + /** + * Sets the background color of the master view (when there are no windows or other top-level + * controls displayed). + */ + let backgroundColor: string; + + /** + * Local path or URL to an image file for setting a background for the master view (when there + * are no windows or other top-level controls displayed). + */ + let backgroundImage: string; + + /** + * The currently active tab, if a tab group is open. + */ + let currentTab: Titanium.UI.Tab; + + /** + * The active window associated with the executing JavaScript context. + */ + const currentWindow: Titanium.UI.Window; + + /** + * Updates the orientation of the current window to the specified orientation value. + */ + let orientation: number; + + /** + * Sets the global tint color of the application. It is inherited by the child views and can be + * overwritten by them using the `tintColor` property. + */ + let tintColor: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of . + */ + function create2DMatrix(parameters?: MatrixCreationDict): Titanium.UI.Matrix2D; + + /** + * Converts one type of unit to another using the metrics of the main display. + */ + function convertUnits(convertFromValue: string, convertToUnits: number): number; + + /** + * Creates and returns an instance of . + */ + function createView(parameters?: any): Titanium.UI.View; + + /** + * Creates and returns an instance of . + */ + function create3DMatrix(parameters?: any): Titanium.UI.Matrix3D; + + /** + * Creates and returns an instance of . + */ + function createActivityIndicator(parameters?: any): Titanium.UI.ActivityIndicator; + + /** + * Creates and returns an instance of . + */ + function createAlertDialog(parameters?: any): Titanium.UI.AlertDialog; + + /** + * Creates and returns an instance of . + */ + function createAnimation(parameters?: any): Titanium.UI.Animation; + + /** + * Creates and returns an instance of . + */ + function createAttributedString(parameters?: any): Titanium.UI.AttributedString; + + /** + * Creates and returns an instance of . + */ + function createButton(parameters?: any): Titanium.UI.Button; + + /** + * Creates and returns an instance of . + */ + function createButtonBar(parameters?: any): Titanium.UI.ButtonBar; + + /** + * Creates and returns an instance of . + */ + function createCoverFlowView(parameters?: any): Titanium.UI.CoverFlowView; + + /** + * Creates and returns an instance of . + */ + function createDashboardItem(parameters?: any): Titanium.UI.DashboardItem; + + /** + * Creates and returns an instance of . + */ + function createDashboardView(parameters?: any): Titanium.UI.DashboardView; + + /** + * Creates and returns an instance of . + */ + function createEmailDialog(parameters?: any): Titanium.UI.EmailDialog; + + /** + * Creates and returns an instance of . + */ + function createImageView(parameters?: any): Titanium.UI.ImageView; + + /** + * Creates and returns an instance of . + */ + function createLabel(parameters?: any): Titanium.UI.Label; + + /** + * Creates and returns an instance of . + */ + function createListSection(parameters?: any): Titanium.UI.ListSection; + + /** + * Creates and returns an instance of . + */ + function createListView(parameters?: any): Titanium.UI.ListView; + + /** + * Creates and returns an instance of . + */ + function createMaskedImage(parameters?: any): Titanium.UI.MaskedImage; + + /** + * Creates and returns an instance of . + */ + function createNotification(parameters?: any): Titanium.UI.Notification; + + /** + * Creates and returns an instance of . + */ + function createOptionDialog(parameters?: any): Titanium.UI.OptionDialog; + + /** + * Creates and returns an instance of . + */ + function createPicker(parameters?: any): Titanium.UI.Picker; + + /** + * Creates and returns an instance of . + */ + function createPickerColumn(parameters?: any): Titanium.UI.PickerColumn; + + /** + * Creates and returns an instance of . + */ + function createPickerRow(parameters?: any): Titanium.UI.PickerRow; + + /** + * Creates and returns an instance of . + */ + function createProgressBar(parameters?: any): Titanium.UI.ProgressBar; + + /** + * Creates and returns an instance of . + */ + function createRefreshControl(parameters?: any): Titanium.UI.RefreshControl; + + /** + * Creates and returns an instance of . + */ + function createScrollView(parameters?: any): Titanium.UI.ScrollView; + + /** + * Creates and returns an instance of . + */ + function createScrollableView(parameters?: any): Titanium.UI.ScrollableView; + + /** + * Creates and returns an instance of . + */ + function createSearchBar(parameters?: any): Titanium.UI.SearchBar; + + /** + * Creates and returns an instance of . + */ + function createSlider(parameters?: any): Titanium.UI.Slider; + + /** + * Creates and returns an instance of . + */ + function createSwitch(parameters?: any): Titanium.UI.Switch; + + /** + * Creates and returns an instance of . + */ + function createTab(parameters?: any): Titanium.UI.Tab; + + /** + * Creates and returns an instance of . + */ + function createTabGroup(parameters?: any): Titanium.UI.TabGroup; + + /** + * Creates and returns an instance of . + */ + function createTabbedBar(parameters?: any): Titanium.UI.TabbedBar; + + /** + * Creates and returns an instance of . + */ + function createTableView(parameters?: any): Titanium.UI.TableView; + + /** + * Creates and returns an instance of . + */ + function createTableViewRow(parameters?: any): Titanium.UI.TableViewRow; + + /** + * Creates and returns an instance of . + */ + function createTableViewSection(parameters?: any): Titanium.UI.TableViewSection; + + /** + * Creates and returns an instance of . + */ + function createTextArea(parameters?: any): Titanium.UI.TextArea; + + /** + * Creates and returns an instance of . + */ + function createTextField(parameters?: any): Titanium.UI.TextField; + + /** + * Creates and returns an instance of . + */ + function createToolbar(parameters?: any): Titanium.UI.Toolbar; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + function setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + function getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + function setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + function getCurrentTab(): Titanium.UI.Tab; + + /** + * Sets the value of the property. + */ + function setCurrentTab(currentTab: Titanium.UI.Tab): void; + + /** + * Gets the value of the property. + */ + function getCurrentWindow(): Titanium.UI.Window; + + /** + * Gets the value of the property. + */ + function getOrientation(): number; + + /** + * Sets the value of the property. + */ + function setOrientation(orientation: number): void; + + /** + * Gets the value of the property. + */ + function getTintColor(): string; + + /** + * Sets the value of the property. + */ + function setTintColor(tintColor: string): void; + + /** + * Creates and returns an instance of . + */ + function createWebView(parameters?: any): Titanium.UI.WebView; + + /** + * Creates and returns an instance of . + */ + function createWindow(parameters?: any): Titanium.UI.Window; + + /** + * An empty drawing surface or container + */ + interface View extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + } + + /** + * An empty drawing surface or container + */ + interface View { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + } + + /** + * The 2D Matrix is an object for holding values for an affine transformation matrix. + */ + interface Matrix2D extends Titanium.Proxy { + /** + * The entry at position [1,1] in the matrix. + */ + a: number; + + /** + * The entry at position [1,2] in the matrix. + */ + b: number; + + /** + * The entry at position [2,1] in the matrix. + */ + c: number; + + /** + * The entry at position [2,2] in the matrix. + */ + d: number; + + /** + * The entry at position [3,1] in the matrix. + */ + tx: number; + + /** + * The entry at position [3,2] in the matrix. + */ + ty: number; + + /** + * Returns a matrix constructed by inverting this matrix. + */ + invert(): Titanium.UI.Matrix2D; + + /** + * Returns a matrix constructed by combining two existing matrices. + */ + multiply(t2: Titanium.UI.Matrix2D): Titanium.UI.Matrix2D; + + /** + * Returns a matrix constructed by rotating this matrix. + */ + rotate(angle: number, toAngle?: number): Titanium.UI.Matrix2D; + + /** + * Returns a `2DMatrix` object that specifies a scaling animation from one scale to another. + */ + scale(sx: number, sy: number, toSx?: number, toSy?: number): Titanium.UI.Matrix2D; + + /** + * Returns a matrix constructed by applying a translation transform to this matrix. + */ + translate(tx: number, ty: number): Titanium.UI.Matrix2D; + + /** + * Gets the value of the property. + */ + getA(): number; + + /** + * Sets the value of the property. + */ + setA(a: number): void; + + /** + * Gets the value of the property. + */ + getB(): number; + + /** + * Sets the value of the property. + */ + setB(b: number): void; + + /** + * Gets the value of the property. + */ + getC(): number; + + /** + * Sets the value of the property. + */ + setC(c: number): void; + + /** + * Gets the value of the property. + */ + getD(): number; + + /** + * Sets the value of the property. + */ + setD(d: number): void; + + /** + * Gets the value of the property. + */ + getTx(): number; + + /** + * Sets the value of the property. + */ + setTx(tx: number): void; + + /** + * Gets the value of the property. + */ + getTy(): number; + + /** + * Sets the value of the property. + */ + setTy(ty: number): void; + + } + + /** + * The 3D Matrix is an object for holding values for a 3D affine transform. + */ + interface Matrix3D extends Titanium.Proxy { + /** + * The entry at position [1,1] in the matrix. + */ + m11: number; + + /** + * The entry at position [1,2] in the matrix. + */ + m12: number; + + /** + * The entry at position [1,3] in the matrix. + */ + m13: number; + + /** + * The entry at position [1,4] in the matrix. + */ + m14: number; + + /** + * The entry at position [2,1] in the matrix. + */ + m21: number; + + /** + * The entry at position [2,2] in the matrix. + */ + m22: number; + + /** + * The entry at position [2,3] in the matrix. + */ + m23: number; + + /** + * The entry at position [2,4] in the matrix. + */ + m24: number; + + /** + * The entry at position [3,1] in the matrix. + */ + m31: number; + + /** + * The entry at position [3,2] in the matrix. + */ + m32: number; + + /** + * The entry at position [3,3] in the matrix. + */ + m33: number; + + /** + * The entry at position [3,4] in the matrix. + */ + m34: number; + + /** + * The entry at position [4,1] in the matrix. + */ + m41: number; + + /** + * The entry at position [4,2] in the matrix. + */ + m42: number; + + /** + * The entry at position [4,3] in the matrix. + */ + m43: number; + + /** + * The entry at position [4,4] in the matrix. + */ + m44: number; + + /** + * Returns a matrix constructed by inverting this matrix. + */ + invert(): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by combining two existing matrix. + */ + multiply(t2: Titanium.UI.Matrix3D): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by rotating this matrix. + */ + rotate(angle: number, x: number, y: number, z: number): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by scaling this matrix. + */ + scale(sx: number, sy: number, sz: number): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by translating an existing matrix. + */ + translate(tx: number, ty: number, tz: number): Titanium.UI.Matrix3D; + + /** + * Gets the value of the property. + */ + getM11(): number; + + /** + * Sets the value of the property. + */ + setM11(m11: number): void; + + /** + * Gets the value of the property. + */ + getM12(): number; + + /** + * Sets the value of the property. + */ + setM12(m12: number): void; + + /** + * Gets the value of the property. + */ + getM13(): number; + + /** + * Sets the value of the property. + */ + setM13(m13: number): void; + + /** + * Gets the value of the property. + */ + getM14(): number; + + /** + * Sets the value of the property. + */ + setM14(m14: number): void; + + /** + * Gets the value of the property. + */ + getM21(): number; + + /** + * Sets the value of the property. + */ + setM21(m21: number): void; + + /** + * Gets the value of the property. + */ + getM22(): number; + + /** + * Sets the value of the property. + */ + setM22(m22: number): void; + + /** + * Gets the value of the property. + */ + getM23(): number; + + /** + * Sets the value of the property. + */ + setM23(m23: number): void; + + /** + * Gets the value of the property. + */ + getM24(): number; + + /** + * Sets the value of the property. + */ + setM24(m24: number): void; + + /** + * Gets the value of the property. + */ + getM31(): number; + + /** + * Sets the value of the property. + */ + setM31(m31: number): void; + + /** + * Gets the value of the property. + */ + getM32(): number; + + /** + * Sets the value of the property. + */ + setM32(m32: number): void; + + /** + * Gets the value of the property. + */ + getM33(): number; + + /** + * Sets the value of the property. + */ + setM33(m33: number): void; + + /** + * Gets the value of the property. + */ + getM34(): number; + + /** + * Sets the value of the property. + */ + setM34(m34: number): void; + + /** + * Gets the value of the property. + */ + getM41(): number; + + /** + * Sets the value of the property. + */ + setM41(m41: number): void; + + /** + * Gets the value of the property. + */ + getM42(): number; + + /** + * Sets the value of the property. + */ + setM42(m42: number): void; + + /** + * Gets the value of the property. + */ + getM43(): number; + + /** + * Sets the value of the property. + */ + setM43(m43: number): void; + + /** + * Gets the value of the property. + */ + getM44(): number; + + /** + * Sets the value of the property. + */ + setM44(m44: number): void; + + } + + /** + * An activity indicator that lets the user know an action is taking place. + */ + interface ActivityIndicator extends Titanium.UI.View { + /** + * Color of the message text, as a color name or hex triplet. + */ + color: string; + + /** + * Font used for the message text. + */ + font: Font; + + /** + * Message text. + */ + message: string; + + /** + * Key identifying a string in the locale file to use for the message text. + */ + messageid: string; + + /** + * The style for the activity indicator. + */ + style: number; + + /** + * Color of the animated indicator. + */ + indicatorColor: string; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getMessageid(): string; + + /** + * Sets the value of the property. + */ + setMessageid(messageid: string): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getIndicatorColor(): string; + + /** + * Sets the value of the property. + */ + setIndicatorColor(indicatorColor: string): void; + + } + + /** + * An alert dialog is a modal view that includes an optional title, a message and buttons, + * positioned in the middle of the display. + */ + interface AlertDialog extends Titanium.UI.View { + /** + * View to load inside the message area, to create a custom layout. + */ + androidView: Titanium.UI.View; + + /** + * Name of each button to create. + */ + buttonNames: string[]; + + /** + * Index to define the cancel button. + */ + cancel: number; + + /** + * When this is set to `true`, the dialog is canceled when touched outside the window's bounds. + */ + canceledOnTouchOutside: boolean; + + /** + * Index to define the destructive button. + */ + destructive: number; + + /** + * Hint text of the text field inside the dialog. + */ + hintText: string; + + /** + * Key identifying a string from the locale file to use for the + * [hintText](Titanium.UI.AlertDialog.hintText) property. + */ + hinttextid: string; + + /** + * Keyboard type to display when this text field inside the dialog is focused. + */ + keyboardType: number; + + /** + * Keyboard appearance to be displayed when the text field inside the dialog is focused. + */ + keyboardAppearance: number; + + /** + * Placeholder of the login text field inside the dialog. + */ + loginPlaceholder: string; + + /** + * Hint text of the login text field inside the dialog. + */ + loginHintText: string; + + /** + * Key identifying a string from the locale file to use for the + * [loginHintText](Titanium.UI.AlertDialog.loginHintText) property. + */ + loginhinttextid: string; + + /** + * Specifies the text to display on the keyboard `Return` key when this field is focused. + */ + loginReturnKeyType: number; + + /** + * Value of the login text field inside the dialog. + */ + loginValue: string; + + /** + * Keyboard type to display when this text field inside the dialog is focused. + */ + loginKeyboardType: number; + + /** + * Dialog message. + */ + message: string; + + /** + * Key identifying a string in the locale file to use for the message text. + */ + messageid: string; + + /** + * Text for the `OK` button. + */ + ok: string; + + /** + * Key identifying a string in the locale file to use for the `ok` text. + */ + okid: string; + + /** + * Placeholder of the password text field inside the dialog. + */ + passwordPlaceholder: string; + + /** + * Hint text of the password text field inside the dialog. + */ + passwordHintText: string; + + /** + * Key identifying a string from the locale file to use for the + * [passwordHintText](Titanium.UI.AlertDialog.passwordHintText) property. + */ + passwordhinttextid: string; + + /** + * Specifies the text to display on the keyboard `Return` key when this field is focused. + */ + passwordReturnKeyType: number; + + /** + * Value of the password text field inside the dialog. + */ + passwordValue: string; + + /** + * Keyboard type to display when this text field inside the dialog is focused. + */ + passwordKeyboardType: number; + + /** + * Placeholder of the text field inside the dialog. + */ + placeholder: string; + + /** + * Boolean value indicating if the alert dialog should only be cancelled by user gesture or by hide method. + */ + persistent: boolean; + + /** + * Index to define the preferred button. + */ + preferred: number; + + /** + * Specifies the text to display on the keyboard `Return` key when this field is focused. + */ + returnKeyType: number; + + /** + * The style for the alert dialog. + */ + style: number; + + /** + * Title of the dialog. + */ + title: string; + + /** + * Key identifying a string in the locale file to use for the title text. + */ + titleid: string; + + /** + * Value of the text field inside the dialog. + */ + value: string; + + /** + * Gets the value of the property. + */ + getButtonNames(): string[]; + + /** + * Sets the value of the property. + */ + setButtonNames(buttonNames: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCancel(): number; + + /** + * Sets the value of the property. + */ + setCancel(cancel: number): void; + + /** + * Gets the value of the property. + */ + getCanceledOnTouchOutside(): boolean; + + /** + * Sets the value of the property. + */ + setCanceledOnTouchOutside(canceledOnTouchOutside: boolean): void; + + /** + * Gets the value of the property. + */ + getDestructive(): number; + + /** + * Sets the value of the property. + */ + setDestructive(destructive: number): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getHinttextid(): string; + + /** + * Sets the value of the property. + */ + setHinttextid(hinttextid: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setKeyboardType(keyboardType: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardAppearance(): number; + + /** + * Sets the value of the property. + */ + setKeyboardAppearance(keyboardAppearance: number): void; + + /** + * Gets the value of the property. + */ + getLoginPlaceholder(): string; + + /** + * Sets the value of the property. + */ + setLoginPlaceholder(loginPlaceholder: string): void; + + /** + * Gets the value of the property. + */ + getLoginHintText(): string; + + /** + * Sets the value of the property. + */ + setLoginHintText(loginHintText: string): void; + + /** + * Gets the value of the property. + */ + getLoginhinttextid(): string; + + /** + * Sets the value of the property. + */ + setLoginhinttextid(loginhinttextid: string): void; + + /** + * Gets the value of the property. + */ + getLoginReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setLoginReturnKeyType(loginReturnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getLoginValue(): string; + + /** + * Sets the value of the property. + */ + setLoginValue(loginValue: string): void; + + /** + * Gets the value of the property. + */ + getLoginKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setLoginKeyboardType(loginKeyboardType: number): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getMessageid(): string; + + /** + * Sets the value of the property. + */ + setMessageid(messageid: string): void; + + /** + * Gets the value of the property. + */ + getOk(): string; + + /** + * Sets the value of the property. + */ + setOk(ok: string): void; + + /** + * Gets the value of the property. + */ + getOkid(): string; + + /** + * Sets the value of the property. + */ + setOkid(okid: string): void; + + /** + * Gets the value of the property. + */ + getPasswordPlaceholder(): string; + + /** + * Sets the value of the property. + */ + setPasswordPlaceholder(passwordPlaceholder: string): void; + + /** + * Gets the value of the property. + */ + getPasswordHintText(): string; + + /** + * Sets the value of the property. + */ + setPasswordHintText(passwordHintText: string): void; + + /** + * Gets the value of the property. + */ + getPasswordhinttextid(): string; + + /** + * Sets the value of the property. + */ + setPasswordhinttextid(passwordhinttextid: string): void; + + /** + * Gets the value of the property. + */ + getPasswordReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setPasswordReturnKeyType(passwordReturnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getPasswordValue(): string; + + /** + * Sets the value of the property. + */ + setPasswordValue(passwordValue: string): void; + + /** + * Gets the value of the property. + */ + getPasswordKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setPasswordKeyboardType(passwordKeyboardType: number): void; + + /** + * Gets the value of the property. + */ + getPlaceholder(): string; + + /** + * Sets the value of the property. + */ + setPlaceholder(placeholder: string): void; + + /** + * Gets the value of the property. + */ + getPersistent(): boolean; + + /** + * Sets the value of the property. + */ + setPersistent(persistent: boolean): void; + + /** + * Gets the value of the property. + */ + getPreferred(): number; + + /** + * Sets the value of the property. + */ + setPreferred(preferred: number): void; + + /** + * Gets the value of the property. + */ + getReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setReturnKeyType(returnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + } + + /** + * The `Animation` object defines an animation that can be applied to a view. + */ + interface Animation extends Titanium.Proxy { + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Specifies if the animation should be replayed in reverse upon completion. + */ + autoreverse: boolean; + + /** + * Value of the `backgroundColor` property at the end of the animation, as a color name + * or hex triplet. + */ + backgroundColor: string; + + /** + * Value of the `bottom` property at the end of the animation. + */ + bottom: number; + + /** + * Value of the `center` property at the end of the animation. + */ + center: any; + + /** + * Value of the `color` property at the end of the animation, as a color name or hex triplet. + */ + color: string; + + /** + * Animation curve or easing function to apply to the animation. + */ + curve: number; + + /** + * Delay, in milliseconds before starting the animation. + */ + delay: number; + + /** + * Duration of the animation, in milliseconds. + */ + duration: number; + + /** + * Value of the `height` property at the end of the animation. + */ + height: number; + + /** + * Value of the `left` property at the end of the animation. + */ + left: number; + + /** + * Value of the `opacity` property at the end of the animation. + */ + opacity: number; + + /** + * Value of the `opaque` property at the end of the animation. + */ + opaque: boolean; + + /** + * Number of times the animation should be performed. + */ + repeat: number; + + /** + * Value of the `right` property at the end of the animation. + */ + right: number; + + /** + * Value of the `top` property at the end of the animation. + */ + top: number; + + /** + * Animate the view from its current tranform to the specified transform. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Transition type to use during a transition animation. + */ + transition: number; + + /** + * New view to transition to. + */ + view: Titanium.UI.View; + + /** + * Value of the `visible` property at the end of the animation. + */ + visible: boolean; + + /** + * Value of the `width` property at the end of the animation. + */ + width: number; + + /** + * Value of the `zIndex` property at the end of the animation. + */ + zIndex: number; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAutoreverse(): boolean; + + /** + * Sets the value of the property. + */ + setAutoreverse(autoreverse: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBottom(): number; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Gets the value of the property. + */ + getCenter(): any; + + /** + * Sets the value of the property. + */ + setCenter(center: any): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getCurve(): number; + + /** + * Sets the value of the property. + */ + setCurve(curve: number): void; + + /** + * Gets the value of the property. + */ + getDelay(): number; + + /** + * Sets the value of the property. + */ + setDelay(delay: number): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOpaque(): boolean; + + /** + * Sets the value of the property. + */ + setOpaque(opaque: boolean): void; + + /** + * Gets the value of the property. + */ + getRepeat(): number; + + /** + * Sets the value of the property. + */ + setRepeat(repeat: number): void; + + /** + * Gets the value of the property. + */ + getRight(): number; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTransition(): number; + + /** + * Sets the value of the property. + */ + setTransition(transition: number): void; + + /** + * Gets the value of the property. + */ + getView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setView(view: any): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + } + + /** + * An attributed string proxy manages character strings and associated sets of attributes (for example, + * font and foregroundcolor) that apply to individual characters or ranges of characters in the string. + */ + interface AttributedString extends Titanium.Proxy { + /** + * The text applied to the attributed string. + */ + text: string; + + /** + * An array of attributes to add. + */ + attributes: Attribute[]; + + /** + * Adds an [attribute](Attribute) with the given name and value to the characters in the specified range. + */ + addAttribute(attribute: Attribute): void; + + /** + * Gets the value of the property. + */ + getText(): string; + + /** + * Sets the value of the property. + */ + setText(text: string): void; + + /** + * Gets the value of the property. + */ + getAttributes(): Attribute[]; + + /** + * Sets the value of the property. + */ + setAttributes(attributes: ReadonlyArray): void; + + } + + /** + * A button widget that has four states: normal, disabled, focused and selected. + */ + interface Button extends Titanium.UI.View { + /** + * Default button text color, as a color name or hex triplet. + */ + color: string; + + /** + * Text color of the button in its disabled state, as a color name or hex triplet. + */ + disabledColor: string; + + /** + * Set to `true` to enable the button, `false` to disable the button. + */ + enabled: boolean; + + /** + * Font to use for the button text. + */ + font: Font; + + /** + * Image to display on the button, specified as a local path, URL or a `Blob`. + */ + image: string | Titanium.Blob; + + /** + * Button text color used to indicate the selected state, as a color name or hex triplet. + */ + selectedColor: string; + + /** + * Shadow color of the [title](Titanium.UI.Button.title), as a color name or hex triplet. + */ + shadowColor: string; + + /** + * Shadow offset of the [title](Titanium.UI.Button.title), as a dictionary with the properties `x` and `y`. + */ + shadowOffset: any; + + /** + * Shadow radius of the [title](Titanium.UI.Button.title). + */ + shadowRadius: number; + + /** + * Style constant for the button, as defined in . + */ + style: number; + + /** + * Specifies an iOS system button appearance, as defined in . + */ + systemButton: number; + + /** + * Text alignment, specified using one of the text alignment constants. + */ + textAlign: string | number; + + /** + * Button title. + */ + title: string; + + /** + * Key identifying a string from the locale file to use for the button title. + */ + titleid: string; + + /** + * Vertical alignment for the text field, specified using one of the + * vertical alignment constants from . + */ + verticalAlign: number | string; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setDisabledColor(disabledColor: string): void; + + /** + * Gets the value of the property. + */ + getEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setEnabled(enabled: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedColor(selectedColor: string): void; + + /** + * Gets the value of the property. + */ + getShadowColor(): string; + + /** + * Sets the value of the property. + */ + setShadowColor(shadowColor: string): void; + + /** + * Gets the value of the property. + */ + getShadowOffset(): any; + + /** + * Sets the value of the property. + */ + setShadowOffset(shadowOffset: any): void; + + /** + * Gets the value of the property. + */ + getShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setShadowRadius(shadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getSystemButton(): number; + + /** + * Sets the value of the property. + */ + setSystemButton(systemButton: number): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + } + + /** + * An iOS button bar component. + */ + interface ButtonBar extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Index of the currently selected button. + */ + index: number; + + /** + * Array of labels for the button bar. + */ + labels: string[] | BarItemType[]; + + /** + * Style of the button bar. + */ + style: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getIndex(): number; + + /** + * Sets the value of the property. + */ + setIndex(index: number): void; + + /** + * Gets the value of the property. + */ + getLabels(): string[] | BarItemType[]; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * The cover flow view is a container showing animated three-dimensional images in a style + * consistent with the cover flow presentation used for iPod, iTunes, and file browsing. + */ + interface CoverFlowView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Array of images to display in the view. + */ + images: string[] | Titanium.Blob[] | Titanium.Filesystem.File[] | CoverFlowImageType[]; + + /** + * Index to make selected. + */ + selected: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: string): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: Titanium.Blob): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: Titanium.Filesystem.File): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: CoverFlowImageType): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getImages(): string[] | Titanium.Blob[] | Titanium.Filesystem.File[] | CoverFlowImageType[]; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSelected(): number; + + /** + * Sets the value of the property. + */ + setSelected(selected: number): void; + + } + + /** + * A dashboard item is a view that is displayed as an icon in a . + */ + interface DashboardItem extends Titanium.Proxy { + /** + * Integer value displayed in a badge. + */ + badge: number; + + /** + * Determines whether this item can be deleted when it edit mode. + */ + canDelete: boolean; + + /** + * Image or path to image to display in the item by default. + */ + image: string | Titanium.Blob; + + /** + * Image or path to image to display in the item as it is selected. + */ + selectedImage: string | Titanium.Blob; + + /** + * Gets the value of the property. + */ + getBadge(): number; + + /** + * Sets the value of the property. + */ + setBadge(badge: number): void; + + /** + * Gets the value of the property. + */ + getCanDelete(): boolean; + + /** + * Sets the value of the property. + */ + setCanDelete(canDelete: boolean): void; + + /** + * Gets the value of the property. + */ + getImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getSelectedImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setSelectedImage(selectedImage: string): void; + + /** + * Sets the value of the property. + */ + setSelectedImage(selectedImage: Titanium.Blob): void; + + } + + /** + * A dashboard view is an iOS Springboard-like view of items that may + * be deleted and reordered by the user using its built-in edit mode. + */ + interface DashboardView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * The number of columns of items in the view. + */ + columnCount: number; + + /** + * The number of rows of items in the view. + */ + rowCount: number; + + /** + * Items to display in this view. + */ + data: Titanium.UI.DashboardItem[]; + + /** + * Determines whether edit mode is activated by a longpress of an item. + */ + editable: boolean; + + /** + * Determines whether the wobble visual editing cue is enabled in edit mode. + */ + wobble: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Enable edit mode. + */ + startEditing(): void; + + /** + * Disable edit mode. + */ + stopEditing(): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getColumnCount(): number; + + /** + * Sets the value of the property. + */ + setColumnCount(columnCount: number): void; + + /** + * Gets the value of the property. + */ + getRowCount(): number; + + /** + * Sets the value of the property. + */ + setRowCount(rowCount: number): void; + + /** + * Gets the value of the property. + */ + getData(): Titanium.UI.DashboardItem[]; + + /** + * Sets the value of the property. + */ + setData(data: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getWobble(): boolean; + + /** + * Sets the value of the property. + */ + setWobble(wobble: boolean): void; + + } + + /** + * An email dialog is a modal window that allows users to compose and send an email. + */ + interface EmailDialog extends Titanium.UI.View { + /** + * Constant for the `CANCELLED` status result. On Android, this property exists but is not used. + */ + readonly CANCELLED: number; + + /** + * Constant for the `FAILED` status result. + */ + readonly FAILED: number; + + /** + * Constant for the `SAVED` status result. On Android, this property exists but is not used. + */ + readonly SAVED: number; + + /** + * Constant for the `SENT` status result. + */ + readonly SENT: number; + + /** + * Bar color of the email dialog window, as a color name or hex triplet. + */ + barColor: string; + + /** + * Recipients of the email included via the `BCC` (Blind Carbon Copy) field. + */ + bccRecipients: string[]; + + /** + * Recipients of the email included via the `CC` (Carbon Copy) field. + */ + ccRecipients: string[]; + + /** + * Determines whether the email message, specifically the contents of + * [messageBody](Titanium.UI.EmailDialog.messageBody), should be sent as HTML content type + * rather than plain text. + */ + html: boolean; + + /** + * Email message body. + */ + messageBody: string; + + /** + * Subject line for the email. + */ + subject: string; + + /** + * Recipients of the email included via the main `TO` field. + */ + toRecipients: string[]; + + /** + * Adds an attachment. + */ + addAttachment(attachment: Titanium.Blob): void; + + /** + * Adds an attachment. + */ + addAttachment(attachment: Titanium.Filesystem.File): void; + + /** + * Indicates whether sending email is supported by the system. + */ + isSupported(): boolean; + + /** + * Opens this email dialog. + */ + open(properties: any): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getBccRecipients(): string[]; + + /** + * Sets the value of the property. + */ + setBccRecipients(bccRecipients: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCcRecipients(): string[]; + + /** + * Sets the value of the property. + */ + setCcRecipients(ccRecipients: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getHtml(): boolean; + + /** + * Sets the value of the property. + */ + setHtml(html: boolean): void; + + /** + * Gets the value of the property. + */ + getMessageBody(): string; + + /** + * Sets the value of the property. + */ + setMessageBody(messageBody: string): void; + + /** + * Gets the value of the property. + */ + getSubject(): string; + + /** + * Sets the value of the property. + */ + setSubject(subject: string): void; + + /** + * Gets the value of the property. + */ + getToRecipients(): string[]; + + /** + * Sets the value of the property. + */ + setToRecipients(toRecipients: ReadonlyArray): void; + + } + + /** + * A view to display a single image or series of animated images. + */ + interface ImageView extends Titanium.UI.View { + /** + * Indicates whether animation is running. + */ + readonly animating: boolean; + + /** + * Indicates whether the image should be rotated based on exif orientation data. + * By default, this is false on android and true on iOS. + */ + autorotate: boolean; + + /** + * Number of times to retry decoding the bitmap at a URL. + */ + decodeRetries: number; + + /** + * Local path to the default image to display while loading a remote image. + */ + defaultImage: string; + + /** + * Amount of time in milliseconds to animate one cycle. + */ + duration: number; + + /** + * Show zoom controls when the user touches the image view. + */ + enableZoomControls: boolean; + + /** + * Set to `true` to prevent scaling of 2x-resolution remote images for Retina + * displays. + */ + hires: boolean; + + /** + * Image to display. + */ + image: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Array of images to animate, defined using local filesystem paths, `File` objects, + * remote URLs (Android only), or `Blob` objects containing image data. + * When using this property, an initial `start()` needs to be called upon the ImageView before any image will show in this imageview. + * Related properties/methods to look at: `start`, `stop`, `pause`, `reverse`, `resume` and `repeatCount` + */ + images: string[] | Titanium.Blob[] | Titanium.Filesystem.File[]; + + /** + * Indicates whether the animation is paused. + */ + readonly paused: boolean; + + /** + * Prevent the default image from being displayed while loading a remote image. This property + * is ignored when the `defaultImage` property is set. + */ + preventDefaultImage: boolean; + + /** + * Number of times to repeat the image animation. + */ + repeatCount: number; + + /** + * Run the animation in reverse. + */ + reverse: boolean; + + /** + * URL to the image to display. + */ + url: string; + + /** + * Pauses a running animation. Use `resume` method to continue. + */ + pause(): void; + + /** + * Resumes an animation from a `pause` state. + */ + resume(): void; + + /** + * Starts the image animation. On Android, also resets `index` to the first image. + */ + start(): void; + + /** + * Stops a running animation. On iOS, also resets `index` to the first image. + */ + stop(): void; + + /** + * Returns the image as a Blob object. + */ + toBlob(): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getAnimating(): boolean; + + /** + * Gets the value of the property. + */ + getAutorotate(): boolean; + + /** + * Sets the value of the property. + */ + setAutorotate(autorotate: boolean): void; + + /** + * Gets the value of the property. + */ + getDecodeRetries(): number; + + /** + * Sets the value of the property. + */ + setDecodeRetries(decodeRetries: number): void; + + /** + * Gets the value of the property. + */ + getDefaultImage(): string; + + /** + * Sets the value of the property. + */ + setDefaultImage(defaultImage: string): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getEnableZoomControls(): boolean; + + /** + * Sets the value of the property. + */ + setEnableZoomControls(enableZoomControls: boolean): void; + + /** + * Gets the value of the property. + */ + getHires(): boolean; + + /** + * Sets the value of the property. + */ + setHires(hires: boolean): void; + + /** + * Gets the value of the property. + */ + getImage(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getImages(): string[] | Titanium.Blob[] | Titanium.Filesystem.File[]; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getPaused(): boolean; + + /** + * Gets the value of the property. + */ + getPreventDefaultImage(): boolean; + + /** + * Sets the value of the property. + */ + setPreventDefaultImage(preventDefaultImage: boolean): void; + + /** + * Gets the value of the property. + */ + getRepeatCount(): number; + + /** + * Sets the value of the property. + */ + setRepeatCount(repeatCount: number): void; + + /** + * Gets the value of the property. + */ + getReverse(): boolean; + + /** + * Sets the value of the property. + */ + setReverse(reverse: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * A text label, with optional background image. + */ + interface Label extends Titanium.UI.View { + /** + * Specify an attributed string for the label. + */ + attributedString: Titanium.UI.AttributedString; + + /** + * Automatically convert certain text items in the label to clickable links. + */ + autoLink: number; + + /** + * Number of pixels to extend the background image past the label on the bottom. + */ + backgroundPaddingBottom: number; + + /** + * Number of pixels to extend the background image past the label on the left. + */ + backgroundPaddingLeft: number; + + /** + * Number of pixels to extend the background image past the label on the right. + */ + backgroundPaddingRight: number; + + /** + * Number of pixels to extend the background image past the label on the top. + */ + backgroundPaddingTop: number; + + /** + * Color of the label text, as a color name or hex triplet. + */ + color: string; + + /** + * Causes words in the text that are longer than the view is wide to be ellipsized instead of broken in the middle. + */ + ellipsize: number; + + /** + * Font to use for the label text. + */ + font: Font; + + /** + * Color of the label when in the highlighted state, as a color name or hex triplet. + */ + highlightedColor: string; + + /** + * Simple HTML formatting. + */ + html: string; + + /** + * Includes extra top and bottom padding to make room for accents that go above normal ascent and descent. + */ + includeFontPadding: boolean; + + /** + * Makes the label be exactly this many lines tall. + */ + lines: number; + + /** + * Line spacing of the [text](Titanium.UI.Label.text), as a dictionary with the properties `add` and `multiply`. + */ + lineSpacing: any; + + /** + * Makes the label at most this many lines tall. + */ + maxLines: number; + + /** + * Minimum font size when the font is sized based on the contents. + */ + minimumFontSize: number; + + /** + * Shadow color of the [text](Titanium.UI.Label.text), as a color name or hex triplet. + */ + shadowColor: string; + + /** + * Shadow offset of the [text](Titanium.UI.Label.text), as a dictionary with the properties `x` and `y`. + */ + shadowOffset: any; + + /** + * Shadow radius of the [text](Titanium.UI.Label.text). + */ + shadowRadius: number; + + /** + * Label text. + */ + text: string; + + /** + * Text alignment. + */ + textAlign: string | number; + + /** + * Key identifying a string from the locale file to use for the label text. + */ + textid: string; + + /** + * Enable or disable word wrapping in the label. + */ + wordWrap: boolean; + + /** + * Vertical text alignment, specified using one of the vertical alignment constants + * from . + */ + verticalAlign: number | string; + + /** + * Gets the value of the property. + */ + getAttributedString(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedString(attributedString: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAutoLink(): number; + + /** + * Sets the value of the property. + */ + setAutoLink(autoLink: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundPaddingBottom(): number; + + /** + * Sets the value of the property. + */ + setBackgroundPaddingBottom(backgroundPaddingBottom: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundPaddingLeft(): number; + + /** + * Sets the value of the property. + */ + setBackgroundPaddingLeft(backgroundPaddingLeft: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundPaddingRight(): number; + + /** + * Sets the value of the property. + */ + setBackgroundPaddingRight(backgroundPaddingRight: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundPaddingTop(): number; + + /** + * Sets the value of the property. + */ + setBackgroundPaddingTop(backgroundPaddingTop: number): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getEllipsize(): number; + + /** + * Sets the value of the property. + */ + setEllipsize(ellipsize: number): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getHighlightedColor(): string; + + /** + * Sets the value of the property. + */ + setHighlightedColor(highlightedColor: string): void; + + /** + * Gets the value of the property. + */ + getHtml(): string; + + /** + * Sets the value of the property. + */ + setHtml(html: string): void; + + /** + * Gets the value of the property. + */ + getIncludeFontPadding(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeFontPadding(includeFontPadding: boolean): void; + + /** + * Gets the value of the property. + */ + getLines(): number; + + /** + * Sets the value of the property. + */ + setLines(lines: number): void; + + /** + * Gets the value of the property. + */ + getLineSpacing(): any; + + /** + * Sets the value of the property. + */ + setLineSpacing(lineSpacing: any): void; + + /** + * Gets the value of the property. + */ + getMaxLines(): number; + + /** + * Sets the value of the property. + */ + setMaxLines(maxLines: number): void; + + /** + * Gets the value of the property. + */ + getMinimumFontSize(): number; + + /** + * Sets the value of the property. + */ + setMinimumFontSize(minimumFontSize: number): void; + + /** + * Gets the value of the property. + */ + getShadowColor(): string; + + /** + * Sets the value of the property. + */ + setShadowColor(shadowColor: string): void; + + /** + * Gets the value of the property. + */ + getShadowOffset(): any; + + /** + * Sets the value of the property. + */ + setShadowOffset(shadowOffset: any): void; + + /** + * Gets the value of the property. + */ + getShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setShadowRadius(shadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getText(): string; + + /** + * Sets the value of the property. + */ + setText(text: string): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getTextid(): string; + + /** + * Sets the value of the property. + */ + setTextid(textid: string): void; + + /** + * Gets the value of the property. + */ + getWordWrap(): boolean; + + /** + * Sets the value of the property. + */ + setWordWrap(wordWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + } + + /** + * A list item is an individual item in a list section. + */ + interface ListItem extends Titanium.Proxy { + /** + * A user defined string that gets passed to events. + */ + itemId: string; + + /** + * Sets an accessory on the right side of an item. + */ + accessoryType: number; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Background image to render when the item is not selected. + */ + backgroundImage: string; + + /** + * Background gradient to render when the item is not selected. + */ + backgroundGradient: Gradient; + + /** + * Background color of the view, as a color name or hex triplet when item is selected. + */ + selectedBackgroundColor: string; + + /** + * Background image to render when the item is selected. + */ + selectedBackgroundImage: string; + + /** + * Background gradient to render when the item is selected. + */ + selectedBackgroundGradient: Gradient; + + /** + * Specifies if the item can be deleted by a user initiated action. + */ + canEdit: boolean; + + /** + * Specifies if the item can be inserted by a user initiated action. + */ + canInsert: boolean; + + /** + * Specifies if the item can be reordered within the list view by a user initiated action. + */ + canMove: boolean; + + /** + * Specifies custom action items to be shown when when a list item is edited. + */ + editActions: RowActionType[]; + + /** + * The text to match against when the [ListView](Titanium.UI.ListView) is performing a search. + */ + searchableText: string; + + /** + * Default text color of the item when not selected, as a color name or hex triplet. + */ + color: string; + + /** + * Default text color of the subtitle, as a color name or hex triplet. + */ + subtitleColor: string; + + /** + * Color to use for the item title when the item is selected, as a color name or hex triplet. + */ + selectedColor: string; + + /** + * Color to use for the item subtitle when the item is selected, as a color name or hex triplet. + */ + selectedSubtitleColor: string; + + /** + * Font to use for the item title. + */ + font: Font; + + /** + * Row height in platform-specific units. + */ + height: number | string; + + /** + * Image to render in the image area of the item, specified as a local path or URL. + */ + image: string; + + /** + * Title to set in the text area of the item. + */ + title: string; + + /** + * Selection style constant to control the selection color. + */ + selectionStyle: number; + + /** + * Subtitle to set in the text area of the item. + */ + subtitle: string; + + /** + * Gets the value of the property. + */ + getEditActions(): RowActionType[]; + + /** + * Sets the value of the property. + */ + setEditActions(editActions: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedColor(selectedColor: string): void; + + /** + * Gets the value of the property. + */ + getSelectedSubtitleColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedSubtitleColor(selectedSubtitleColor: string): void; + + } + + /** + * A list section is a container within a list view used to organize list items. + */ + interface ListSection extends Titanium.Proxy { + /** + * Title of this section footer. + */ + footerTitle: string; + + /** + * View to use for this section footer. + */ + footerView: Titanium.UI.View; + + /** + * Title of this section header. + */ + headerTitle: string; + + /** + * View to use for this section header. + */ + headerView: Titanium.UI.View; + + /** + * Items of this list section. + */ + items: ListDataItem[]; + + /** + * Sets the data entries in the list section. + */ + setItems(dataItems: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Appends the data entries to the end of the list section. + */ + appendItems(dataItems: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Inserts data entries to the list section at the specified index. + */ + insertItemsAt(itemIndex: number, dataItems: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Removes count entries from the list section at the specified index, + * then inserts data entries to the list section at the same index. + */ + replaceItemsAt(index: number, count: number, dataItems: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Removes count entries from the list section at the specified index. + */ + deleteItemsAt(itemIndex: number, count: number, animation?: ListViewAnimationProperties): void; + + /** + * Returns the item entry from the list view at the specified index. + */ + getItemAt(itemIndex: number): ListDataItem; + + /** + * Updates an item at the specified index. + */ + updateItemAt(index: number, dataItem: ListDataItem, animation?: ListViewAnimationProperties): void; + + /** + * Gets the value of the property. + */ + getFooterTitle(): string; + + /** + * Sets the value of the property. + */ + setFooterTitle(footerTitle: string): void; + + /** + * Gets the value of the property. + */ + getFooterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setFooterView(footerView: any): void; + + /** + * Gets the value of the property. + */ + getHeaderTitle(): string; + + /** + * Sets the value of the property. + */ + setHeaderTitle(headerTitle: string): void; + + /** + * Gets the value of the property. + */ + getHeaderView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderView(headerView: any): void; + + /** + * Gets the value of the property. + */ + getItems(): ListDataItem[]; + + } + + /** + * A list view is used to present information, organized in to sections and items, + * in a vertically-scrolling view. + */ + interface ListView extends Titanium.UI.View { + /** + * Determines whether this item can be selected. + */ + allowsSelection: boolean; + + /** + * Determines if the list view can scroll in response to user actions. + */ + canScroll: boolean; + + /** + * Determines whether the scroll-bounce of the list view should be disabled. + */ + disableBounce: boolean; + + /** + * Determines if the list view is currently in editing mode. + */ + editing: boolean; + + /** + * Determines whether this list view items can be selected while editing the table. + */ + allowsSelectionDuringEditing: boolean; + + /** + * Determines whether multiple items of this list view can be selected at the same time while editing the table. + */ + allowsMultipleSelectionDuringEditing: boolean; + + /** + * Determines if the list view should use lazy loading to load remote images. + */ + lazyLoadingEnabled: boolean; + + /** + * Determines if empty sections are retained when the user completes editing the list view. + */ + pruneSectionsOnEdit: boolean; + + /** + * Contain key-value pairs mapping a style name (key) to an (value). + */ + templates: any; + + /** + * Sections of this list. + */ + sections: Titanium.UI.ListSection[]; + + /** + * Sets the default template for list data items that do not specify the `template` property. + */ + defaultItemTemplate: string | number; + + /** + * height of the ListView separator. + */ + separatorHeight: string | number; + + /** + * When set to false, the ListView will not draw the divider before the footer view. + */ + footerDividersEnabled: boolean; + + /** + * List view footer title. + */ + footerTitle: string; + + /** + * List view footer as a view that will be rendered instead of a label. + */ + footerView: Titanium.UI.View; + + /** + * When set to false, the ListView will not draw the divider after the header view. + */ + headerDividersEnabled: boolean; + + /** + * List view header title. + */ + headerTitle: string; + + /** + * List view header as a view that will be rendered instead of a label. + */ + headerView: Titanium.UI.View; + + /** + * View positioned above the first row that is only revealed when the user drags the list view contents down. + */ + pullView: Titanium.UI.View; + + /** + * View positioned above the first row that is only revealed when the user drags the list view contents down. + */ + refreshControl: Titanium.UI.RefreshControl; + + /** + * Search field to use for the list view. + */ + searchView: Titanium.UI.SearchBar | Titanium.UI.Android.SearchView; + + /** + * The string to use as the search parameter. + */ + searchText: string; + + /** + * Determines if the search performed is case insensitive. + */ + caseInsensitiveSearch: boolean; + + /** + * Determines if the section information is displayed in the search results when using the `searchText` property. + */ + keepSectionsInSearch: boolean; + + /** + * The manner in which the keyboard is dismissed when a drag begins in the list view. + */ + keyboardDismissMode: number; + + /** + * Array of objects (with `title` and `index` properties) to control the list view index. + */ + sectionIndexTitles: ListViewIndexEntry[]; + + /** + * Style of the scrollbar. + */ + scrollIndicatorStyle: number; + + /** + * Controls the scroll-to-top gesture. + */ + willScrollOnStatusTap: boolean; + + /** + * Number of sections in this list view. + */ + readonly sectionCount: number; + + /** + * Determines whether this list view displays a vertical scroll indicator. + */ + showVerticalScrollIndicator: boolean; + + /** + * Separator line color between items, as a color name or hex triplet. + */ + separatorColor: string; + + /** + * The insets for list view separators (applies to all cells). This property is applicable on iOS 7 and greater. + */ + separatorInsets: any; + + /** + * Separator style constant. + */ + separatorStyle: number; + + /** + * Style of the list view. + */ + style: number; + + /** + * The insets for the table view header and footer. This property is applicable on iOS 7 and greater. + */ + tableSeparatorInsets: any; + + /** + * The insets for the list view header and footer. This property is applicable on iOS 7 and greater. + */ + listSeparatorInsets: any; + + /** + * The insets for list view cells (applies to all cells). This property is applicable on iOS 7 and greater. + */ + rowSeparatorInsets: any; + + /** + * A Boolean indicating whether the underlying content is dimmed during a search. + */ + dimBackgroundForSearch: boolean; + + /** + * The background color of the search results (iOS-only). + */ + resultsBackgroundColor: string; + + /** + * Separator line color between rows inside search results, + * as a color name or hex triplet (iOS-only). + */ + resultsSeparatorColor: string; + + /** + * The separator style of the search results (iOS-only). + */ + resultsSeparatorStyle: number; + + /** + * The insets for search results separators (applies to all cells & iOS-only). + */ + resultsSeparatorInsets: any; + + /** + * Returns the selected list view items. + */ + selectedItems: ListItemEventType[]; + + /** + * Scrolls to a specific item. + */ + scrollToItem(sectionIndex: number, itemIndex: number, animation?: ListViewAnimationProperties): void; + + /** + * Deselects a specific item. + */ + deselectItem(sectionIndex: number, itemIndex: number): void; + + /** + * Appends a single section or an array of sections to the end of the list. + */ + appendSection(section: Titanium.UI.ListSection, animation?: ListViewAnimationProperties): void; + + /** + * Appends a single section or an array of sections to the end of the list. + */ + appendSection(section: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Deletes an existing section. + */ + deleteSectionAt(sectionIndex: number, animation?: ListViewAnimationProperties): void; + + /** + * Inserts a section or an array of sections at a specific index. + */ + insertSectionAt(sectionIndex: number, section: Titanium.UI.ListSection, animation?: ListViewAnimationProperties): void; + + /** + * Inserts a section or an array of sections at a specific index. + */ + insertSectionAt(sectionIndex: number, section: ReadonlyArray, animation?: ListViewAnimationProperties): void; + + /** + * Replaces an existing section. + */ + replaceSectionAt(sectionIndex: number, section: Titanium.UI.ListSection, animation: ListViewAnimationProperties): void; + + /** + * Selects an item in the list using the specified item and section indices. + */ + selectItem(sectionIndex: number, itemIndex: number): void; + + /** + * Sets this list view's content insets. + */ + setContentInsets(edgeInsets: ListViewEdgeInsets, animated?: ListViewContentInsetOption): void; + + /** + * Sets the value of the content offset of the list view without animation by default. + */ + setContentOffset(contentOffset: any): void; + + /** + * Sets a reference item in the list view. + */ + setMarker(markerProps: ListViewMarkerProps): void; + + /** + * Adds a reference item in the list view. + */ + addMarker(markerProps: ListViewMarkerProps): void; + + /** + * Gets the value of the property. + */ + getAllowsSelection(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsSelection(allowsSelection: boolean): void; + + /** + * Gets the value of the property. + */ + getCanScroll(): boolean; + + /** + * Sets the value of the property. + */ + setCanScroll(canScroll: boolean): void; + + /** + * Gets the value of the property. + */ + getDisableBounce(): boolean; + + /** + * Sets the value of the property. + */ + setDisableBounce(disableBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getEditing(): boolean; + + /** + * Sets the value of the property. + */ + setEditing(editing: boolean): void; + + /** + * Gets the value of the property. + */ + getAllowsSelectionDuringEditing(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsSelectionDuringEditing(allowsSelectionDuringEditing: boolean): void; + + /** + * Gets the value of the property. + */ + getAllowsMultipleSelectionDuringEditing(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsMultipleSelectionDuringEditing(allowsMultipleSelectionDuringEditing: boolean): void; + + /** + * Gets the value of the property. + */ + getLazyLoadingEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setLazyLoadingEnabled(lazyLoadingEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getPruneSectionsOnEdit(): boolean; + + /** + * Sets the value of the property. + */ + setPruneSectionsOnEdit(pruneSectionsOnEdit: boolean): void; + + /** + * Gets the value of the property. + */ + getTemplates(): any; + + /** + * Sets the value of the property. + */ + setTemplates(templates: any): void; + + /** + * Gets the value of the property. + */ + getSections(): Titanium.UI.ListSection[]; + + /** + * Sets the value of the property. + */ + setSections(sections: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getDefaultItemTemplate(): string | number; + + /** + * Sets the value of the property. + */ + setDefaultItemTemplate(defaultItemTemplate: string): void; + + /** + * Sets the value of the property. + */ + setDefaultItemTemplate(defaultItemTemplate: number): void; + + /** + * Gets the value of the property. + */ + getSeparatorHeight(): string | number; + + /** + * Sets the value of the property. + */ + setSeparatorHeight(separatorHeight: string): void; + + /** + * Sets the value of the property. + */ + setSeparatorHeight(separatorHeight: number): void; + + /** + * Gets the value of the property. + */ + getFooterDividersEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setFooterDividersEnabled(footerDividersEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getFooterTitle(): string; + + /** + * Sets the value of the property. + */ + setFooterTitle(footerTitle: string): void; + + /** + * Gets the value of the property. + */ + getFooterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setFooterView(footerView: any): void; + + /** + * Gets the value of the property. + */ + getHeaderDividersEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setHeaderDividersEnabled(headerDividersEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getHeaderTitle(): string; + + /** + * Sets the value of the property. + */ + setHeaderTitle(headerTitle: string): void; + + /** + * Gets the value of the property. + */ + getHeaderView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderView(headerView: any): void; + + /** + * Gets the value of the property. + */ + getPullView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setPullView(pullView: any): void; + + /** + * Gets the value of the property. + */ + getRefreshControl(): Titanium.UI.RefreshControl; + + /** + * Sets the value of the property. + */ + setRefreshControl(refreshControl: Titanium.UI.RefreshControl): void; + + /** + * Gets the value of the property. + */ + getSearchView(): Titanium.UI.SearchBar | Titanium.UI.Android.SearchView; + + /** + * Sets the value of the property. + */ + setSearchView(searchView: Titanium.UI.SearchBar): void; + + /** + * Sets the value of the property. + */ + setSearchView(searchView: Titanium.UI.Android.SearchView): void; + + /** + * Gets the value of the property. + */ + getSearchText(): string; + + /** + * Sets the value of the property. + */ + setSearchText(searchText: string): void; + + /** + * Gets the value of the property. + */ + getCaseInsensitiveSearch(): boolean; + + /** + * Sets the value of the property. + */ + setCaseInsensitiveSearch(caseInsensitiveSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getKeepSectionsInSearch(): boolean; + + /** + * Sets the value of the property. + */ + setKeepSectionsInSearch(keepSectionsInSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getKeyboardDismissMode(): number; + + /** + * Sets the value of the property. + */ + setKeyboardDismissMode(keyboardDismissMode: number): void; + + /** + * Gets the value of the property. + */ + getSectionIndexTitles(): ListViewIndexEntry[]; + + /** + * Sets the value of the property. + */ + setSectionIndexTitles(sectionIndexTitles: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getScrollIndicatorStyle(): number; + + /** + * Sets the value of the property. + */ + setScrollIndicatorStyle(scrollIndicatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getWillScrollOnStatusTap(): boolean; + + /** + * Sets the value of the property. + */ + setWillScrollOnStatusTap(willScrollOnStatusTap: boolean): void; + + /** + * Gets the value of the property. + */ + getSectionCount(): number; + + /** + * Gets the value of the property. + */ + getShowVerticalScrollIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setShowVerticalScrollIndicator(showVerticalScrollIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getSeparatorColor(): string; + + /** + * Sets the value of the property. + */ + setSeparatorColor(separatorColor: string): void; + + /** + * Gets the value of the property. + */ + getSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setSeparatorInsets(separatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getSeparatorStyle(): number; + + /** + * Sets the value of the property. + */ + setSeparatorStyle(separatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getTableSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setTableSeparatorInsets(tableSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getListSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setListSeparatorInsets(listSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getRowSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setRowSeparatorInsets(rowSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getDimBackgroundForSearch(): boolean; + + /** + * Sets the value of the property. + */ + setDimBackgroundForSearch(dimBackgroundForSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getResultsBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setResultsBackgroundColor(resultsBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorColor(): string; + + /** + * Sets the value of the property. + */ + setResultsSeparatorColor(resultsSeparatorColor: string): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorStyle(): number; + + /** + * Sets the value of the property. + */ + setResultsSeparatorStyle(resultsSeparatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getResultsSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setResultsSeparatorInsets(resultsSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getSelectedItems(): ListItemEventType[]; + + /** + * Sets the value of the property. + */ + setSelectedItems(selectedItems: ReadonlyArray): void; + + } + + /** + * A control that displays an image composited with a background image or color. + */ + interface MaskedImage extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Image drawn as the background image. + */ + mask: string; + + /** + * Image drawn as the Foreground image. + */ + image: string; + + /** + * Blend mode to use to combine layers. + */ + mode: number; + + /** + * Color to combine with the image, as a color name or hex triplet. + */ + tint: string; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getMask(): string; + + /** + * Sets the value of the property. + */ + setMask(mask: string): void; + + /** + * Gets the value of the property. + */ + getImage(): string; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Gets the value of the property. + */ + getMode(): number; + + /** + * Sets the value of the property. + */ + setMode(mode: number): void; + + /** + * Gets the value of the property. + */ + getTint(): string; + + /** + * Sets the value of the property. + */ + setTint(tint: string): void; + + } + + /** + * A toast notification. + */ + interface Notification extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Notification text to display. + */ + message: string; + + /** + * Determines how long the notification stays on screen. + */ + duration: number; + + /** + * Determines the location at which the notification should appear on the screen. + */ + gravity: number; + + /** + * X offset from the default position, in pixels. + */ + xOffset: number; + + /** + * Y offset from the default position, in pixels. + */ + yOffset: number; + + /** + * Horizontal placement of the notification, *as a fraction of the screen width*. + */ + horizontalMargin: number; + + /** + * Vertical placement of the notifcation, *as a fraction of the screen height*. + */ + verticalMargin: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Show the notification. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getGravity(): number; + + /** + * Sets the value of the property. + */ + setGravity(gravity: number): void; + + /** + * Gets the value of the property. + */ + getXOffset(): number; + + /** + * Sets the value of the property. + */ + setXOffset(xOffset: number): void; + + /** + * Gets the value of the property. + */ + getYOffset(): number; + + /** + * Sets the value of the property. + */ + setYOffset(yOffset: number): void; + + /** + * Gets the value of the property. + */ + getHorizontalMargin(): number; + + /** + * Sets the value of the property. + */ + setHorizontalMargin(horizontalMargin: number): void; + + /** + * Gets the value of the property. + */ + getVerticalMargin(): number; + + /** + * Sets the value of the property. + */ + setVerticalMargin(verticalMargin: number): void; + + } + + /** + * An option dialog is a modal view that includes a message and one or more option items positioned + * in the middle of the display on Android and at the bottom edge on iOS. On Android, buttons may + * be added below the options. + */ + interface OptionDialog extends Titanium.UI.View { + /** + * View to load inside the message area, to create a custom layout. + */ + androidView: Titanium.UI.View; + + /** + * List of button names. + */ + buttonNames: string[]; + + /** + * Index to define the cancel option. + */ + cancel: number; + + /** + * Index to define the destructive option, indicated by a visual cue when rendered. + */ + destructive: number; + + /** + * List of option names to display in the dialog. + */ + options: string[]; + + /** + * Boolean value indicating if the option dialog should have an opaque background. + */ + opaquebackground: boolean; + + /** + * Boolean value indicating if the option dialog should only be cancelled by user gesture or by hide method. + */ + persistent: boolean; + + /** + * Defines the default selected option. + */ + selectedIndex: number; + + /** + * Title of the dialog. + */ + title: string; + + /** + * Key identifying a string in the locale file to use for the title text. + */ + titleid: string; + + /** + * Gets the value of the property. + */ + getAndroidView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setAndroidView(androidView: any): void; + + /** + * Gets the value of the property. + */ + getButtonNames(): string[]; + + /** + * Sets the value of the property. + */ + setButtonNames(buttonNames: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCancel(): number; + + /** + * Sets the value of the property. + */ + setCancel(cancel: number): void; + + /** + * Gets the value of the property. + */ + getDestructive(): number; + + /** + * Sets the value of the property. + */ + setDestructive(destructive: number): void; + + /** + * Gets the value of the property. + */ + getOptions(): string[]; + + /** + * Sets the value of the property. + */ + setOptions(options: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOpaquebackground(): boolean; + + /** + * Sets the value of the property. + */ + setOpaquebackground(opaquebackground: boolean): void; + + /** + * Gets the value of the property. + */ + getPersistent(): boolean; + + /** + * Sets the value of the property. + */ + setPersistent(persistent: boolean): void; + + /** + * Gets the value of the property. + */ + getSelectedIndex(): number; + + /** + * Sets the value of the property. + */ + setSelectedIndex(selectedIndex: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + } + + /** + * A control used to select one or more fixed values. + */ + interface Picker extends Titanium.UI.View { + /** + * Columns used for this picker, as an array of objects. + */ + columns: Titanium.UI.PickerColumn[]; + + /** + * Duration in milliseconds used for a Countdown Timer picker. + */ + countDownDuration: number; + + /** + * Sets the text color of date- and time-pickers. + */ + dateTimeColor: string; + + /** + * Determines whether the Time pickers display in 24-hour or 12-hour clock format. + */ + format24: boolean; + + /** + * Locale used when displaying Date and Time picker values. + */ + locale: string; + + /** + * Maximum date displayed when a Date picker is in use. + */ + maxDate: Date; + + /** + * Minimum date displayed when a Date picker is in use. + */ + minDate: Date; + + /** + * Interval in minutes displayed when one of the Time types of pickers is in use. + */ + minuteInterval: number; + + /** + * Determines whether the visual selection indicator is shown. + */ + selectionIndicator: boolean; + + /** + * Determines whether calling the method `setSelectedRow` opens when called + */ + selectionOpens: boolean; + + /** + * Determines the type of picker displayed + */ + type: number; + + /** + * Determines whether the non-native Android control, with a spinning wheel that looks and + * behaves like the iOS picker, is invoked rather than the default native "dropdown" style. + */ + useSpinner: boolean; + + /** + * Creates a native Android control for creating a Time Spinner with Type `Ti.UI.PICKER_TYPE_TIME`. + * This is invoked rather than the default native "dropdown" style. + */ + nativeSpinner: boolean; + + /** + * Date and time value for Date and Time pickers. + */ + value: Date; + + /** + * Number of visible rows to display. This is only applicable to a plain picker and when the + * `useSpinner` is `true`. + */ + visibleItems: number; + + /** + * Determines whether the calenderView is visible. + */ + calendarViewShown: boolean; + + /** + * Font to use for text. + */ + font: Font; + + /** + * Gets the selected row for a column, or `null` if none exists. + */ + getSelectedRow(index: number): Titanium.UI.PickerRow; + + /** + * Repopulates values for a column. + */ + reloadColumn(column: Titanium.UI.PickerColumn): void; + + /** + * Selects a column's row. + */ + setSelectedRow(column: number, row: number, animated?: boolean): void; + + /** + * Sets the date and time value property for Date pickers. + */ + setValue(date: any, suppressEvent: boolean): Titanium.UI.PickerRow; + + /** + * Shows Date picker as a modal dialog. + */ + showDatePickerDialog(dictObj: any): void; + + /** + * Shows Time picker as a modal dialog. + */ + showTimePickerDialog(dictObj: any): void; + + /** + * Gets the value of the property. + */ + getColumns(): Titanium.UI.PickerColumn[]; + + /** + * Sets the value of the property. + */ + setColumns(columns: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCountDownDuration(): number; + + /** + * Sets the value of the property. + */ + setCountDownDuration(countDownDuration: number): void; + + /** + * Gets the value of the property. + */ + getDateTimeColor(): string; + + /** + * Sets the value of the property. + */ + setDateTimeColor(dateTimeColor: string): void; + + /** + * Gets the value of the property. + */ + getFormat24(): boolean; + + /** + * Sets the value of the property. + */ + setFormat24(format24: boolean): void; + + /** + * Gets the value of the property. + */ + getLocale(): string; + + /** + * Sets the value of the property. + */ + setLocale(locale: string): void; + + /** + * Gets the value of the property. + */ + getMaxDate(): Date; + + /** + * Sets the value of the property. + */ + setMaxDate(maxDate: Date): void; + + /** + * Gets the value of the property. + */ + getMinDate(): Date; + + /** + * Sets the value of the property. + */ + setMinDate(minDate: Date): void; + + /** + * Gets the value of the property. + */ + getMinuteInterval(): number; + + /** + * Sets the value of the property. + */ + setMinuteInterval(minuteInterval: number): void; + + /** + * Gets the value of the property. + */ + getSelectionIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setSelectionIndicator(selectionIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getSelectionOpens(): boolean; + + /** + * Sets the value of the property. + */ + setSelectionOpens(selectionOpens: boolean): void; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + /** + * Gets the value of the property. + */ + getUseSpinner(): boolean; + + /** + * Sets the value of the property. + */ + setUseSpinner(useSpinner: boolean): void; + + /** + * Gets the value of the property. + */ + getNativeSpinner(): boolean; + + /** + * Sets the value of the property. + */ + setNativeSpinner(nativeSpinner: boolean): void; + + /** + * Gets the value of the property. + */ + getValue(): Date; + + /** + * Sets the value of the property. + */ + setValue(value: Date): void; + + /** + * Gets the value of the property. + */ + getVisibleItems(): number; + + /** + * Sets the value of the property. + */ + setVisibleItems(visibleItems: number): void; + + /** + * Gets the value of the property. + */ + getCalendarViewShown(): boolean; + + /** + * Sets the value of the property. + */ + setCalendarViewShown(calendarViewShown: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + } + + /** + * A picker column, representing a selectable group of items in a . + */ + interface PickerColumn extends Titanium.UI.View { + /** + * Number of rows in this column. + */ + readonly rowCount: number; + + /** + * Rows of this column. + */ + readonly rows: Titanium.UI.PickerRow[]; + + /** + * Font to use for text. + */ + font: Font; + + /** + * Adds a row to this column. + */ + addRow(row: Titanium.UI.PickerRow): void; + + /** + * Removes a row from this column. + */ + removeRow(row: Titanium.UI.PickerRow): void; + + /** + * Gets the value of the property. + */ + getRowCount(): number; + + /** + * Gets the value of the property. + */ + getRows(): Titanium.UI.PickerRow[]; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + } + + /** + * A picker row, representing a selectable item in a . + */ + interface PickerRow extends Titanium.UI.View { + /** + * Color of the item text, as a color name or hex triplet. + */ + color: string; + + /** + * Font to use for the item text. + */ + font: Font; + + /** + * Item text. + */ + title: string; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + } + + /** + * A progress bar. + */ + interface ProgressBar extends Titanium.UI.View { + /** + * Color of the progress bar message, as a color name or hex triplet. + */ + color: string; + + /** + * Font for the progress bar text. + */ + font: Font; + + /** + * Maximum value of the progress bar. + */ + max: number; + + /** + * Progress bar text. + */ + message: string; + + /** + * The color shown for the portion of the progress bar that is not filled. + */ + trackTintColor: string; + + /** + * Minimum value of the progress bar. + */ + min: number; + + /** + * Style of the progress bar. + */ + style: number; + + /** + * Current value of the progress bar. + */ + value: number; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getMax(): number; + + /** + * Sets the value of the property. + */ + setMax(max: number): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getTrackTintColor(): string; + + /** + * Sets the value of the property. + */ + setTrackTintColor(trackTintColor: string): void; + + /** + * Gets the value of the property. + */ + getMin(): number; + + /** + * Sets the value of the property. + */ + setMin(min: number): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getValue(): number; + + /** + * Sets the value of the property. + */ + setValue(value: number): void; + + } + + /** + * The RefreshControl is a representation of the native iOS + * [UIRefreshControl](https://developer.apple.com/library/ios/documentation/uikit/reference/UIRefreshControl_class/Reference/Reference.html) + * and Android [SwipeRefreshLayout](https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html). + */ + interface RefreshControl extends Titanium.Proxy { + /** + * The attributed title of the control. + */ + title: Titanium.UI.AttributedString; + + /** + * The tint color for the refresh control, as a color name or hex triplet. + */ + tintColor: string; + + /** + * Tells the control that a refresh operation was started programmatically. + */ + beginRefreshing(): void; + + /** + * Tells the control that a refresh operation has ended. + */ + endRefreshing(): void; + + /** + * Gets the value of the property. + */ + getTitle(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setTitle(title: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + } + + /** + * A view that contains a horizontally and/or vertically-scrollable region of content. + */ + interface ScrollView extends Titanium.UI.View { + /** + * Determines whether this scroll view can cancel subview touches in order to scroll instead. + */ + canCancelEvents: boolean; + + /** + * Height of the scrollable region. + */ + contentHeight: number | string; + + /** + * X and Y coordinates to which to reposition the top-left point of the scrollable region. + */ + contentOffset: any; + + /** + * Width of the scrollable region. + */ + contentWidth: number | string; + + /** + * The deceleration rate of the ScrollView. + */ + decelerationRate: number; + + /** + * Determines whether scroll bounce of the scrollable region is enabled. + */ + disableBounce: boolean; + + /** + * Determines whether horizontal scroll bounce of the scrollable region is enabled. + */ + horizontalBounce: boolean; + + /** + * The manner in which the keyboard is dismissed when a drag begins in the scroll view. + */ + keyboardDismissMode: number; + + /** + * Maximum scaling factor of the scrollable region and its content. + */ + maxZoomScale: number; + + /** + * Minimum scaling factor of the scrollable region and its content. + */ + minZoomScale: number; + + /** + * Determines the behavior when the user overscolls the view. + */ + overScrollMode: number; + + /** + * View positioned above the first row that is only revealed when the user drags the scroll view contents down. + */ + refreshControl: Titanium.UI.RefreshControl; + + /** + * Controls whether the scroll-to-top gesture is effective. + */ + scrollsToTop: boolean; + + /** + * Style of the scrollbar. + */ + scrollIndicatorStyle: number; + + /** + * Limits the direction of the scrollable region, overriding the deduced setting. Set to + * `horizontal` or `vertical`. + */ + scrollType: string; + + /** + * Determines whether scrolling is enabled for the view. + */ + scrollingEnabled: boolean; + + /** + * Determines whether the horizontal scroll indicator is visible. + */ + showHorizontalScrollIndicator: boolean; + + /** + * Determines whether the vertical scroll indicator is visible. + */ + showVerticalScrollIndicator: boolean; + + /** + * Determines whether vertical scroll bounce of the scrollable region is enabled. + */ + verticalBounce: boolean; + + /** + * Scaling factor of the scroll view's content. + */ + zoomScale: number; + + /** + * Moves the specified coordinate of the scrollable region into the viewable area. + */ + scrollTo(x: number, y: number, animation?: ScrollViewAnimationProperties): void; + + /** + * Sets the value of the [contentOffset](Titanium.UI.ScrollView.contentOffset) property. + */ + setContentOffset(contentOffset: any, animated?: contentOffsetOption): void; + + /** + * Sets the value of the [zoomScale](Titanium.UI.ScrollView.zoomScale) property. + */ + setZoomScale(zoomScale: number, animated?: zoomScaleOption): void; + + /** + * Moves the end of the scrollable region into the viewable area. + */ + scrollToBottom(): void; + + /** + * Moves the top of the scrollable region into the viewable area. + */ + scrollToTop(): void; + + /** + * Gets the value of the property. + */ + getCanCancelEvents(): boolean; + + /** + * Sets the value of the property. + */ + setCanCancelEvents(canCancelEvents: boolean): void; + + /** + * Gets the value of the property. + */ + getContentHeight(): number | string; + + /** + * Sets the value of the property. + */ + setContentHeight(contentHeight: number): void; + + /** + * Sets the value of the property. + */ + setContentHeight(contentHeight: string): void; + + /** + * Gets the value of the property. + */ + getContentOffset(): any; + + /** + * Sets the value of the property. + */ + setContentOffset(contentOffset: any): void; + + /** + * Gets the value of the property. + */ + getContentWidth(): number | string; + + /** + * Sets the value of the property. + */ + setContentWidth(contentWidth: number): void; + + /** + * Sets the value of the property. + */ + setContentWidth(contentWidth: string): void; + + /** + * Gets the value of the property. + */ + getDecelerationRate(): number; + + /** + * Sets the value of the property. + */ + setDecelerationRate(decelerationRate: number): void; + + /** + * Gets the value of the property. + */ + getDisableBounce(): boolean; + + /** + * Sets the value of the property. + */ + setDisableBounce(disableBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getHorizontalBounce(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalBounce(horizontalBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getKeyboardDismissMode(): number; + + /** + * Sets the value of the property. + */ + setKeyboardDismissMode(keyboardDismissMode: number): void; + + /** + * Gets the value of the property. + */ + getMaxZoomScale(): number; + + /** + * Sets the value of the property. + */ + setMaxZoomScale(maxZoomScale: number): void; + + /** + * Gets the value of the property. + */ + getMinZoomScale(): number; + + /** + * Sets the value of the property. + */ + setMinZoomScale(minZoomScale: number): void; + + /** + * Gets the value of the property. + */ + getOverScrollMode(): number; + + /** + * Sets the value of the property. + */ + setOverScrollMode(overScrollMode: number): void; + + /** + * Gets the value of the property. + */ + getRefreshControl(): Titanium.UI.RefreshControl; + + /** + * Sets the value of the property. + */ + setRefreshControl(refreshControl: Titanium.UI.RefreshControl): void; + + /** + * Gets the value of the property. + */ + getScrollsToTop(): boolean; + + /** + * Sets the value of the property. + */ + setScrollsToTop(scrollsToTop: boolean): void; + + /** + * Gets the value of the property. + */ + getScrollIndicatorStyle(): number; + + /** + * Sets the value of the property. + */ + setScrollIndicatorStyle(scrollIndicatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getScrollType(): string; + + /** + * Sets the value of the property. + */ + setScrollType(scrollType: string): void; + + /** + * Gets the value of the property. + */ + getScrollingEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setScrollingEnabled(scrollingEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getShowHorizontalScrollIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setShowHorizontalScrollIndicator(showHorizontalScrollIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getShowVerticalScrollIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setShowVerticalScrollIndicator(showVerticalScrollIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getVerticalBounce(): boolean; + + /** + * Sets the value of the property. + */ + setVerticalBounce(verticalBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getZoomScale(): number; + + } + + /** + * A view that encapsulates a horizontally-scrolling set of child views, known as pages, navigable + * using its built-in horizontal swipe gestures. + */ + interface ScrollableView extends Titanium.UI.View { + /** + * Number of pages to cache (pre-render). + */ + cacheSize: number; + + /** + * Index of the active page. + */ + currentPage: number; + + /** + * Color for the current page of the paging control, as a color name or hex triplet. + */ + currentPageIndicatorColor: string; + + /** + * Determines whether page bouncing effect is disabled. + */ + disableBounce: boolean; + + /** + * Determines the behavior when the user overscolls the view. + */ + overScrollMode: number; + + /** + * Color of the paging control, as a color name or hex triplet. + */ + pagingControlColor: string; + + /** + * Height of the paging control, in pixels. + */ + pagingControlHeight: number; + + /** + * Color of the paging control, as a color name or hex triplet. + */ + pageIndicatorColor: string; + + /** + * Determines whether the paging control is visible. + */ + showPagingControl: boolean; + + /** + * Number of milliseconds to wait before hiding the paging control. + */ + pagingControlTimeout: number; + + /** + * Alpha value of the paging control. + */ + pagingControlAlpha: number; + + /** + * Determines whether the paging control is displayed at the top or bottom of the view. + */ + pagingControlOnTop: boolean; + + /** + * Determines whether the paging control is added as an overlay to the view. + */ + overlayEnabled: boolean; + + /** + * Determines whether scrolling is enabled for the view. + */ + scrollingEnabled: boolean; + + /** + * Sets the pages within this Scrollable View. + */ + views: Titanium.UI.View[]; + + /** + * Determines whether the previous and next pages are clipped, so that they are not visible + * adjacent to the current page. + */ + clipViews: boolean; + + /** + * Sets the region where this view responds to gestures. + */ + hitRect: Dimension; + + /** + * Inserts views at the specified position in the [views](Titanium.UI.ScrollableView.views) array. + */ + insertViewsAt(position: number, views: any[]): void; + + /** + * Adds a new page to this Scrollable View. + */ + addView(view: any): void; + + /** + * Sets the current page to the next consecutive page in . + */ + moveNext(): void; + + /** + * Sets the current page to the previous consecutive page in . + */ + movePrevious(): void; + + /** + * Removes an existing page from this Scrollable View. + */ + removeView(view: number): void; + + /** + * Removes an existing page from this Scrollable View. + */ + removeView(view: any): void; + + /** + * Scrolls to the specified page in . + */ + scrollToView(view: number): void; + + /** + * Scrolls to the specified page in . + */ + scrollToView(view: any): void; + + /** + * Gets the value of the property. + */ + getCacheSize(): number; + + /** + * Sets the value of the property. + */ + setCacheSize(cacheSize: number): void; + + /** + * Gets the value of the property. + */ + getCurrentPage(): number; + + /** + * Sets the value of the property. + */ + setCurrentPage(currentPage: number): void; + + /** + * Gets the value of the property. + */ + getCurrentPageIndicatorColor(): string; + + /** + * Sets the value of the property. + */ + setCurrentPageIndicatorColor(currentPageIndicatorColor: string): void; + + /** + * Gets the value of the property. + */ + getDisableBounce(): boolean; + + /** + * Sets the value of the property. + */ + setDisableBounce(disableBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getOverScrollMode(): number; + + /** + * Sets the value of the property. + */ + setOverScrollMode(overScrollMode: number): void; + + /** + * Gets the value of the property. + */ + getPagingControlColor(): string; + + /** + * Sets the value of the property. + */ + setPagingControlColor(pagingControlColor: string): void; + + /** + * Gets the value of the property. + */ + getPagingControlHeight(): number; + + /** + * Sets the value of the property. + */ + setPagingControlHeight(pagingControlHeight: number): void; + + /** + * Gets the value of the property. + */ + getPageIndicatorColor(): string; + + /** + * Sets the value of the property. + */ + setPageIndicatorColor(pageIndicatorColor: string): void; + + /** + * Gets the value of the property. + */ + getShowPagingControl(): boolean; + + /** + * Sets the value of the property. + */ + setShowPagingControl(showPagingControl: boolean): void; + + /** + * Gets the value of the property. + */ + getPagingControlTimeout(): number; + + /** + * Sets the value of the property. + */ + setPagingControlTimeout(pagingControlTimeout: number): void; + + /** + * Gets the value of the property. + */ + getPagingControlAlpha(): number; + + /** + * Sets the value of the property. + */ + setPagingControlAlpha(pagingControlAlpha: number): void; + + /** + * Gets the value of the property. + */ + getPagingControlOnTop(): boolean; + + /** + * Sets the value of the property. + */ + setPagingControlOnTop(pagingControlOnTop: boolean): void; + + /** + * Gets the value of the property. + */ + getOverlayEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setOverlayEnabled(overlayEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getScrollingEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setScrollingEnabled(scrollingEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getViews(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setViews(views: any[]): void; + + /** + * Gets the value of the property. + */ + getClipViews(): boolean; + + /** + * Sets the value of the property. + */ + setClipViews(clipViews: boolean): void; + + /** + * Gets the value of the property. + */ + getHitRect(): Dimension; + + /** + * Sets the value of the property. + */ + setHitRect(hitRect: Dimension): void; + + } + + /** + * A specialized text field for entering search text. + */ + interface SearchBar extends Titanium.UI.View { + /** + * Determines how text is capitalized during typing. + */ + autocapitalization: number; + + /** + * Determines whether the text in the search bar is autocorrected during typing. + */ + autocorrect: boolean; + + /** + * Bar color of the search bar view, as a color name or hex triplet. + */ + barColor: string; + + /** + * The title of the cancel button when the search bar field is focused. + */ + cancelButtonTitle: string; + + /** + * Color of the text in this text field, as a color name or hex triplet. + */ + color: string; + + /** + * Text to show when the search bar field is not focused. + */ + hintText: string; + + /** + * Hint text color to display when the field is empty. + */ + hintTextColor: string; + + /** + * Key identifying a string from the locale file to use for the + * [hintText](Titanium.UI.SearchBar.hintText) property. + */ + hinttextid: string; + + /** + * Keyboard type constant to use when the field is focused. + */ + keyboardType: number; + + /** + * Determines the appearance of the keyboard to be displayed the field is focused. + */ + keyboardAppearance: number; + + /** + * Single line of text displayed at the top of the search bar. + */ + prompt: string; + + /** + * Key identifying a string from the locale file to use for the + * [prompt](Titanium.UI.SearchBar.prompt) property. + */ + promptid: string; + + /** + * Determines whether the bookmark button is displayed. + */ + showBookmark: boolean; + + /** + * Determines whether the cancel button is displayed. + */ + showCancel: boolean; + + /** + * Determines the style of the search bar. + */ + style: number; + + /** + * Value of the search bar. + */ + value: string; + + /** + * Causes the search bar to lose focus. + */ + blur(): void; + + /** + * Causes the search bar to gain focus. + */ + focus(): void; + + /** + * Shows or hides the cancel button. + */ + setShowCancel(showCancel: boolean, animated?: any): void; + + /** + * Gets the value of the property. + */ + getAutocapitalization(): number; + + /** + * Sets the value of the property. + */ + setAutocapitalization(autocapitalization: number): void; + + /** + * Gets the value of the property. + */ + getAutocorrect(): boolean; + + /** + * Sets the value of the property. + */ + setAutocorrect(autocorrect: boolean): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getCancelButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setCancelButtonTitle(cancelButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getHintTextColor(): string; + + /** + * Sets the value of the property. + */ + setHintTextColor(hintTextColor: string): void; + + /** + * Gets the value of the property. + */ + getHinttextid(): string; + + /** + * Sets the value of the property. + */ + setHinttextid(hinttextid: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setKeyboardType(keyboardType: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardAppearance(): number; + + /** + * Sets the value of the property. + */ + setKeyboardAppearance(keyboardAppearance: number): void; + + /** + * Gets the value of the property. + */ + getPrompt(): string; + + /** + * Sets the value of the property. + */ + setPrompt(prompt: string): void; + + /** + * Gets the value of the property. + */ + getPromptid(): string; + + /** + * Sets the value of the property. + */ + setPromptid(promptid: string): void; + + /** + * Gets the value of the property. + */ + getShowBookmark(): boolean; + + /** + * Sets the value of the property. + */ + setShowBookmark(showBookmark: boolean): void; + + /** + * Gets the value of the property. + */ + getShowCancel(): boolean; + + /** + * Sets the value of the property. + */ + setShowCancel(showCancel: boolean): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + } + + /** + * A slider component with a draggable thumb. + */ + interface Slider extends Titanium.UI.View { + /** + * Image URL of the slider left track when in the disabled state. + */ + disabledLeftTrackImage: string; + + /** + * Image URL of the slider right track when in the disabled state. + */ + disabledRightTrackImage: string; + + /** + * Image URL of the slider thumb when in the disabled state. + */ + disabledThumbImage: string; + + /** + * Boolean to indicate the enabled state of the slider. + */ + enabled: boolean; + + /** + * Image URL of the slider left track when in the highlighted state. + */ + highlightedLeftTrackImage: string; + + /** + * Image URL of the slider right track when in the highlighted state. + */ + highlightedRightTrackImage: string; + + /** + * Image URL of the slider thumb when in the highlighted state. + */ + highlightedThumbImage: string; + + /** + * Image URL of the slider left track. + */ + leftTrackImage: string; + + /** + * Size of the left end cap for the leftTrackImage, disabledLeftTrackImage, highlightedLeftTrackImage and selectedLeftTrackImage properties. + */ + leftTrackLeftCap: number; + + /** + * Size of the top end cap for the leftTrackImage, disabledLeftTrackImage, highlightedLeftTrackImage and selectedLeftTrackImage properties. + */ + leftTrackTopCap: number; + + /** + * Maximum value of the slider. + */ + max: number; + + /** + * Upper limit on the slider value that can be selected. + */ + maxRange: number; + + /** + * Minimum value of the slider. + */ + min: number; + + /** + * Lower limit on the slider value that can be selected. + */ + minRange: number; + + /** + * Image URL of the slider right track. + */ + rightTrackImage: string; + + /** + * Size of the left end cap for the rightTrackImage, disabledRightTrackImage, highlightedRightTrackImage and selectedRightTrackImage properties. + */ + rightTrackLeftCap: number; + + /** + * Size of the top end cap for the rightTrackImage, disabledRightTrackImage, highlightedRightTrackImage and selectedRightTrackImage properties. + */ + rightTrackTopCap: number; + + /** + * Image URL of the slider left track when in the selected state. + */ + selectedLeftTrackImage: string; + + /** + * Image URL of the slider right track when in the selected state. + */ + selectedRightTrackImage: string; + + /** + * Image URL of the slider thumb when in the selected state. + */ + selectedThumbImage: string; + + /** + * Separates the thumbImage from the slider track. + */ + splitTrack: boolean; + + /** + * Image for the slider thumb. + */ + thumbImage: string | Titanium.Blob; + + /** + * Current value of the slider. + */ + value: string; + + /** + * Sets the [value](Titanium.UI.Slider.value) property. + */ + setValue(value: number, options?: any): void; + + /** + * Gets the value of the property. + */ + getDisabledLeftTrackImage(): string; + + /** + * Sets the value of the property. + */ + setDisabledLeftTrackImage(disabledLeftTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getDisabledRightTrackImage(): string; + + /** + * Sets the value of the property. + */ + setDisabledRightTrackImage(disabledRightTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getDisabledThumbImage(): string; + + /** + * Sets the value of the property. + */ + setDisabledThumbImage(disabledThumbImage: string): void; + + /** + * Gets the value of the property. + */ + getEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setEnabled(enabled: boolean): void; + + /** + * Gets the value of the property. + */ + getHighlightedLeftTrackImage(): string; + + /** + * Sets the value of the property. + */ + setHighlightedLeftTrackImage(highlightedLeftTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getHighlightedRightTrackImage(): string; + + /** + * Sets the value of the property. + */ + setHighlightedRightTrackImage(highlightedRightTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getHighlightedThumbImage(): string; + + /** + * Sets the value of the property. + */ + setHighlightedThumbImage(highlightedThumbImage: string): void; + + /** + * Gets the value of the property. + */ + getLeftTrackImage(): string; + + /** + * Sets the value of the property. + */ + setLeftTrackImage(leftTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getLeftTrackLeftCap(): number; + + /** + * Sets the value of the property. + */ + setLeftTrackLeftCap(leftTrackLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getLeftTrackTopCap(): number; + + /** + * Sets the value of the property. + */ + setLeftTrackTopCap(leftTrackTopCap: number): void; + + /** + * Gets the value of the property. + */ + getMax(): number; + + /** + * Sets the value of the property. + */ + setMax(max: number): void; + + /** + * Gets the value of the property. + */ + getMaxRange(): number; + + /** + * Sets the value of the property. + */ + setMaxRange(maxRange: number): void; + + /** + * Gets the value of the property. + */ + getMin(): number; + + /** + * Sets the value of the property. + */ + setMin(min: number): void; + + /** + * Gets the value of the property. + */ + getMinRange(): number; + + /** + * Sets the value of the property. + */ + setMinRange(minRange: number): void; + + /** + * Gets the value of the property. + */ + getRightTrackImage(): string; + + /** + * Sets the value of the property. + */ + setRightTrackImage(rightTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getRightTrackLeftCap(): number; + + /** + * Sets the value of the property. + */ + setRightTrackLeftCap(rightTrackLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getRightTrackTopCap(): number; + + /** + * Sets the value of the property. + */ + setRightTrackTopCap(rightTrackTopCap: number): void; + + /** + * Gets the value of the property. + */ + getSelectedLeftTrackImage(): string; + + /** + * Sets the value of the property. + */ + setSelectedLeftTrackImage(selectedLeftTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getSelectedRightTrackImage(): string; + + /** + * Sets the value of the property. + */ + setSelectedRightTrackImage(selectedRightTrackImage: string): void; + + /** + * Gets the value of the property. + */ + getSelectedThumbImage(): string; + + /** + * Sets the value of the property. + */ + setSelectedThumbImage(selectedThumbImage: string): void; + + /** + * Gets the value of the property. + */ + getSplitTrack(): boolean; + + /** + * Sets the value of the property. + */ + setSplitTrack(splitTrack: boolean): void; + + /** + * Gets the value of the property. + */ + getThumbImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setThumbImage(thumbImage: string): void; + + /** + * Sets the value of the property. + */ + setThumbImage(thumbImage: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + } + + /** + * An on/off switch control. + */ + interface Switch extends Titanium.UI.View { + /** + * Determines if there is animation when the switch value changes. + */ + animated: boolean; + + /** + * Color to use for switch text, as a color name or hex triplet. + */ + color: string; + + /** + * Determines whether the switch is enabled. + */ + enabled: boolean; + + /** + * Font to use for the switch text. + */ + font: Font; + + /** + * Style of the switch. + */ + style: number; + + /** + * Horizontal text alignment of the switch title. + */ + textAlign: string | number; + + /** + * Text to display next to the switch, when the checkbox style is in use. + */ + title: string; + + /** + * Text to display on the switch in its "off" state, when the toggle button style is in use. + */ + titleOff: string; + + /** + * Text to display on the switch in its "on" state, when the toggle button style is in use. + */ + titleOn: string; + + /** + * The color used to tint the appearance of the switch when it is turned on. + */ + onTintColor: string; + + /** + * The color used to tint the appearance of the thumb. + */ + thumbTintColor: string; + + /** + * Indicates whether the switch has been turned on or off by the user. May also be set + * programmatically. + */ + value: boolean; + + /** + * Vertical alignment for the text field. + */ + verticalAlign: number | string; + + /** + * Gets the value of the property. + */ + getAnimated(): boolean; + + /** + * Sets the value of the property. + */ + setAnimated(animated: boolean): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setEnabled(enabled: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleOff(): string; + + /** + * Sets the value of the property. + */ + setTitleOff(titleOff: string): void; + + /** + * Gets the value of the property. + */ + getTitleOn(): string; + + /** + * Sets the value of the property. + */ + setTitleOn(titleOn: string): void; + + /** + * Gets the value of the property. + */ + getOnTintColor(): string; + + /** + * Sets the value of the property. + */ + setOnTintColor(onTintColor: string): void; + + /** + * Gets the value of the property. + */ + getThumbTintColor(): string; + + /** + * Sets the value of the property. + */ + setThumbTintColor(thumbTintColor: string): void; + + /** + * Gets the value of the property. + */ + getValue(): boolean; + + /** + * Sets the value of the property. + */ + setValue(value: boolean): void; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + } + + /** + * A tab instance for a [TabGroup](Titanium.UI.TabGroup). + */ + interface Tab extends Titanium.UI.View { + /** + * `true` if this tab is active, `false` if it is not. + */ + active: boolean; + + /** + * Icon URL for this tab when active. + */ + activeIcon: string; + + /** + * Badge value for this tab. `null` indicates no badge. + */ + badge: string; + + /** + * If this item displays a badge, this color will be used for the badge's background. + * If set to null, the default background color will be used instead. + */ + badgeColor: string; + + /** + * Icon URL for this tab. + */ + icon: string; + + /** + * The icon inset or outset for each edge. + */ + iconInsets: TabIconInsets; + + /** + * Defines if the icon property of the tab must be used as a mask. This property is applicable on iOS 7 and greater. + */ + iconIsMask: boolean; + + /** + * Defines if the active icon property of the tab must be used as a mask. This property is applicable on iOS 7 and greater. + */ + activeIconIsMask: boolean; + + /** + * Title for this tab. + */ + title: string; + + /** + * Key identifying a string from the locale file to use for the tab title. Only one of `title` or `titleid` should be specified. + */ + titleid: string; + + /** + * Defines the color of the title of tab when it's inactive. + */ + titleColor: string; + + /** + * Defines the color of the title of tab when it's active. + */ + activeTitleColor: string; + + /** + * Root-level tab window. All tabs must have at least one root-level tab window. + */ + window: Titanium.UI.Window; + + /** + * Opens a new window. + */ + open(window: Titanium.UI.Window, options?: any): void; + + /** + * Closes the top-level window for this tab. + */ + close(window: Titanium.UI.Window, options?: any): void; + + /** + * Sets the root window that appears in the tab. + */ + setWindow(window: Titanium.UI.Window): void; + + /** + * Closes all windows that are currently opened inside the tab. + */ + popToRootWindow(options: any): void; + + /** + * Gets the value of the property. + */ + getActive(): boolean; + + /** + * Sets the value of the property. + */ + setActive(active: boolean): void; + + /** + * Gets the value of the property. + */ + getActiveIcon(): string; + + /** + * Sets the value of the property. + */ + setActiveIcon(activeIcon: string): void; + + /** + * Gets the value of the property. + */ + getBadge(): string; + + /** + * Sets the value of the property. + */ + setBadge(badge: string): void; + + /** + * Gets the value of the property. + */ + getBadgeColor(): string; + + /** + * Sets the value of the property. + */ + setBadgeColor(badgeColor: string): void; + + /** + * Gets the value of the property. + */ + getIcon(): string; + + /** + * Sets the value of the property. + */ + setIcon(icon: string): void; + + /** + * Gets the value of the property. + */ + getIconInsets(): TabIconInsets; + + /** + * Sets the value of the property. + */ + setIconInsets(iconInsets: TabIconInsets): void; + + /** + * Gets the value of the property. + */ + getIconIsMask(): boolean; + + /** + * Sets the value of the property. + */ + setIconIsMask(iconIsMask: boolean): void; + + /** + * Gets the value of the property. + */ + getActiveIconIsMask(): boolean; + + /** + * Sets the value of the property. + */ + setActiveIconIsMask(activeIconIsMask: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getTitleColor(): string; + + /** + * Sets the value of the property. + */ + setTitleColor(titleColor: string): void; + + /** + * Gets the value of the property. + */ + getActiveTitleColor(): string; + + /** + * Sets the value of the property. + */ + setActiveTitleColor(activeTitleColor: string): void; + + /** + * Gets the value of the property. + */ + getWindow(): Titanium.UI.Window; + + } + + /** + * A tabbed group of windows. + */ + interface TabGroup extends Titanium.UI.View { + /** + * Active tab. + */ + activeTab: Titanium.UI.Tab; + + /** + * Reference to the Android Activity object associated with this tab group. + */ + readonly activity: Titanium.Android.Activity; + + /** + * Allow the user to reorder tabs in the tab group using the **Edit** button on the **More** + * tab. + */ + allowUserCustomization: boolean; + + /** + * Default navigation bar color (typically for the **More** tab), as a color name or hex triplet. + */ + barColor: string; + + /** + * Boolean value indicating if the nav bar (typically for the **More** tab), is translucent. + */ + translucent: boolean; + + /** + * Title text attributes of the window to be applied on the **More** tab. + */ + titleAttributes: titleAttributesParams; + + /** + * The tintColor to apply to the navigation bar (typically for the **More** tab). + */ + navTintColor: string; + + /** + * Title for the edit button on the **More** tab. + */ + editButtonTitle: string; + + /** + * Boolean value indicating if the application should exit when closing the tab group, whether via Android + * back button or the [close](Titanium.UI.TabGroup.close) method. + */ + exitOnClose: boolean; + + /** + * Boolean value indicating if tab navigation can be done by swipes, in addition to tab clicks. + */ + swipeable: boolean; + + /** + * Boolean value indicating if changing pages by tab clicks is animated. + */ + smoothScrollOnTabClick: boolean; + + /** + * Tabs managed by the tab group. + */ + tabs: Titanium.UI.Tab[]; + + /** + * Determines how the tab group is treated when a soft input method (such as a virtual keyboard) + * is displayed. + */ + windowSoftInputMode: number; + + /** + * Default background color for inactive tabs, as a color name or hex triplet. + */ + tabsBackgroundColor: string; + + /** + * The tintColor to apply to the tabs. + */ + tabsTintColor: string; + + /** + * A Boolean value that indicates whether the tab bar is translucent. + */ + tabsTranslucent: boolean; + + /** + * Title for this tabGroup. + */ + title: string; + + /** + * Default background image for tabs. + */ + tabsBackgroundImage: string; + + /** + * Unselected items in this tab group will be tinted with this color. Setting this value to null + * indicates that the tab group should use its default value instead. + */ + unselectedItemTintColor: string; + + /** + * Image of the shadow placed between the tab bar and the content area. + */ + shadowImage: string; + + /** + * Color applied to active tabs icons, as a color name or hex triplet, where the tab's activeIcon was not defined. + */ + activeTabIconTint: string; + + /** + * Default background selected color for tabs, as a color name or hex triplet. + */ + tabsBackgroundSelectedColor: string; + + /** + * Default background image for the active tab. + */ + activeTabBackgroundImage: string; + + /** + * Adds a tab to the tab group. + */ + addTab(tab: Titanium.UI.Tab): void; + + /** + * Closes the tab group and removes it from the UI. + */ + close(): void; + + /** + * Disable (or re-enable) tab navigation. If tab navigation is disabled, the tabs are hidden and + * the last selected tab window is shown. + */ + disableTabNavigation(disable: boolean): void; + + /** + * Gets the currently-active tab. + */ + getActiveTab(): Titanium.UI.Tab; + + /** + * Opens the tab group and makes it visible. + */ + open(): void; + + /** + * Removes a tab from the tab group. + */ + removeTab(tab: Titanium.UI.Tab): void; + + /** + * Selects the currently active tab in a tab group. + */ + setActiveTab(indexOrObject: number): void; + + /** + * Selects the currently active tab in a tab group. + */ + setActiveTab(indexOrObject: Titanium.UI.Tab): void; + + /** + * Gets all tabs that are managed by the tab group. + */ + getTabs(): Titanium.UI.Tab[]; + + /** + * Gets the value of the property. + */ + getActiveTab(): Titanium.UI.Tab; + + /** + * Sets the value of the property. + */ + setActiveTab(activeTab: Titanium.UI.Tab): void; + + /** + * Gets the value of the property. + */ + getActivity(): Titanium.Android.Activity; + + /** + * Gets the value of the property. + */ + getAllowUserCustomization(): boolean; + + /** + * Sets the value of the property. + */ + setAllowUserCustomization(allowUserCustomization: boolean): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getNavTintColor(): string; + + /** + * Sets the value of the property. + */ + setNavTintColor(navTintColor: string): void; + + /** + * Gets the value of the property. + */ + getEditButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setEditButtonTitle(editButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getExitOnClose(): boolean; + + /** + * Sets the value of the property. + */ + setExitOnClose(exitOnClose: boolean): void; + + /** + * Gets the value of the property. + */ + getSwipeable(): boolean; + + /** + * Sets the value of the property. + */ + setSwipeable(swipeable: boolean): void; + + /** + * Gets the value of the property. + */ + getSmoothScrollOnTabClick(): boolean; + + /** + * Sets the value of the property. + */ + setSmoothScrollOnTabClick(smoothScrollOnTabClick: boolean): void; + + /** + * Gets the value of the property. + */ + getTabs(): Titanium.UI.Tab[]; + + /** + * Sets the value of the property. + */ + setTabs(tabs: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getWindowSoftInputMode(): number; + + /** + * Sets the value of the property. + */ + setWindowSoftInputMode(windowSoftInputMode: number): void; + + /** + * Gets the value of the property. + */ + getTabsBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setTabsBackgroundColor(tabsBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getTabsTintColor(): string; + + /** + * Sets the value of the property. + */ + setTabsTintColor(tabsTintColor: string): void; + + /** + * Gets the value of the property. + */ + getTabsTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTabsTranslucent(tabsTranslucent: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTabsBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setTabsBackgroundImage(tabsBackgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getUnselectedItemTintColor(): string; + + /** + * Sets the value of the property. + */ + setUnselectedItemTintColor(unselectedItemTintColor: string): void; + + /** + * Gets the value of the property. + */ + getShadowImage(): string; + + /** + * Sets the value of the property. + */ + setShadowImage(shadowImage: string): void; + + /** + * Gets the value of the property. + */ + getActiveTabIconTint(): string; + + /** + * Sets the value of the property. + */ + setActiveTabIconTint(activeTabIconTint: string): void; + + /** + * Gets the value of the property. + */ + getTabsBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setTabsBackgroundSelectedColor(tabsBackgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getActiveTabBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setActiveTabBackgroundImage(activeTabBackgroundImage: string): void; + + } + + /** + * A button bar that maintains a selected state. + */ + interface TabbedBar extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Index of the currently selected button. + */ + index: number; + + /** + * Array of labels for the tabbed bar. + */ + labels: string[] | BarItemType[]; + + /** + * Style of the tabbed bar. + */ + style: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getIndex(): number; + + /** + * Sets the value of the property. + */ + setIndex(index: number): void; + + /** + * Gets the value of the property. + */ + getLabels(): string[] | BarItemType[]; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * A table view is used to present information, organized in sections and rows, in a + * vertically-scrolling view. + */ + interface TableView extends Titanium.UI.View { + /** + * Determines whether this table's rows can be selected. + */ + allowsSelection: boolean; + + /** + * Determines whether this table's rows can be selected while editing the table. + */ + allowsSelectionDuringEditing: boolean; + + /** + * Rows of the table view. + */ + data: Titanium.UI.TableViewRow[] | Titanium.UI.TableViewSection[]; + + /** + * Determines the rows' default editable behavior, which allows them to be deleted by the user + * when the table is in `editing` or `moving` mode. + */ + editable: boolean; + + /** + * Determines whether row editing mode is active. + */ + editing: boolean; + + /** + * Filter attribute to be used when searching. + */ + filterAttribute: string; + + /** + * Determines whether the search is limited to the start of the string + */ + filterAnchored: boolean; + + /** + * Determines whether the search is case insensitive. + */ + filterCaseInsensitive: boolean; + + /** + * When set to false, the ListView will not draw the divider before the footer view. + */ + footerDividersEnabled: boolean; + + /** + * Table view footer title. + */ + footerTitle: string; + + /** + * Max number of row class names. + */ + maxClassname: number; + + /** + * View positioned above the first row that is only revealed when the user drags the table + * contents down. + */ + headerPullView: Titanium.UI.View; + + /** + * View positioned above the first row that is only revealed when the user drags the list view contents down. + */ + refreshControl: Titanium.UI.RefreshControl; + + /** + * Determines whether the search field should hide on completion. + */ + hideSearchOnSelection: boolean; + + /** + * Table view footer as a view that will be rendered instead of a label. + */ + footerView: Titanium.UI.View; + + /** + * When set to false, the ListView will not draw the divider after the header view. + */ + headerDividersEnabled: boolean; + + /** + * Table view header title. + */ + headerTitle: string; + + /** + * Table view header as a view that will be rendered instead of a label. + */ + headerView: Titanium.UI.View; + + /** + * Array of objects (with `title` and `index` properties) to control the table view index. + */ + index: TableViewIndexEntry[]; + + /** + * Maximum row height for table view rows. + */ + maxRowHeight: number; + + /** + * Minimum row height for table view rows. + */ + minRowHeight: number; + + /** + * Determines the rows' default moveable behavior, which allows them to be re-ordered by the + * user when the table is in `editing` or `moving` mode. + */ + moveable: boolean; + + /** + * Determines whether row moving mode is active. + */ + moving: boolean; + + /** + * Determines the behavior when the user overscrolls the view. + */ + overScrollMode: number; + + /** + * Default row height for table view rows. + */ + rowHeight: number; + + /** + * If `true`, the tableview can be scrolled. + */ + scrollable: boolean; + + /** + * Style of the scrollbar. + */ + scrollIndicatorStyle: number; + + /** + * Controls whether the scroll-to-top gesture is effective. + */ + scrollsToTop: boolean; + + /** + * Search field to use for the table view. + */ + search: Titanium.UI.SearchBar | Titanium.UI.Android.SearchView; + + /** + * A Boolean indicating whether the underlying content is dimmed during a search. + */ + dimBackgroundForSearch: boolean; + + /** + * Determines whether the [SearchBar](Titanium.UI.SearchBar) or [SearchView](Titanium.UI.Android.SearchView) appears as part of the TableView. + */ + searchAsChild: boolean; + + /** + * Determines whether the search field is visible. + */ + searchHidden: boolean; + + /** + * Number of sections in this table view. + */ + readonly sectionCount: number; + + /** + * Sections of this table. + */ + sections: Titanium.UI.TableViewSection[]; + + /** + * Separator line color between rows, as a color name or hex triplet. + */ + separatorColor: string; + + /** + * The insets for table view separators (applies to all cells). This property is applicable on iOS 7 and greater. + */ + separatorInsets: any; + + /** + * The insets for the table view header and footer. This property is applicable on iOS 7 and greater. + */ + tableSeparatorInsets: any; + + /** + * The insets for table view cells (applies to all cells). This property is applicable on iOS 7 and greater. + */ + rowSeparatorInsets: any; + + /** + * Separator style constant. + */ + separatorStyle: number; + + /** + * Determines whether this table view displays a vertical scroll indicator. + */ + showVerticalScrollIndicator: boolean; + + /** + * Style of the table view, specified using one of the constants from + * . + */ + style: number; + + /** + * Appends a single row or an array of rows to the end of the table. + */ + appendRow(row: any, animation?: TableViewAnimationProperties): void; + + /** + * Appends a single section or an array of sections to the end of the table. + */ + appendSection(section: any, animation?: TableViewAnimationProperties): void; + + /** + * Deletes an existing row. + */ + deleteRow(row: number, animation?: TableViewAnimationProperties): void; + + /** + * Deletes an existing row. + */ + deleteRow(row: Titanium.UI.TableViewRow, animation?: TableViewAnimationProperties): void; + + /** + * Deletes an existing section. + */ + deleteSection(section: number, animation?: TableViewAnimationProperties): void; + + /** + * Programmatically deselects a row. + */ + deselectRow(row: number): void; + + /** + * Inserts a row after another row. + */ + insertRowAfter(index: number, row: any, animation?: TableViewAnimationProperties): void; + + /** + * Inserts a section after another section. + */ + insertSectionAfter(index: number, section: any, animation?: TableViewAnimationProperties): void; + + /** + * Inserts a row before another row. + */ + insertRowBefore(index: number, row: any, animation?: TableViewAnimationProperties): void; + + /** + * Inserts a section before another section. + */ + insertSectionBefore(index: number, section: any, animation?: TableViewAnimationProperties): void; + + /** + * Scrolls the table view to ensure that the specified row is on screen. + */ + scrollToIndex(index: number, animation?: TableViewAnimationProperties): void; + + /** + * Scrolls the table to a specific top position where 0 is the topmost y position in the + * table view. + */ + scrollToTop(top: number, animation?: TableViewAnimationProperties): void; + + /** + * Sets this tableview's content insets. + */ + setContentInsets(edgeInsets: TableViewEdgeInsets, animated?: TableViewContentInsetOption): void; + + /** + * Sets the value of the content offset of the table view without animation by default. + */ + setContentOffset(contentOffset: any): void; + + /** + * Programmatically selects a row. In Android, it sets the currently selected item. If in touch mode, + * the item will not be selected but it will still be positioned appropriately. If the specified + * selection position is less than 0, then the item at position 0 will be selected. + */ + selectRow(row: number): void; + + /** + * Sets the data in the table. + */ + setData(data: any, animation: TableViewAnimationProperties): void; + + /** + * Sets the value of the [Titanium.UI.TableView.headerPullView] property. + */ + setHeaderPullView(view: any): void; + + /** + * Updates an existing row, optionally with animation. + */ + updateRow(index: number, row: Titanium.UI.TableViewRow, animation: TableViewAnimationProperties): void; + + /** + * Updates an existing section, optionally with animation. + */ + updateSection(index: number, section: Titanium.UI.TableViewSection, animation: TableViewAnimationProperties): void; + + /** + * Gets the value of the property. + */ + getAllowsSelection(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsSelection(allowsSelection: boolean): void; + + /** + * Gets the value of the property. + */ + getAllowsSelectionDuringEditing(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsSelectionDuringEditing(allowsSelectionDuringEditing: boolean): void; + + /** + * Gets the value of the property. + */ + getData(): Titanium.UI.TableViewRow[] | Titanium.UI.TableViewSection[]; + + /** + * Sets the value of the property. + */ + setData(data: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setData(data: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getEditing(): boolean; + + /** + * Sets the value of the property. + */ + setEditing(editing: boolean): void; + + /** + * Gets the value of the property. + */ + getFilterAttribute(): string; + + /** + * Sets the value of the property. + */ + setFilterAttribute(filterAttribute: string): void; + + /** + * Gets the value of the property. + */ + getFilterAnchored(): boolean; + + /** + * Sets the value of the property. + */ + setFilterAnchored(filterAnchored: boolean): void; + + /** + * Gets the value of the property. + */ + getFilterCaseInsensitive(): boolean; + + /** + * Sets the value of the property. + */ + setFilterCaseInsensitive(filterCaseInsensitive: boolean): void; + + /** + * Gets the value of the property. + */ + getFooterDividersEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setFooterDividersEnabled(footerDividersEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getFooterTitle(): string; + + /** + * Sets the value of the property. + */ + setFooterTitle(footerTitle: string): void; + + /** + * Gets the value of the property. + */ + getMaxClassname(): number; + + /** + * Sets the value of the property. + */ + setMaxClassname(maxClassname: number): void; + + /** + * Gets the value of the property. + */ + getHeaderPullView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderPullView(headerPullView: any): void; + + /** + * Gets the value of the property. + */ + getRefreshControl(): Titanium.UI.RefreshControl; + + /** + * Sets the value of the property. + */ + setRefreshControl(refreshControl: Titanium.UI.RefreshControl): void; + + /** + * Gets the value of the property. + */ + getHideSearchOnSelection(): boolean; + + /** + * Sets the value of the property. + */ + setHideSearchOnSelection(hideSearchOnSelection: boolean): void; + + /** + * Gets the value of the property. + */ + getFooterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setFooterView(footerView: any): void; + + /** + * Gets the value of the property. + */ + getHeaderDividersEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setHeaderDividersEnabled(headerDividersEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getHeaderTitle(): string; + + /** + * Sets the value of the property. + */ + setHeaderTitle(headerTitle: string): void; + + /** + * Gets the value of the property. + */ + getHeaderView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderView(headerView: any): void; + + /** + * Gets the value of the property. + */ + getIndex(): TableViewIndexEntry[]; + + /** + * Sets the value of the property. + */ + setIndex(index: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getMaxRowHeight(): number; + + /** + * Sets the value of the property. + */ + setMaxRowHeight(maxRowHeight: number): void; + + /** + * Gets the value of the property. + */ + getMinRowHeight(): number; + + /** + * Sets the value of the property. + */ + setMinRowHeight(minRowHeight: number): void; + + /** + * Gets the value of the property. + */ + getMoveable(): boolean; + + /** + * Sets the value of the property. + */ + setMoveable(moveable: boolean): void; + + /** + * Gets the value of the property. + */ + getMoving(): boolean; + + /** + * Sets the value of the property. + */ + setMoving(moving: boolean): void; + + /** + * Gets the value of the property. + */ + getOverScrollMode(): number; + + /** + * Sets the value of the property. + */ + setOverScrollMode(overScrollMode: number): void; + + /** + * Gets the value of the property. + */ + getRowHeight(): number; + + /** + * Sets the value of the property. + */ + setRowHeight(rowHeight: number): void; + + /** + * Gets the value of the property. + */ + getScrollable(): boolean; + + /** + * Sets the value of the property. + */ + setScrollable(scrollable: boolean): void; + + /** + * Gets the value of the property. + */ + getScrollIndicatorStyle(): number; + + /** + * Sets the value of the property. + */ + setScrollIndicatorStyle(scrollIndicatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getScrollsToTop(): boolean; + + /** + * Sets the value of the property. + */ + setScrollsToTop(scrollsToTop: boolean): void; + + /** + * Gets the value of the property. + */ + getSearch(): Titanium.UI.SearchBar | Titanium.UI.Android.SearchView; + + /** + * Sets the value of the property. + */ + setSearch(search: Titanium.UI.SearchBar): void; + + /** + * Sets the value of the property. + */ + setSearch(search: Titanium.UI.Android.SearchView): void; + + /** + * Gets the value of the property. + */ + getDimBackgroundForSearch(): boolean; + + /** + * Sets the value of the property. + */ + setDimBackgroundForSearch(dimBackgroundForSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getSearchAsChild(): boolean; + + /** + * Sets the value of the property. + */ + setSearchAsChild(searchAsChild: boolean): void; + + /** + * Gets the value of the property. + */ + getSearchHidden(): boolean; + + /** + * Sets the value of the property. + */ + setSearchHidden(searchHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getSectionCount(): number; + + /** + * Gets the value of the property. + */ + getSections(): Titanium.UI.TableViewSection[]; + + /** + * Sets the value of the property. + */ + setSections(sections: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSeparatorColor(): string; + + /** + * Sets the value of the property. + */ + setSeparatorColor(separatorColor: string): void; + + /** + * Gets the value of the property. + */ + getSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setSeparatorInsets(separatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getTableSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setTableSeparatorInsets(tableSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getRowSeparatorInsets(): any; + + /** + * Sets the value of the property. + */ + setRowSeparatorInsets(rowSeparatorInsets: any): void; + + /** + * Gets the value of the property. + */ + getSeparatorStyle(): number; + + /** + * Sets the value of the property. + */ + setSeparatorStyle(separatorStyle: number): void; + + /** + * Gets the value of the property. + */ + getShowVerticalScrollIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setShowVerticalScrollIndicator(showVerticalScrollIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * A table view row is an individual item in a table, organized into table view sections. + */ + interface TableViewRow extends Titanium.UI.View { + /** + * Class name for the row. + */ + className: string; + + /** + * Default text color of the row when not selected, as a color name or hex triplet. + */ + color: string; + + /** + * Text to display on the delete button when editable is enabled + */ + deleteButtonTitle: string; + + /** + * Determines the rows' editable behavior, which allows them to be deleted by the user when the + * table is in `editing` or `moving` mode. + */ + editable: boolean; + + /** + * Font to use for the row title. + */ + font: Font; + + /** + * The footer title of the row. + */ + footer: string; + + /** + * Determines whether a system-provided checkmark is displayed on the right-hand side of + * the row. + */ + hasCheck: boolean; + + /** + * Determines whether a system-provided arrow is displayed on the right-hand side of the row. + */ + hasChild: boolean; + + /** + * Determines whether a system-provided detail disclosure button is displayed on the right-hand + * side of the row. + */ + hasDetail: boolean; + + /** + * The header title of the row. + */ + header: string; + + /** + * Indention level for the row. + */ + indentionLevel: number; + + /** + * Image to render in the left image area of the row, specified as a local path or URL. + */ + leftImage: string; + + /** + * Determines the rows' moveable behavior, which allows them to be re-ordered by the user when + * the table is in `editing` or `moving` mode. + */ + moveable: boolean; + + /** + * Image to render in the right image area of the row, specified as a local path or URL. + */ + rightImage: string; + + /** + * Background color to render when the row is selected, as a color name or hex triplet. + */ + selectedBackgroundColor: string; + + /** + * Background image to render when the row is selected. + */ + selectedBackgroundImage: string; + + /** + * Color of the row text when the row is selected, as a color name or hex triplet. + */ + selectedColor: string; + + /** + * Selection style constant to control the selection color. + */ + selectionStyle: number; + + /** + * Text to display on the row. + */ + title: string; + + /** + * Gets the value of the property. + */ + getClassName(): string; + + /** + * Sets the value of the property. + */ + setClassName(className: string): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getDeleteButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setDeleteButtonTitle(deleteButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getFooter(): string; + + /** + * Sets the value of the property. + */ + setFooter(footer: string): void; + + /** + * Gets the value of the property. + */ + getHasCheck(): boolean; + + /** + * Sets the value of the property. + */ + setHasCheck(hasCheck: boolean): void; + + /** + * Gets the value of the property. + */ + getHasChild(): boolean; + + /** + * Sets the value of the property. + */ + setHasChild(hasChild: boolean): void; + + /** + * Gets the value of the property. + */ + getHasDetail(): boolean; + + /** + * Sets the value of the property. + */ + setHasDetail(hasDetail: boolean): void; + + /** + * Gets the value of the property. + */ + getHeader(): string; + + /** + * Sets the value of the property. + */ + setHeader(header: string): void; + + /** + * Gets the value of the property. + */ + getIndentionLevel(): number; + + /** + * Sets the value of the property. + */ + setIndentionLevel(indentionLevel: number): void; + + /** + * Gets the value of the property. + */ + getLeftImage(): string; + + /** + * Sets the value of the property. + */ + setLeftImage(leftImage: string): void; + + /** + * Gets the value of the property. + */ + getMoveable(): boolean; + + /** + * Sets the value of the property. + */ + setMoveable(moveable: boolean): void; + + /** + * Gets the value of the property. + */ + getRightImage(): string; + + /** + * Sets the value of the property. + */ + setRightImage(rightImage: string): void; + + /** + * Gets the value of the property. + */ + getSelectedBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedBackgroundColor(selectedBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getSelectedBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setSelectedBackgroundImage(selectedBackgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setSelectedColor(selectedColor: string): void; + + /** + * Gets the value of the property. + */ + getSelectionStyle(): number; + + /** + * Sets the value of the property. + */ + setSelectionStyle(selectionStyle: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + } + + /** + * A table view section is a container within a table used to organize table view rows. + */ + interface TableViewSection extends Titanium.Proxy { + /** + * Title of this section footer. + */ + footerTitle: string; + + /** + * View to use for this section footer. + */ + footerView: Titanium.UI.View; + + /** + * Title of this section header. + */ + headerTitle: string; + + /** + * View to use for this section header. + */ + headerView: Titanium.UI.View; + + /** + * Number of rows in this section. + */ + readonly rowCount: number; + + /** + * Rows in this section. + */ + readonly rows: Titanium.UI.TableViewRow[]; + + /** + * Adds a table view row to this section. + */ + add(row: Titanium.UI.TableViewRow): void; + + /** + * Removes a table view row from this section. + */ + remove(row: Titanium.UI.TableViewRow): void; + + /** + * Returns a row in this section. + */ + rowAtIndex(index: number): Titanium.UI.TableViewRow; + + /** + * Gets the value of the property. + */ + getFooterTitle(): string; + + /** + * Sets the value of the property. + */ + setFooterTitle(footerTitle: string): void; + + /** + * Gets the value of the property. + */ + getFooterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setFooterView(footerView: any): void; + + /** + * Gets the value of the property. + */ + getHeaderTitle(): string; + + /** + * Sets the value of the property. + */ + setHeaderTitle(headerTitle: string): void; + + /** + * Gets the value of the property. + */ + getHeaderView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setHeaderView(headerView: any): void; + + /** + * Gets the value of the property. + */ + getRowCount(): number; + + /** + * Gets the value of the property. + */ + getRows(): Titanium.UI.TableViewRow[]; + + } + + /** + * A multiline text field that supports editing and scrolling. + */ + interface TextArea extends Titanium.UI.View { + /** + * Determines the appearance of the keyboard displayed when this text area is focused. + */ + appearance: number; + + /** + * Determines the appearance of the keyboard displayed when this text area is focused. + */ + keyboardAppearance: number; + + /** + * Hint text attributed string. + */ + attributedHintText: Titanium.UI.AttributedString; + + /** + * TextArea attributed string. + */ + attributedString: Titanium.UI.AttributedString; + + /** + * Determines how text is capitalized during typing. + */ + autocapitalization: number; + + /** + * Determines whether to automatically correct text entered into this text area. + */ + autocorrect: boolean; + + /** + * Sets the autofill type for the text area. + */ + autofillType: string; + + /** + * Automatically convert text to clickable links. + */ + autoLink: number; + + /** + * Determines whether the value of this text area should be cleared when it is focused. + */ + clearOnEdit: boolean; + + /** + * Color of the text in this text area, as a color name or hex triplet. + */ + color: string; + + /** + * Determines whether this field can be edited. + */ + editable: boolean; + + /** + * Determines whether an ellipsis (`...`) should be used to indicate truncated text. + */ + ellipsize: boolean; + + /** + * Determines whether the return key is enabled automatically when there is text in this text + * area. + */ + enableReturnKey: boolean; + + /** + * Font to use for text. + */ + font: Font; + + /** + * Leave some space above the keyboard in landscape mode or not. + */ + fullscreen: boolean; + + /** + * Hint text to display when the field is empty. + */ + hintText: string; + + /** + * Color of hint text that displays when field is empty. + */ + hintTextColor: string; + + /** + * Hint type to display on the text field. + */ + hintType: number; + + /** + * Specifies if the text area should allow user interaction with the given URL in the given range of text. + */ + handleLinks: boolean; + + /** + * Array of toolbar button objects or a [toolbar](Titanium.UI.iOS.Toolbar) to be used when the + * keyboard is displayed. + */ + keyboardToolbar: Titanium.UI.View[] | Titanium.UI.iOS.Toolbar; + + /** + * Color of the keyboard toolbar if keyboardToolbar is an array, as a color name or hex triplet. + */ + keyboardToolbarColor: string; + + /** + * Height of the keyboard toolbar if keyboardToolbar is an array. + */ + keyboardToolbarHeight: number; + + /** + * Keyboard type to display when this text area is focused. + */ + keyboardType: number; + + /** + * Maximum length of text field input. + */ + maxLength: number; + + /** + * Sets the left and right padding of this TextArea. The text will always be vertically centered. + */ + padding: TextAreaPadding; + + /** + * Specifies the text to display on the keyboard `Return` key when this text area is focused. + */ + returnKeyType: number; + + /** + * Controls whether the scroll-to-top gesture is effective. + */ + scrollsToTop: boolean; + + /** + * Determinates if the undo and redo buttons on the left side of the keyboard should be displayed or not. Only valid on iOS9 and above. This property can only be set upon creation. + */ + showUndoRedoActions: boolean; + + /** + * Determines if the return key should be suppressed during text entry. + */ + suppressReturn: boolean; + + /** + * Text alignment within this text area. + * This has no effect on `hintText` when `hintType` is Ti.UI.HINT_TYPE_ANIMATED. + */ + textAlign: string | number; + + /** + * Value of this text area, which may be set programmatically and modified by the user. + */ + value: string; + + /** + * Determines whether this text area can be scrolled. + */ + scrollable: boolean; + + /** + * Returns the currently selected text of the text area. + */ + readonly selection: textAreaSelectedParams; + + /** + * Vertical alignment within this text area. + */ + verticalAlign: number | string; + + /** + * Forces this text area to lose focus. + */ + blur(): void; + + /** + * Forces this text area to gain focus. + */ + focus(): void; + + /** + * Returns `true` if this text area contains text. + */ + hasText(): boolean; + + /** + * Selects the text in range (start, end). + */ + setSelection(start: number, end: number): void; + + /** + * Gets the value of the property. + */ + getAppearance(): number; + + /** + * Sets the value of the property. + */ + setAppearance(appearance: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardAppearance(): number; + + /** + * Sets the value of the property. + */ + setKeyboardAppearance(keyboardAppearance: number): void; + + /** + * Gets the value of the property. + */ + getAttributedHintText(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedHintText(attributedHintText: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAttributedString(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedString(attributedString: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAutocapitalization(): number; + + /** + * Sets the value of the property. + */ + setAutocapitalization(autocapitalization: number): void; + + /** + * Gets the value of the property. + */ + getAutocorrect(): boolean; + + /** + * Sets the value of the property. + */ + setAutocorrect(autocorrect: boolean): void; + + /** + * Gets the value of the property. + */ + getAutofillType(): string; + + /** + * Sets the value of the property. + */ + setAutofillType(autofillType: string): void; + + /** + * Gets the value of the property. + */ + getAutoLink(): number; + + /** + * Sets the value of the property. + */ + setAutoLink(autoLink: number): void; + + /** + * Gets the value of the property. + */ + getClearOnEdit(): boolean; + + /** + * Sets the value of the property. + */ + setClearOnEdit(clearOnEdit: boolean): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getEllipsize(): boolean; + + /** + * Sets the value of the property. + */ + setEllipsize(ellipsize: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableReturnKey(): boolean; + + /** + * Sets the value of the property. + */ + setEnableReturnKey(enableReturnKey: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getHintTextColor(): string; + + /** + * Sets the value of the property. + */ + setHintTextColor(hintTextColor: string): void; + + /** + * Gets the value of the property. + */ + getHintType(): number; + + /** + * Sets the value of the property. + */ + setHintType(hintType: number): void; + + /** + * Gets the value of the property. + */ + getHandleLinks(): boolean; + + /** + * Sets the value of the property. + */ + setHandleLinks(handleLinks: boolean): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbar(): Titanium.UI.View[] | Titanium.UI.iOS.Toolbar; + + /** + * Sets the value of the property. + */ + setKeyboardToolbar(keyboardToolbar: any[]): void; + + /** + * Sets the value of the property. + */ + setKeyboardToolbar(keyboardToolbar: Titanium.UI.iOS.Toolbar): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbarColor(): string; + + /** + * Sets the value of the property. + */ + setKeyboardToolbarColor(keyboardToolbarColor: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbarHeight(): number; + + /** + * Sets the value of the property. + */ + setKeyboardToolbarHeight(keyboardToolbarHeight: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setKeyboardType(keyboardType: number): void; + + /** + * Gets the value of the property. + */ + getMaxLength(): number; + + /** + * Sets the value of the property. + */ + setMaxLength(maxLength: number): void; + + /** + * Gets the value of the property. + */ + getPadding(): TextAreaPadding; + + /** + * Sets the value of the property. + */ + setPadding(padding: TextAreaPadding): void; + + /** + * Gets the value of the property. + */ + getReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setReturnKeyType(returnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getScrollsToTop(): boolean; + + /** + * Sets the value of the property. + */ + setScrollsToTop(scrollsToTop: boolean): void; + + /** + * Gets the value of the property. + */ + getShowUndoRedoActions(): boolean; + + /** + * Sets the value of the property. + */ + setShowUndoRedoActions(showUndoRedoActions: boolean): void; + + /** + * Gets the value of the property. + */ + getSuppressReturn(): boolean; + + /** + * Sets the value of the property. + */ + setSuppressReturn(suppressReturn: boolean): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getScrollable(): boolean; + + /** + * Sets the value of the property. + */ + setScrollable(scrollable: boolean): void; + + /** + * Gets the value of the property. + */ + getSelection(): textAreaSelectedParams; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + } + + /** + * A single line text field. + */ + interface TextField extends Titanium.UI.View { + /** + * Determines the appearance of the keyboard displayed when this field is focused. + */ + appearance: number; + + /** + * Determines the appearance of the keyboard displayed when this field is focused. + */ + keyboardAppearance: number; + + /** + * TextField attributed string. + */ + attributedString: Titanium.UI.AttributedString; + + /** + * Hint text attributed string. + */ + attributedHintText: Titanium.UI.AttributedString; + + /** + * Determines how text is capitalized during typing. + */ + autocapitalization: number; + + /** + * Determines whether to automatically correct text entered into this text field. + */ + autocorrect: boolean; + + /** + * Sets the autofill type for the text field. + */ + autofillType: string; + + /** + * Automatically convert text to clickable links. + */ + autoLink: number; + + /** + * Border style for the field. + */ + borderStyle: number; + + /** + * Determines when the clear button is displayed. + */ + clearButtonMode: number; + + /** + * Determines whether the value of this text field should be cleared when it is focused. + */ + clearOnEdit: boolean; + + /** + * Color of the text in this text field, as a color name or hex triplet. + */ + color: string; + + /** + * Determines whether this field can be edited. + */ + editable: boolean; + + /** + * Determines whether an ellipsis (`...`) should be used to indicate truncated text. + */ + ellipsize: boolean; + + /** + * Determines whether the return key is enabled automatically when there is text in this text + * field. + */ + enableReturnKey: boolean; + + /** + * Font to use for text. + */ + font: Font; + + /** + * Leave some space above the keyboard in landscape mode or not. + */ + fullscreen: boolean; + + /** + * Hint text to display when the field is empty. + */ + hintText: string; + + /** + * Hint text color to display when the field is empty. + */ + hintTextColor: string; + + /** + * Key identifying a string from the locale file to use for the + * [hintText](Titanium.UI.TextField.hintText) property. + */ + hinttextid: string; + + /** + * Hint type to display on the text field. + */ + hintType: number; + + /** + * Input type to accept in the text field. Also influences the Keyboard type to display. + */ + inputType: number[]; + + /** + * Array of toolbar button objects or a [toolbar](Titanium.UI.iOS.Toolbar) to be used when the + * keyboard is displayed. + */ + keyboardToolbar: Titanium.UI.View[] | Titanium.UI.iOS.Toolbar; + + /** + * Color of the keyboard toolbar if keyboardToolbar is an array, as a color name or hex triplet. + */ + keyboardToolbarColor: string; + + /** + * Height of the keyboard toolbar if keyboardToolbar is an array. + */ + keyboardToolbarHeight: number; + + /** + * Keyboard type to display when this text field is focused. + */ + keyboardType: number; + + /** + * Left button view to display in the `TextField`. + */ + leftButton: any; + + /** + * Determines when to display the left button view. + */ + leftButtonMode: number; + + /** + * Padding between the left button and the edge of the field. + */ + leftButtonPadding: number; + + /** + * Minimum size of the font when the font is sized based on the contents. Enables font + * scaling to fit. + */ + minimumFontSize: number; + + /** + * Sets the padding of this text field. + */ + padding: TextFieldPadding; + + /** + * Left padding of this text field. + */ + paddingLeft: number; + + /** + * Right padding of this text field. + */ + paddingRight: number; + + /** + * Obscure the input text from the user. + */ + passwordMask: boolean; + + /** + * Specifies the text to display on the keyboard `Return` key when this field is focused. + */ + returnKeyType: number; + + /** + * Right button view. + */ + rightButton: any; + + /** + * Determines when to display the right button view. + */ + rightButtonMode: number; + + /** + * Padding between the right button and the edge of the field. + */ + rightButtonPadding: number; + + /** + * Determines whether the return key should be suppressed during entry. + */ + suppressReturn: boolean; + + /** + * Returns the currently selected text of the text field. + */ + readonly selection: textFieldSelectedParams; + + /** + * Determinates if the undo and redo buttons on the left side of the keyboard should be displayed or not. Only valid on iOS9 and above. + */ + showUndoRedoActions: boolean; + + /** + * Text alignment within this text field. + * This has no effect on `hintText` when `hintType` is Ti.UI.HINT_TYPE_ANIMATED. + */ + textAlign: string | number; + + /** + * Value of this text field, which may be set programmatically and modified by the user. + */ + value: string; + + /** + * Vertical alignment within this text field. + */ + verticalAlign: number | string; + + /** + * Maximum length of text field input. + */ + maxLength: number; + + /** + * Forces the field to lose focus. + */ + blur(): void; + + /** + * Forces the field to gain focus. + */ + focus(): void; + + /** + * Returns `true` if this text field contains text. + */ + hasText(): boolean; + + /** + * Selects the text in range (start, end). + */ + setSelection(start: number, end: number): void; + + /** + * Gets the value of the property. + */ + getAppearance(): number; + + /** + * Sets the value of the property. + */ + setAppearance(appearance: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardAppearance(): number; + + /** + * Sets the value of the property. + */ + setKeyboardAppearance(keyboardAppearance: number): void; + + /** + * Gets the value of the property. + */ + getAttributedString(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedString(attributedString: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAttributedHintText(): Titanium.UI.AttributedString; + + /** + * Sets the value of the property. + */ + setAttributedHintText(attributedHintText: Titanium.UI.AttributedString): void; + + /** + * Gets the value of the property. + */ + getAutocapitalization(): number; + + /** + * Sets the value of the property. + */ + setAutocapitalization(autocapitalization: number): void; + + /** + * Gets the value of the property. + */ + getAutocorrect(): boolean; + + /** + * Sets the value of the property. + */ + setAutocorrect(autocorrect: boolean): void; + + /** + * Gets the value of the property. + */ + getAutofillType(): string; + + /** + * Sets the value of the property. + */ + setAutofillType(autofillType: string): void; + + /** + * Gets the value of the property. + */ + getAutoLink(): number; + + /** + * Sets the value of the property. + */ + setAutoLink(autoLink: number): void; + + /** + * Gets the value of the property. + */ + getBorderStyle(): number; + + /** + * Sets the value of the property. + */ + setBorderStyle(borderStyle: number): void; + + /** + * Gets the value of the property. + */ + getClearButtonMode(): number; + + /** + * Sets the value of the property. + */ + setClearButtonMode(clearButtonMode: number): void; + + /** + * Gets the value of the property. + */ + getClearOnEdit(): boolean; + + /** + * Sets the value of the property. + */ + setClearOnEdit(clearOnEdit: boolean): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getEditable(): boolean; + + /** + * Sets the value of the property. + */ + setEditable(editable: boolean): void; + + /** + * Gets the value of the property. + */ + getEllipsize(): boolean; + + /** + * Sets the value of the property. + */ + setEllipsize(ellipsize: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableReturnKey(): boolean; + + /** + * Sets the value of the property. + */ + setEnableReturnKey(enableReturnKey: boolean): void; + + /** + * Gets the value of the property. + */ + getFont(): Font; + + /** + * Sets the value of the property. + */ + setFont(font: Font): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getHintTextColor(): string; + + /** + * Sets the value of the property. + */ + setHintTextColor(hintTextColor: string): void; + + /** + * Gets the value of the property. + */ + getHinttextid(): string; + + /** + * Sets the value of the property. + */ + setHinttextid(hinttextid: string): void; + + /** + * Gets the value of the property. + */ + getHintType(): number; + + /** + * Sets the value of the property. + */ + setHintType(hintType: number): void; + + /** + * Gets the value of the property. + */ + getInputType(): number[]; + + /** + * Sets the value of the property. + */ + setInputType(inputType: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbar(): Titanium.UI.View[] | Titanium.UI.iOS.Toolbar; + + /** + * Sets the value of the property. + */ + setKeyboardToolbar(keyboardToolbar: any[]): void; + + /** + * Sets the value of the property. + */ + setKeyboardToolbar(keyboardToolbar: Titanium.UI.iOS.Toolbar): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbarColor(): string; + + /** + * Sets the value of the property. + */ + setKeyboardToolbarColor(keyboardToolbarColor: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardToolbarHeight(): number; + + /** + * Sets the value of the property. + */ + setKeyboardToolbarHeight(keyboardToolbarHeight: number): void; + + /** + * Gets the value of the property. + */ + getKeyboardType(): number; + + /** + * Sets the value of the property. + */ + setKeyboardType(keyboardType: number): void; + + /** + * Gets the value of the property. + */ + getLeftButton(): any; + + /** + * Sets the value of the property. + */ + setLeftButton(leftButton: any): void; + + /** + * Gets the value of the property. + */ + getLeftButtonMode(): number; + + /** + * Sets the value of the property. + */ + setLeftButtonMode(leftButtonMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftButtonPadding(): number; + + /** + * Sets the value of the property. + */ + setLeftButtonPadding(leftButtonPadding: number): void; + + /** + * Gets the value of the property. + */ + getMinimumFontSize(): number; + + /** + * Sets the value of the property. + */ + setMinimumFontSize(minimumFontSize: number): void; + + /** + * Gets the value of the property. + */ + getPadding(): TextFieldPadding; + + /** + * Sets the value of the property. + */ + setPadding(padding: TextFieldPadding): void; + + /** + * Gets the value of the property. + */ + getPaddingLeft(): number; + + /** + * Sets the value of the property. + */ + setPaddingLeft(paddingLeft: number): void; + + /** + * Gets the value of the property. + */ + getPaddingRight(): number; + + /** + * Sets the value of the property. + */ + setPaddingRight(paddingRight: number): void; + + /** + * Gets the value of the property. + */ + getPasswordMask(): boolean; + + /** + * Sets the value of the property. + */ + setPasswordMask(passwordMask: boolean): void; + + /** + * Gets the value of the property. + */ + getReturnKeyType(): number; + + /** + * Sets the value of the property. + */ + setReturnKeyType(returnKeyType: number): void; + + /** + * Gets the value of the property. + */ + getRightButton(): any; + + /** + * Sets the value of the property. + */ + setRightButton(rightButton: any): void; + + /** + * Gets the value of the property. + */ + getRightButtonMode(): number; + + /** + * Sets the value of the property. + */ + setRightButtonMode(rightButtonMode: number): void; + + /** + * Gets the value of the property. + */ + getRightButtonPadding(): number; + + /** + * Sets the value of the property. + */ + setRightButtonPadding(rightButtonPadding: number): void; + + /** + * Gets the value of the property. + */ + getSuppressReturn(): boolean; + + /** + * Sets the value of the property. + */ + setSuppressReturn(suppressReturn: boolean): void; + + /** + * Gets the value of the property. + */ + getSelection(): textFieldSelectedParams; + + /** + * Gets the value of the property. + */ + getShowUndoRedoActions(): boolean; + + /** + * Sets the value of the property. + */ + setShowUndoRedoActions(showUndoRedoActions: boolean): void; + + /** + * Gets the value of the property. + */ + getTextAlign(): string | number; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: string): void; + + /** + * Sets the value of the property. + */ + setTextAlign(textAlign: number): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getVerticalAlign(): number | string; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: number): void; + + /** + * Sets the value of the property. + */ + setVerticalAlign(verticalAlign: string): void; + + /** + * Gets the value of the property. + */ + getMaxLength(): number; + + /** + * Sets the value of the property. + */ + setMaxLength(maxLength: number): void; + + } + + /** + * A toolbar, which can contain buttons and certain other controls. + */ + interface Toolbar extends Titanium.UI.View { + /** + * Background color for the toolbar, as a color name or hex triplet. + */ + barColor: string; + + /** + * An array of buttons (or other widgets) contained in the toolbar. + */ + items: Titanium.UI.View[]; + + /** + * If `true`, the background of the toolbar extends upwards. + */ + extendBackground: boolean; + + /** + * If `true`, a translucent background color is used for the toolbar. + */ + translucent: boolean; + + /** + * Returns the margin after the toolbar's content when there are action buttons. + */ + contentInsetEndWithActions: number; + + /** + * Returns the margin at the toolbar's content start when there is a navigation button. + */ + contentInsetStartWithNavigation: number; + + /** + * Image to be used as a logo in the Toolbar. + */ + logo: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Image to be used for a navigation icon. + */ + navigationIcon: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Image to be used for the overflow menu. + */ + overflowIcon: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Text of the subtitle. + */ + subtitle: string; + + /** + * Color for toolbar's subtitle + */ + subtitleTextColor: string; + + /** + * Text of the title. + */ + title: string; + + /** + * Color string with any Titanium supported format + */ + titleTextColor: string; + + /** + * Collapses expanded ActionViews if there is any + */ + collapseActionViews(): void; + + /** + * Collapses expandend ActionViews and hides overflow menu + */ + dismissPopupMenus(): void; + + /** + * Returns the margin at the toolbar's content end. + */ + getContentInsetEnd(): number; + + /** + * Returns the margin on the left of the toolbar's content. + */ + getContentInsetLeft(): number; + + /** + * Returns the margin on the right of the toolbar's content. + */ + getContentInsetRight(): number; + + /** + * Returns the margin at the toolbar's content start. + */ + getContentInsetStart(): number; + + /** + * Returns the margin at the toolbar's content end that will be used with the current configuration of the toolbar. + */ + getCurrentContentInsetEnd(): number; + + /** + * Returns the margin on the left of the toolbar's content that will be used with the current configuration of the toolbar. + */ + getCurrentContentInsetLeft(): number; + + /** + * Returns the margin on the right of the toolbar's content that will be used with the current configuration of the toolbar. + */ + getCurrentContentInsetRight(): number; + + /** + * Returns the margin at the toolbar's content start that will be used with the current configuration of the toolbar. + */ + getCurrentContentInsetStart(): number; + + /** + * Checks if the toolbar is currently hosting an expanded action view. + */ + hasExpandedActionView(): boolean; + + /** + * Hides the overflow menu if there is one. + */ + hideOverflowMenu(): void; + + /** + * Checks if the toolbar is currently hosting an expanded action view. + */ + isOverflowMenuShowing(): boolean; + + /** + * Sets the content margins of the toolbar + */ + setContentInsetsAbsolute(insetLeft: number, insetRight: number): void; + + /** + * Sets the content margins relative to the layout direction + */ + setContentInsetsRelative(insetStart: number, insetEnd: number): void; + + /** + * Shows the overflow menu if there is one + */ + showOverflowMenu(): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setItems(items: any[]): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getContentInsetEndWithActions(): number; + + /** + * Sets the value of the property. + */ + setContentInsetEndWithActions(contentInsetEndWithActions: number): void; + + /** + * Gets the value of the property. + */ + getContentInsetStartWithNavigation(): number; + + /** + * Sets the value of the property. + */ + setContentInsetStartWithNavigation(contentInsetStartWithNavigation: number): void; + + /** + * Gets the value of the property. + */ + getLogo(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setLogo(logo: string): void; + + /** + * Sets the value of the property. + */ + setLogo(logo: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setLogo(logo: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getNavigationIcon(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setNavigationIcon(navigationIcon: string): void; + + /** + * Sets the value of the property. + */ + setNavigationIcon(navigationIcon: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setNavigationIcon(navigationIcon: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getOverflowIcon(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setOverflowIcon(overflowIcon: string): void; + + /** + * Sets the value of the property. + */ + setOverflowIcon(overflowIcon: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setOverflowIcon(overflowIcon: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getSubtitle(): string; + + /** + * Sets the value of the property. + */ + setSubtitle(subtitle: string): void; + + /** + * Gets the value of the property. + */ + getSubtitleTextColor(): string; + + /** + * Sets the value of the property. + */ + setSubtitleTextColor(subtitleTextColor: string): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleTextColor(): string; + + /** + * Sets the value of the property. + */ + setTitleTextColor(titleTextColor: string): void; + + } + + /** + * The web view allows you to open an HTML5 based view which can load either local or remote content. + */ + interface WebView extends Titanium.UI.View { + /** + * A Boolean value that determines whether pressing on a link displays a preview of the + * destination for the link. + */ + allowsLinkPreview: boolean; + + /** + * An array of url strings to blacklist. + */ + blacklistedURLs: string[]; + + /** + * Web content to load. + */ + data: Titanium.Blob | Titanium.Filesystem.File; + + /** + * Determines whether the view will bounce when scrolling to the edge of the scrollable region. + */ + disableBounce: boolean; + + /** + * Determines whether or not the webview should not be able to display the context menu. + */ + disableContextMenu: boolean; + + /** + * Enable adding javascript interfaces internally to webview prior to JELLY_BEAN_MR1 (Android 4.2) + */ + enableJavascriptInterface: boolean; + + /** + * Lets the webview handle platform supported urls + */ + handlePlatformUrl: boolean; + + /** + * Hides activity indicator when loading remote URL. + */ + hideLoadIndicator: boolean; + + /** + * HTML content of this web view. + */ + html: string; + + /** + * A Boolean value indicating whether web content can programmatically display the keyboard. + */ + keyboardDisplayRequiresUserAction: boolean; + + /** + * Controls whether to ignore invalid SSL certificates or not. + */ + ignoreSslError: boolean; + + /** + * Indicates if the webview is loading content. + */ + loading: boolean; + + /** + * Callback function called when there is a request for the application to create a new window + * to host new content. + */ + onCreateWindow: (param0: any) => any; + + /** + * Determines the behavior when the user overscrolls the view. + */ + overScrollMode: number; + + /** + * Determines how a cache is used in this web view. + */ + cacheMode: number; + + /** + * Determines how to treat content that requires plugins in this web view. + */ + pluginState: number; + + /** + * Controls whether the scroll-to-top gesture is effective. + */ + scrollsToTop: boolean; + + /** + * If `true`, zoom controls are enabled. + */ + enableZoomControls: boolean; + + /** + * If `true`, scale contents to fit the web view. + */ + scalesPageToFit: boolean; + + /** + * URL to the web document. + */ + url: string; + + /** + * The User-Agent header used by the web view when requesting content. + */ + userAgent: string; + + /** + * Explicitly specifies if this web view handles touches. + */ + willHandleTouches: boolean; + + /** + * Enables using light touches to make a selection and activate mouseovers. + */ + lightTouchEnabled: boolean; + + /** + * Sets extra request headers for this web view to use on subsequent URL requests. + */ + requestHeaders: any; + + /** + * Sets the value of [html](Titanium.UI.WebView.html) property. + */ + setHtml(html: any, options?: any): void; + + /** + * Returns `true` if the web view can go back in its history list. + */ + canGoBack(): boolean; + + /** + * Returns `true` if the web view can go forward in its history list. + */ + canGoForward(): boolean; + + /** + * Evaluates a JavaScript expression inside the context of the web view and + * optionally, returns a result. + */ + evalJS(code: string): string; + + /** + * Goes back one entry in the web view's history list, to the previous page. + */ + goBack(): void; + + /** + * Goes forward one entry in this web view's history list, if possible. + */ + goForward(): void; + + /** + * Pauses native webview plugins. + */ + pause(): void; + + /** + * Reloads the current webpage. + */ + reload(): void; + + /** + * Forces the web view to repaint its contents. + */ + repaint(): void; + + /** + * Releases memory when the web view is no longer needed. + */ + release(): void; + + /** + * Resume native webview plugins. + */ + resume(): void; + + /** + * Sets the basic authentication for this web view to use on subsequent URl requests. + */ + setBasicAuthentication(username: string, password: string): void; + + /** + * Stops loading a currently loading page. + */ + stopLoading(): void; + + /** + * Gets the value of the property. + */ + getAllowsLinkPreview(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsLinkPreview(allowsLinkPreview: boolean): void; + + /** + * Gets the value of the property. + */ + getBlacklistedURLs(): string[]; + + /** + * Sets the value of the property. + */ + setBlacklistedURLs(blacklistedURLs: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getData(): Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setData(data: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setData(data: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getDisableBounce(): boolean; + + /** + * Sets the value of the property. + */ + setDisableBounce(disableBounce: boolean): void; + + /** + * Gets the value of the property. + */ + getDisableContextMenu(): boolean; + + /** + * Sets the value of the property. + */ + setDisableContextMenu(disableContextMenu: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableJavascriptInterface(): boolean; + + /** + * Sets the value of the property. + */ + setEnableJavascriptInterface(enableJavascriptInterface: boolean): void; + + /** + * Gets the value of the property. + */ + getHandlePlatformUrl(): boolean; + + /** + * Sets the value of the property. + */ + setHandlePlatformUrl(handlePlatformUrl: boolean): void; + + /** + * Gets the value of the property. + */ + getHideLoadIndicator(): boolean; + + /** + * Sets the value of the property. + */ + setHideLoadIndicator(hideLoadIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + getHtml(): string; + + /** + * Sets the value of the property. + */ + setHtml(html: string): void; + + /** + * Gets the value of the property. + */ + getKeyboardDisplayRequiresUserAction(): boolean; + + /** + * Sets the value of the property. + */ + setKeyboardDisplayRequiresUserAction(keyboardDisplayRequiresUserAction: boolean): void; + + /** + * Gets the value of the property. + */ + getIgnoreSslError(): boolean; + + /** + * Sets the value of the property. + */ + setIgnoreSslError(ignoreSslError: boolean): void; + + /** + * Gets the value of the property. + */ + getLoading(): boolean; + + /** + * Sets the value of the property. + */ + setLoading(loading: boolean): void; + + /** + * Gets the value of the property. + */ + getOnCreateWindow(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnCreateWindow(onCreateWindow: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOverScrollMode(): number; + + /** + * Sets the value of the property. + */ + setOverScrollMode(overScrollMode: number): void; + + /** + * Gets the value of the property. + */ + getCacheMode(): number; + + /** + * Sets the value of the property. + */ + setCacheMode(cacheMode: number): void; + + /** + * Gets the value of the property. + */ + getPluginState(): number; + + /** + * Sets the value of the property. + */ + setPluginState(pluginState: number): void; + + /** + * Gets the value of the property. + */ + getScrollsToTop(): boolean; + + /** + * Sets the value of the property. + */ + setScrollsToTop(scrollsToTop: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableZoomControls(): boolean; + + /** + * Sets the value of the property. + */ + setEnableZoomControls(enableZoomControls: boolean): void; + + /** + * Gets the value of the property. + */ + getScalesPageToFit(): boolean; + + /** + * Sets the value of the property. + */ + setScalesPageToFit(scalesPageToFit: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getUserAgent(): string; + + /** + * Sets the value of the property. + */ + setUserAgent(userAgent: string): void; + + /** + * Gets the value of the property. + */ + getWillHandleTouches(): boolean; + + /** + * Sets the value of the property. + */ + setWillHandleTouches(willHandleTouches: boolean): void; + + /** + * Gets the value of the property. + */ + getLightTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setLightTouchEnabled(lightTouchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getRequestHeaders(): any; + + /** + * Sets the value of the property. + */ + setRequestHeaders(requestHeaders: any): void; + + } + + /** + * The Window is an empty drawing surface or container. + */ + interface Window extends Titanium.UI.View { + /** + * For lightweight windows, this property returns undefined. + * For heavyweight windows, this property contains a reference to the + * Android Activity object associated with this window. + */ + readonly activity: Titanium.Android.Activity; + + /** + * Title for the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitle: string; + + /** + * The image to show as the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitleImage: string | Titanium.Blob; + + /** + * Background color for the nav bar, as a color name or hex triplet. + */ + barColor: string; + + /** + * Background image for the nav bar, specified as a URL to a local image. + */ + barImage: string; + + /** + * Boolean value indicating if the application should exit when the Android + * Back button is pressed while the window is being shown or when the window + * is closed programmatically. + */ + exitOnClose: boolean; + + /** + * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + */ + extendEdges: number[]; + + /** + * Treat the content of the window as secure, preventing it from appearing in screenshots or from being viewed on non-secure displays. + */ + flagSecure: boolean; + + /** + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + */ + includeOpaqueBars: boolean; + + /** + * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + */ + autoAdjustScrollViewInsets: boolean; + + /** + * Specifies whether the content (subviews) of the window will render inside the safe-area or not. + * Only used in iOS 11.0 and later. + */ + extendSafeArea: boolean; + + /** + * Boolean value indicating if the window is fullscreen. + */ + fullscreen: boolean; + + /** + * Set this to true to hide the shadow image of the navigation bar. + */ + hideShadow: boolean; + + /** + * Set this to true to hide the navigation bar on swipe. + */ + hidesBarsOnSwipe: boolean; + + /** + * Set this to true to hide the navigation bar on tap. + */ + hidesBarsOnTap: boolean; + + /** + * Set this to true to hide the navigation bar when the keyboard appears. + */ + hidesBarsWhenKeyboardAppears: boolean; + + /** + * A Boolean value indicating whether the title should be displayed in a large format. + */ + largeTitleEnabled: string; + + /** + * The mode to use when displaying the title of the navigation bar. + */ + largeTitleDisplayMode: number; + + /** + * View to show in the left nav bar area. + */ + leftNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the left nav bar area. + */ + leftNavButtons: Titanium.UI.View[]; + + /** + * Indicates to open a modal window or not. + */ + modal: boolean; + + /** + * Hides the navigation bar (`true`) or shows the navigation bar (`false`). + */ + navBarHidden: boolean; + + /** + * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + */ + navTintColor: string; + + /** + * Callback function that overrides the default behavior when the user presses the **Back** + * button. + */ + onBack: (param0: any) => any; + + /** + * Array of supported orientation modes, specified using the orientation + * constants defined in . + */ + orientationModes: number[]; + + /** + * Current orientation of the window. + */ + readonly orientation: number; + + /** + * View to show in the right nav bar area. + */ + rightNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the right nav bar area. + */ + rightNavButtons: Titanium.UI.View[]; + + /** + * Shadow image for the navigation bar, specified as a URL to a local image.. + */ + shadowImage: string; + + /** + * Boolean value to enable split action bar. + */ + splitActionBar: boolean; + + /** + * The status bar style associated with this window. + */ + statusBarStyle: number; + + /** + * Maintain a sustainable level of performance. + */ + sustainedPerformanceMode: boolean; + + /** + * Boolean value indicating if the user should be able to close a window using a swipe gesture. + */ + swipeToClose: boolean; + + /** + * Boolean value indicating if the tab bar should be hidden. + */ + tabBarHidden: boolean; + + /** + * Name of the theme to apply to the window. + */ + theme: string; + + /** + * Title of the window. + */ + title: string; + + /** + * Title text attributes of the window. + */ + titleAttributes: titleAttributesParams; + + /** + * View to show in the title area of the nav bar. + */ + titleControl: Titanium.UI.View; + + /** + * Image to show in the title area of the nav bar, specified as a local file path or URL. + */ + titleImage: string; + + /** + * Title prompt for the window. + */ + titlePrompt: string; + + /** + * Key identifying a string from the locale file to use for the window title. + */ + titleid: string; + + /** + * Key identifying a string from the locale file to use for the window title prompt. + */ + titlepromptid: string; + + /** + * Array of button objects to show in the window's toolbar. + */ + toolbar: any[]; + + /** + * Use a transition animation when opening or closing windows in a + * or . + */ + transitionAnimation: Titanium.Proxy; + + /** + * Boolean value indicating if the nav bar is translucent. + */ + translucent: boolean; + + /** + * Loads a JavaScript file from a local URL. + */ + url: string; + + /** + * Additional flags to set on the Activity Window. + */ + windowFlags: number; + + /** + * Determines whether a heavyweight window's soft input area (ie software keyboard) is visible + * as it receives focus and how the window behaves in order to accomodate it while keeping its + * contents in view. + */ + windowSoftInputMode: number; + + /** + * Set the pixel format for the Activity's Window. + */ + windowPixelFormat: number; + + /** + * The type of transition used when activity is exiting. + */ + activityExitTransition: number; + + /** + * The type of transition used when activity is entering. + */ + activityEnterTransition: number; + + /** + * The type of transition used when returning from a previously started activity. + */ + activityReturnTransition: number; + + /** + * The type of transition used when reentering to a previously started activity. + */ + activityReenterTransition: number; + + /** + * The type of exit transition used when animating shared elements between two activities. + */ + activitySharedElementExitTransition: number; + + /** + * The type of enter transition used when animating shared elements between two activities. + */ + activitySharedElementEnterTransition: number; + + /** + * The type of return transition used when animating shared elements between two activities. + */ + activitySharedElementReturnTransition: number; + + /** + * The type of reenter transition used when animating shared elements between two activities. + */ + activitySharedElementReenterTransition: number; + + /** + * Adds a common UI element to participate in window transition animation. + */ + addSharedElement(view: any, transitionName: string): void; + + /** + * Closes the window. + */ + close(params?: any): void; + + /** + * Hides the navigation bar. + */ + hideNavBar(options?: any): void; + + /** + * Hides the tab bar. Must be called before opening the window. + */ + hideTabBar(): void; + + /** + * Opens the window. + */ + open(params?: openWindowParams): void; + + /** + * Clears all added shared elements. + */ + removeAllSharedElements(): void; + + /** + * Sets the array of items to show in the window's toolbar. + */ + setToolbar(items: ReadonlyArray, params?: windowToolbarParam): void; + + /** + * Makes the navigation bar visible. + */ + showNavBar(options?: any): void; + + /** + * Makes the bottom toolbar visible. + */ + showToolbar(options?: any): void; + + /** + * Makes the bottom toolbar invisible. + */ + hideToolbar(options?: any): void; + + /** + * Gets the value of the property. + */ + getActivity(): Titanium.Android.Activity; + + /** + * Gets the value of the property. + */ + getBackButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setBackButtonTitle(backButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitleImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: string): void; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getBarImage(): string; + + /** + * Sets the value of the property. + */ + setBarImage(barImage: string): void; + + /** + * Gets the value of the property. + */ + getExitOnClose(): boolean; + + /** + * Sets the value of the property. + */ + setExitOnClose(exitOnClose: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendEdges(): number[]; + + /** + * Sets the value of the property. + */ + setExtendEdges(extendEdges: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getFlagSecure(): boolean; + + /** + * Sets the value of the property. + */ + setFlagSecure(flagSecure: boolean): void; + + /** + * Gets the value of the property. + */ + getIncludeOpaqueBars(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeOpaqueBars(includeOpaqueBars: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoAdjustScrollViewInsets(): boolean; + + /** + * Sets the value of the property. + */ + setAutoAdjustScrollViewInsets(autoAdjustScrollViewInsets: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendSafeArea(): boolean; + + /** + * Sets the value of the property. + */ + setExtendSafeArea(extendSafeArea: boolean): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHideShadow(): boolean; + + /** + * Sets the value of the property. + */ + setHideShadow(hideShadow: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnSwipe(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnSwipe(hidesBarsOnSwipe: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnTap(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnTap(hidesBarsOnTap: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsWhenKeyboardAppears(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + + /** + * Gets the value of the property. + */ + getLargeTitleEnabled(): string; + + /** + * Sets the value of the property. + */ + setLargeTitleEnabled(largeTitleEnabled: string): void; + + /** + * Gets the value of the property. + */ + getLargeTitleDisplayMode(): number; + + /** + * Sets the value of the property. + */ + setLargeTitleDisplayMode(largeTitleDisplayMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftNavButton(leftNavButton: any): void; + + /** + * Gets the value of the property. + */ + getLeftNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setLeftNavButtons(leftNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getModal(): boolean; + + /** + * Sets the value of the property. + */ + setModal(modal: boolean): void; + + /** + * Gets the value of the property. + */ + getNavBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setNavBarHidden(navBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getNavTintColor(): string; + + /** + * Sets the value of the property. + */ + setNavTintColor(navTintColor: string): void; + + /** + * Gets the value of the property. + */ + getOnBack(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnBack(onBack: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOrientationModes(): number[]; + + /** + * Sets the value of the property. + */ + setOrientationModes(orientationModes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrientation(): number; + + /** + * Gets the value of the property. + */ + getRightNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightNavButton(rightNavButton: any): void; + + /** + * Gets the value of the property. + */ + getRightNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setRightNavButtons(rightNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getShadowImage(): string; + + /** + * Sets the value of the property. + */ + setShadowImage(shadowImage: string): void; + + /** + * Gets the value of the property. + */ + getSplitActionBar(): boolean; + + /** + * Sets the value of the property. + */ + setSplitActionBar(splitActionBar: boolean): void; + + /** + * Gets the value of the property. + */ + getStatusBarStyle(): number; + + /** + * Sets the value of the property. + */ + setStatusBarStyle(statusBarStyle: number): void; + + /** + * Gets the value of the property. + */ + getSustainedPerformanceMode(): boolean; + + /** + * Sets the value of the property. + */ + setSustainedPerformanceMode(sustainedPerformanceMode: boolean): void; + + /** + * Gets the value of the property. + */ + getSwipeToClose(): boolean; + + /** + * Sets the value of the property. + */ + setSwipeToClose(swipeToClose: boolean): void; + + /** + * Gets the value of the property. + */ + getTabBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setTabBarHidden(tabBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getTheme(): string; + + /** + * Sets the value of the property. + */ + setTheme(theme: string): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getTitleControl(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setTitleControl(titleControl: any): void; + + /** + * Gets the value of the property. + */ + getTitleImage(): string; + + /** + * Sets the value of the property. + */ + setTitleImage(titleImage: string): void; + + /** + * Gets the value of the property. + */ + getTitlePrompt(): string; + + /** + * Sets the value of the property. + */ + setTitlePrompt(titlePrompt: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getTitlepromptid(): string; + + /** + * Sets the value of the property. + */ + setTitlepromptid(titlepromptid: string): void; + + /** + * Gets the value of the property. + */ + getToolbar(): any[]; + + /** + * Sets the value of the property. + */ + setToolbar(toolbar: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getTransitionAnimation(): Titanium.Proxy; + + /** + * Sets the value of the property. + */ + setTransitionAnimation(transitionAnimation: Titanium.Proxy): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getWindowFlags(): number; + + /** + * Sets the value of the property. + */ + setWindowFlags(windowFlags: number): void; + + /** + * Gets the value of the property. + */ + getWindowSoftInputMode(): number; + + /** + * Sets the value of the property. + */ + setWindowSoftInputMode(windowSoftInputMode: number): void; + + /** + * Gets the value of the property. + */ + getWindowPixelFormat(): number; + + /** + * Sets the value of the property. + */ + setWindowPixelFormat(windowPixelFormat: number): void; + + /** + * Gets the value of the property. + */ + getActivityExitTransition(): number; + + /** + * Sets the value of the property. + */ + setActivityExitTransition(activityExitTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivityEnterTransition(): number; + + /** + * Sets the value of the property. + */ + setActivityEnterTransition(activityEnterTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivityReturnTransition(): number; + + /** + * Sets the value of the property. + */ + setActivityReturnTransition(activityReturnTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivityReenterTransition(): number; + + /** + * Sets the value of the property. + */ + setActivityReenterTransition(activityReenterTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivitySharedElementExitTransition(): number; + + /** + * Sets the value of the property. + */ + setActivitySharedElementExitTransition(activitySharedElementExitTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivitySharedElementEnterTransition(): number; + + /** + * Sets the value of the property. + */ + setActivitySharedElementEnterTransition(activitySharedElementEnterTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivitySharedElementReturnTransition(): number; + + /** + * Sets the value of the property. + */ + setActivitySharedElementReturnTransition(activitySharedElementReturnTransition: number): void; + + /** + * Gets the value of the property. + */ + getActivitySharedElementReenterTransition(): number; + + /** + * Sets the value of the property. + */ + setActivitySharedElementReenterTransition(activitySharedElementReenterTransition: number): void; + + } + + + /** + * A set of constants for the styles available for objects. + */ + namespace ActivityIndicatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Large white spinning indicator. + */ + const BIG: number; + + /** + * Small gray spinning indicator. + */ + const DARK: number; + + /** + * Large gray spinning indicator. + */ + const BIG_DARK: number; + + /** + * Small white spinning indicator (default). + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * The Android-specific UI capabilities. All properties, methods and events in this namespace will + * only work on Android systems. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Raw bit controlling whether the right/bottom edge is clipped to its container, based on the gravity direction being applied. + */ + const GRAVITY_AXIS_CLIP: number; + + /** + * Raw bit controlling how the right/bottom edge is placed. + */ + const GRAVITY_AXIS_PULL_AFTER: number; + + /** + * Raw bit controlling how the left/top edge is placed. + */ + const GRAVITY_AXIS_PULL_BEFORE: number; + + /** + * Raw bit indicating the gravity for an axis has been specified. + */ + const GRAVITY_AXIS_SPECIFIED: number; + + /** + * Bits defining the horizontal axis. + */ + const GRAVITY_AXIS_X_SHIFT: number; + + /** + * Bits defining the vertical axis. + */ + const GRAVITY_AXIS_Y_SHIFT: number; + + /** + * Push object to the bottom of its container, not changing its size. + */ + const GRAVITY_BOTTOM: number; + + /** + * Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. + */ + const GRAVITY_CENTER: number; + + /** + * Place object in the horizontal center of its container, not changing its size. + */ + const GRAVITY_CENTER_HORIZONTAL: number; + + /** + * Place object in the vertical center of its container, not changing its size. + */ + const GRAVITY_CENTER_VERTICAL: number; + + /** + * Flag to clip the edges of the object to its container along the horizontal axis. + */ + const GRAVITY_CLIP_HORIZONTAL: number; + + /** + * Flag to clip the edges of the object to its container along the vertical axis. + */ + const GRAVITY_CLIP_VERTICAL: number; + + /** + * Special constant to enable clipping to an overall display along the horizontal dimension. + */ + const GRAVITY_DISPLAY_CLIP_HORIZONTAL: number; + + /** + * Special constant to enable clipping to an overall display along the vertical dimension. + */ + const GRAVITY_DISPLAY_CLIP_VERTICAL: number; + + /** + * Push object to x-axis position at the end of its container, not changing its size. + */ + const GRAVITY_END: number; + + /** + * Grow the horizontal and vertical size of the object if needed so it completely fills its container. + */ + const GRAVITY_FILL: number; + + /** + * Grow the horizontal size of the object if needed so it completely fills its container. + */ + const GRAVITY_FILL_HORIZONTAL: number; + + /** + * Grow the vertical size of the object if needed so it completely fills its container. + */ + const GRAVITY_FILL_VERTICAL: number; + + /** + * Binary mask to get the absolute horizontal gravity of a gravity. + */ + const GRAVITY_HORIZONTAL_GRAVITY_MASK: number; + + /** + * Push object to the left of its container, not changing its size. + */ + const GRAVITY_LEFT: number; + + /** + * Constant indicating that no gravity has been set + */ + const GRAVITY_NO_GRAVITY: number; + + /** + * Binary mask for the horizontal gravity and script specific direction bit. + */ + const GRAVITY_RELATIVE_HORIZONTAL_GRAVITY_MASK: number; + + /** + * Raw bit controlling whether the layout direction is relative or not (GRAVITY_START/GRAVITY_END instead of absolute GRAVITY_LEFT/GRAVITY_RIGHT). + */ + const GRAVITY_RELATIVE_LAYOUT_DIRECTION: number; + + /** + * Push object to the right of its container, not changing its size. + */ + const GRAVITY_RIGHT: number; + + /** + * Push object to x-axis position at the start of its container, not changing its size. + */ + const GRAVITY_START: number; + + /** + * Push object to the top of its container, not changing its size. + */ + const GRAVITY_TOP: number; + + /** + * Binary mask to get the vertical gravity of a gravity. + */ + const GRAVITY_VERTICAL_GRAVITY_MASK: number; + + /** + * Converts all detectable types of data into clickable links. + */ + const LINKIFY_ALL: number; + + /** + * Converts strings formatted as email addresses into clickable links. + */ + const LINKIFY_EMAIL_ADDRESSES: number; + + /** + * Converts strings formatted as addresses into clickable links. + */ + const LINKIFY_MAP_ADDRESSES: number; + + /** + * Converts strings formatted as phone numbers into clickable links. + */ + const LINKIFY_PHONE_NUMBERS: number; + + /** + * Converts strings formatted as URLs into clickable links. + */ + const LINKIFY_WEB_URLS: number; + + /** + * Always allow a user to over-scroll this view, provided it is a view that can scroll. + */ + const OVER_SCROLL_ALWAYS: number; + + /** + * Allow a user to over-scroll this view only if the content is large enough to meaningfully scroll, provided it is a view that can scroll. + */ + const OVER_SCROLL_IF_CONTENT_SCROLLS: number; + + /** + * Never allow a user to over-scroll this view. + */ + const OVER_SCROLL_NEVER: number; + + /** + * Android A_8 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_A_8: number; + + /** + * Android LA_88 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_LA_88: number; + + /** + * Android L_8 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_L_8: number; + + /** + * Android OPAQUE pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_OPAQUE: number; + + /** + * Android RGBA_4444 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGBA_4444: number; + + /** + * Android RGBA_5551 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGBA_5551: number; + + /** + * Android RGBA_8888 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGBA_8888: number; + + /** + * Android RGBX_8888 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGBX_8888: number; + + /** + * Android RGB_332 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGB_332: number; + + /** + * Android RGB_565 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGB_565: number; + + /** + * Android RGB_888 pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_RGB_888: number; + + /** + * Android TRANSLUCENT pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_TRANSLUCENT: number; + + /** + * Android A_8 pixel format for . Selecting the correct pixel format can + * improve image clarity and performance. + */ + const PIXEL_FORMAT_TRANSPARENT: number; + + /** + * Android UNKNOWN pixel format for . Selecting the correct pixel format + * can improve image clarity and performance. + */ + const PIXEL_FORMAT_UNKNOWN: number; + + /** + * Display as a modal dialog. (default) + */ + const PROGRESS_INDICATOR_DIALOG: number; + + /** + * Display as a horizontal progress bar in the title of + * the window. + */ + const PROGRESS_INDICATOR_STATUS_BAR: number; + + /** + * Used with the property to indicate an ongoing + * activity of indeterminate length. (default) + */ + const PROGRESS_INDICATOR_INDETERMINANT: number; + + /** + * Used with the property to indicate an ongoing + * activity of determinate length. + */ + const PROGRESS_INDICATOR_DETERMINANT: number; + + /** + * Pan the current heavyweight window when the input method (ie software keyboard) is shown, to + * ensure that its contents are not obscured. + */ + const SOFT_INPUT_ADJUST_PAN: number; + + /** + * Resize the current heavyweight window when the input method (ie software keyboard) is shown, + * to ensure that its contents are not obscured. + */ + const SOFT_INPUT_ADJUST_RESIZE: number; + + /** + * Use the system-default behavior to determine how the soft input area (ie software keyboard) + * is accomodated by the current heavyweight window when it receives focus (default.) + */ + const SOFT_INPUT_ADJUST_UNSPECIFIED: number; + + /** + * Always hide the soft input area (ie software keyboard) when the current heavyweight window + * receives focus. + */ + const SOFT_INPUT_STATE_ALWAYS_HIDDEN: number; + + /** + * Always show the soft input area (ie software keyboard) when the current heavyweight window + * receives focus. + */ + const SOFT_INPUT_STATE_ALWAYS_VISIBLE: number; + + /** + * Attempt to hide the soft input area (ie software keyboard) when the current heavyweight + * window receives focus. + */ + const SOFT_INPUT_STATE_HIDDEN: number; + + /** + * Use the system-default behavior to determine whether to show the soft input area + * (ie software keyboard) when the current heavyweight window receives focus. + */ + const SOFT_INPUT_STATE_UNSPECIFIED: number; + + /** + * Attempt to show the soft input area (ie software keyboard) when the current heavyweight + * window receives focus. + */ + const SOFT_INPUT_STATE_VISIBLE: number; + + /** + * Use Android default behavior to handle keyboard visibility when a view receives focus. + * (default) + */ + const SOFT_KEYBOARD_DEFAULT_ON_FOCUS: number; + + /** + * Attempt to hide the soft keyboard when a view receives focus. Note: system can override + * request. + */ + const SOFT_KEYBOARD_HIDE_ON_FOCUS: number; + + /** + * Attempt to show the soft keyboard when a view receives focus. Note: system can override + * request. + */ + const SOFT_KEYBOARD_SHOW_ON_FOCUS: number; + + /** + * Display a checkbox. + */ + const SWITCH_STYLE_CHECKBOX: number; + + /** + * Display a toggle button. + */ + const SWITCH_STYLE_TOGGLEBUTTON: number; + + /** + * Display a switch. + */ + const SWITCH_STYLE_SWITCH: number; + + /** + * Use with [WebView.pluginState](Titanium.UI.WebView.pluginState) to disable plugins in a web view. + */ + const WEBVIEW_PLUGINS_OFF: number; + + /** + * Use with [WebView.pluginState](Titanium.UI.WebView.pluginState) to enable plugins in a web view. + */ + const WEBVIEW_PLUGINS_ON: number; + + /** + * Display a placeholder and only load plugins when user selects it. + */ + const WEBVIEW_PLUGINS_ON_DEMAND: number; + + /** + * Use with [WebView.cacheMode](Titanium.UI.WebView.cacheMode) to override how the cache is used in a web view. + */ + const WEBVIEW_LOAD_DEFAULT: number; + + /** + * Use with [WebView.cacheMode](Titanium.UI.WebView.cacheMode) to override how the cache is used in a web view. + */ + const WEBVIEW_LOAD_NO_CACHE: number; + + /** + * Use with [WebView.cacheMode](Titanium.UI.WebView.cacheMode) to override how the cache is used in a web view. + */ + const WEBVIEW_LOAD_CACHE_ONLY: number; + + /** + * Use with [WebView.cacheMode](Titanium.UI.WebView.cacheMode) to override how the cache is used in a web view. + */ + const WEBVIEW_LOAD_CACHE_ELSE_NETWORK: number; + + /** + * Moves views in or out from the edges of the scene. + */ + const TRANSITION_EXPLODE: number; + + /** + * Fades in the views. + */ + const TRANSITION_FADE_IN: number; + + /** + * Fades out the views. + */ + const TRANSITION_FADE_OUT: number; + + /** + * Moves views to top. + */ + const TRANSITION_SLIDE_TOP: number; + + /** + * Moves views to right. + */ + const TRANSITION_SLIDE_RIGHT: number; + + /** + * Moves views to bottom. + */ + const TRANSITION_SLIDE_BOTTOM: number; + + /** + * Moves views to left. + */ + const TRANSITION_SLIDE_LEFT: number; + + /** + * Captures layout bounds of target views before and after the scene change and animates those changes during the transition. + */ + const TRANSITION_CHANGE_BOUNDS: number; + + /** + * Captures the clip bounds before and after the scene change and animates those changes during the transition. + */ + const TRANSITION_CHANGE_CLIP_BOUNDS: number; + + /** + * Captures scale and rotation for Views before and after the scene change and animates those changes during the transition. + */ + const TRANSITION_CHANGE_TRANSFORM: number; + + /** + * Captures an ImageView's matrix before and after the scene change and animates it during the transition. + */ + const TRANSITION_CHANGE_IMAGE_TRANSFORM: number; + + /** + * Resets transition to platform default. + */ + const TRANSITION_NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Hides the soft keyboard. + */ + function hideSoftKeyboard(): void; + + /** + * Opens an application preferences dialog, using the native Android system settings interface, + * defined by the platform-specific `preferences.xml` and `array.xml` files. + */ + function openPreferences(): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Creates and returns an instance of . + */ + function createCardView(parameters?: any): Titanium.UI.Android.CardView; + + /** + * Creates and returns an instance of . + */ + function createDrawerLayout(parameters?: any): Titanium.UI.Android.DrawerLayout; + + /** + * Creates and returns an instance of . + */ + function createProgressIndicator(parameters?: any): Titanium.UI.Android.ProgressIndicator; + + /** + * Creates and returns an instance of . + */ + function createSearchView(parameters?: any): Titanium.UI.Android.SearchView; + + /** + * An elevated view with rounded corners. + */ + interface CardView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Background color for CardView as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Corner radius for CardView. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * Elevation for CardView. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Background color for CardView as a color name or hex triplet. + */ + cardBackgroundColor: string; + + /** + * Corner radius for CardView. + */ + cardCornerRadius: number; + + /** + * Elevation for CardView. + */ + cardElevation: number; + + /** + * Maximum Elevation for CardView. + */ + cardMaxElevation: number; + + /** + * Maximum Elevation for CardView. + */ + maxElevation: number; + + /** + * Add padding to CardView on API level 20 and before to prevent intersections between + * the Card content and rounded corners. + */ + cardPreventCornerOverlap: boolean; + + /** + * Add padding to CardView on API level 20 and before to prevent intersections between + * the Card content and rounded corners. + */ + preventCornerOverlap: boolean; + + /** + * Add padding on API level 21 and above to have the same measurements with previous versions. + */ + cardUseCompatPadding: boolean; + + /** + * Add padding on API level 21 and above to have the same measurements with previous versions. + */ + useCompatPadding: boolean; + + /** + * Inner padding between the edges of the Card and children of the CardView. + */ + contentPadding: number; + + /** + * Inner padding between the edges of the Card and children of the CardView. + */ + padding: number; + + /** + * Inner padding between the bottom edge of the Card and children of the CardView. + */ + contentPaddingBottom: number; + + /** + * Inner padding between the bottom edge of the Card and children of the CardView. + */ + paddingBottom: number; + + /** + * Inner padding between the left edge of the Card and children of the CardView. + */ + contentPaddingLeft: number; + + /** + * Inner padding between the left edge of the Card and children of the CardView. + */ + paddingLeft: number; + + /** + * Inner padding between the right edge of the Card and children of the CardView. + */ + contentPaddingRight: number; + + /** + * Inner padding between the right edge of the Card and children of the CardView. + */ + paddingRight: number; + + /** + * Inner padding between the top edge of the Card and children of the CardView. + */ + contentPaddingTop: number; + + /** + * Inner padding between the top edge of the Card and children of the CardView. + */ + paddingTop: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + /** + * Gets the value of the property. + */ + getCardBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setCardBackgroundColor(cardBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getCardCornerRadius(): number; + + /** + * Sets the value of the property. + */ + setCardCornerRadius(cardCornerRadius: number): void; + + /** + * Gets the value of the property. + */ + getCardElevation(): number; + + /** + * Sets the value of the property. + */ + setCardElevation(cardElevation: number): void; + + /** + * Gets the value of the property. + */ + getCardMaxElevation(): number; + + /** + * Sets the value of the property. + */ + setCardMaxElevation(cardMaxElevation: number): void; + + /** + * Gets the value of the property. + */ + getMaxElevation(): number; + + /** + * Sets the value of the property. + */ + setMaxElevation(maxElevation: number): void; + + /** + * Gets the value of the property. + */ + getCardPreventCornerOverlap(): boolean; + + /** + * Sets the value of the property. + */ + setCardPreventCornerOverlap(cardPreventCornerOverlap: boolean): void; + + /** + * Gets the value of the property. + */ + getPreventCornerOverlap(): boolean; + + /** + * Sets the value of the property. + */ + setPreventCornerOverlap(preventCornerOverlap: boolean): void; + + /** + * Gets the value of the property. + */ + getCardUseCompatPadding(): boolean; + + /** + * Sets the value of the property. + */ + setCardUseCompatPadding(cardUseCompatPadding: boolean): void; + + /** + * Gets the value of the property. + */ + getUseCompatPadding(): boolean; + + /** + * Sets the value of the property. + */ + setUseCompatPadding(useCompatPadding: boolean): void; + + /** + * Gets the value of the property. + */ + getContentPadding(): number; + + /** + * Sets the value of the property. + */ + setContentPadding(contentPadding: number): void; + + /** + * Gets the value of the property. + */ + getPadding(): number; + + /** + * Sets the value of the property. + */ + setPadding(padding: number): void; + + /** + * Gets the value of the property. + */ + getContentPaddingBottom(): number; + + /** + * Sets the value of the property. + */ + setContentPaddingBottom(contentPaddingBottom: number): void; + + /** + * Gets the value of the property. + */ + getPaddingBottom(): number; + + /** + * Sets the value of the property. + */ + setPaddingBottom(paddingBottom: number): void; + + /** + * Gets the value of the property. + */ + getContentPaddingLeft(): number; + + /** + * Sets the value of the property. + */ + setContentPaddingLeft(contentPaddingLeft: number): void; + + /** + * Gets the value of the property. + */ + getPaddingLeft(): number; + + /** + * Sets the value of the property. + */ + setPaddingLeft(paddingLeft: number): void; + + /** + * Gets the value of the property. + */ + getContentPaddingRight(): number; + + /** + * Sets the value of the property. + */ + setContentPaddingRight(contentPaddingRight: number): void; + + /** + * Gets the value of the property. + */ + getPaddingRight(): number; + + /** + * Sets the value of the property. + */ + setPaddingRight(paddingRight: number): void; + + /** + * Gets the value of the property. + */ + getContentPaddingTop(): number; + + /** + * Sets the value of the property. + */ + setContentPaddingTop(contentPaddingTop: number): void; + + /** + * Gets the value of the property. + */ + getPaddingTop(): number; + + /** + * Sets the value of the property. + */ + setPaddingTop(paddingTop: number): void; + } - export interface LocationRule extends Ti.Proxy { - accuracy : number; - maxAge : number; - minAge : number; - name : string; - getAccuracy () : number; - getMaxAge () : number; - getMinAge () : number; - getName () : string; - setAccuracy (accuracy: number) : void; - setMaxAge (maxAge: number) : void; - setMinAge (minAge: number) : void; - setName (name: string) : void; + + /** + * A panel that displays the app's main navigation options on the left edge of the screen. + */ + interface DrawerLayout extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Use with [DrawerLayout.drawerLockMode](Titanium.UI.Android.DrawerLayout.drawerLockMode) to specify the drawer is locked closed. + */ + readonly LOCK_MODE_LOCKED_CLOSED: number; + + /** + * Use with [DrawerLayout.drawerLockMode](Titanium.UI.Android.DrawerLayout.drawerLockMode) to specify the drawer is locked opened. + */ + readonly LOCK_MODE_LOCKED_OPEN: number; + + /** + * Use with [DrawerLayout.drawerLockMode](Titanium.UI.Android.DrawerLayout.drawerLockMode) to specify the drawer is reset to default lock state. + */ + readonly LOCK_MODE_UNDEFINED: number; + + /** + * Use with [DrawerLayout.drawerLockMode](Titanium.UI.Android.DrawerLayout.drawerLockMode) to specify the drawer is unlocked. + */ + readonly LOCK_MODE_UNLOCKED: number; + + /** + * Determine whether the left drawer is open + */ + isLeftOpen: boolean; + + /** + * Determine whether the right drawer is open + */ + isRightOpen: boolean; + + /** + * Determine whether the left drawer is visible + */ + isLeftVisible: boolean; + + /** + * Determine whether the right drawer is visible + */ + isRightVisible: boolean; + + /** + * Get or set the width of the left drawer + */ + leftWidth: number; + + /** + * Get or set the width of the right drawer + */ + rightWidth: number; + + /** + * Get or set the view of the left drawer + */ + leftView: Titanium.UI.View; + + /** + * Get or set the view of the right drawer + */ + rightView: Titanium.UI.View; + + /** + * Get or set the center view + */ + centerView: Titanium.UI.View; + + /** + * Determine the drawer indicator status + */ + drawerIndicatorEnabled: boolean; + + /** + * Get or set the drawerLockMode + */ + drawerLockMode: number; + + /** + * Determine whether to enable the toolbar. + */ + toolbarEnabled: boolean; + + /** + * A Toolbar instance to use as a toolbar. + */ + toolbar: Titanium.UI.Toolbar; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Toggle the visibility of the left view. + */ + toggleLeft(): void; + + /** + * Open the left view. + */ + openLeft(): void; + + /** + * Close the left view. + */ + closeLeft(): void; + + /** + * Toggle the visibility of the right view. + */ + toggleRight(): void; + + /** + * Open the right view. + */ + openRight(): void; + + /** + * Close the right view. + */ + closeRight(): void; + + /** + * Disallow touch events on a specific view. + */ + interceptTouchEvent(view: any, disallowIntercept: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + /** + * Gets the value of the property. + */ + getIsLeftOpen(): boolean; + + /** + * Sets the value of the property. + */ + setIsLeftOpen(isLeftOpen: boolean): void; + + /** + * Gets the value of the property. + */ + getIsRightOpen(): boolean; + + /** + * Sets the value of the property. + */ + setIsRightOpen(isRightOpen: boolean): void; + + /** + * Gets the value of the property. + */ + getIsLeftVisible(): boolean; + + /** + * Sets the value of the property. + */ + setIsLeftVisible(isLeftVisible: boolean): void; + + /** + * Gets the value of the property. + */ + getIsRightVisible(): boolean; + + /** + * Sets the value of the property. + */ + setIsRightVisible(isRightVisible: boolean): void; + + /** + * Gets the value of the property. + */ + getLeftWidth(): number; + + /** + * Sets the value of the property. + */ + setLeftWidth(leftWidth: number): void; + + /** + * Gets the value of the property. + */ + getRightWidth(): number; + + /** + * Sets the value of the property. + */ + setRightWidth(rightWidth: number): void; + + /** + * Gets the value of the property. + */ + getLeftView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftView(leftView: any): void; + + /** + * Gets the value of the property. + */ + getRightView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightView(rightView: any): void; + + /** + * Gets the value of the property. + */ + getCenterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setCenterView(centerView: any): void; + + /** + * Gets the value of the property. + */ + getDrawerIndicatorEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setDrawerIndicatorEnabled(drawerIndicatorEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getDrawerLockMode(): number; + + /** + * Sets the value of the property. + */ + setDrawerLockMode(drawerLockMode: number): void; + + /** + * Gets the value of the property. + */ + getToolbarEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setToolbarEnabled(toolbarEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getToolbar(): Titanium.UI.Toolbar; + + /** + * Sets the value of the property. + */ + setToolbar(toolbar: Titanium.UI.Toolbar): void; + } + + /** + * A progress dialog or a horizontal progress bar in the title of the window. + */ + interface ProgressIndicator extends Titanium.Proxy { + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * When `true` allows the user to cancel the progress dialog by pressing the BACK button. + */ + cancelable: boolean; + + /** + * When `cancelable` is set to `true` and this is set to `true`, the dialog is canceled when touched outside the window's bounds. + */ + canceledOnTouchOutside: boolean; + + /** + * Message text. + */ + message: string; + + /** + * Key identifying a string in the locale file to use for the message text. + */ + messageid: string; + + /** + * Minimum value of the progress bar. + */ + min: number; + + /** + * Maximum value of the progress bar. + */ + max: number; + + /** + * Location for the progress indicator. + */ + location: number; + + /** + * Type for the progress indicator. + */ + type: number; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides the progress indicator and stops the animation. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Shows the progress indicator and starts the animation. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getCancelable(): boolean; + + /** + * Sets the value of the property. + */ + setCancelable(cancelable: boolean): void; + + /** + * Gets the value of the property. + */ + getCanceledOnTouchOutside(): boolean; + + /** + * Sets the value of the property. + */ + setCanceledOnTouchOutside(canceledOnTouchOutside: boolean): void; + + /** + * Gets the value of the property. + */ + getMessage(): string; + + /** + * Sets the value of the property. + */ + setMessage(message: string): void; + + /** + * Gets the value of the property. + */ + getMessageid(): string; + + /** + * Sets the value of the property. + */ + setMessageid(messageid: string): void; + + /** + * Gets the value of the property. + */ + getMin(): number; + + /** + * Sets the value of the property. + */ + setMin(min: number): void; + + /** + * Gets the value of the property. + */ + getMax(): number; + + /** + * Sets the value of the property. + */ + setMax(max: number): void; + + /** + * Gets the value of the property. + */ + getLocation(): number; + + /** + * Sets the value of the property. + */ + setLocation(location: number): void; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + } + + /** + * A specialized text field for entering search text. + */ + interface SearchView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * Disabled background color of the view, as a color name or hex triplet. + */ + backgroundDisabledColor: string; + + /** + * Disabled background image for the view, specified as a local file path or URL. + */ + backgroundDisabledImage: string; + + /** + * Focused background color of the view, as a color name or hex triplet. + */ + backgroundFocusedColor: string; + + /** + * Focused background image for the view, specified as a local file path or URL. + */ + backgroundFocusedImage: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Selected background color of the view, as a color name or hex triplet. + */ + backgroundSelectedColor: string; + + /** + * Selected background image url for the view, specified as a local file path or URL. + */ + backgroundSelectedImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * Base elevation of the view relative to its parent in pixels. + */ + elevation: number; + + /** + * Whether view should be focusable while navigating with the trackball. + */ + focusable: boolean; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Sets the behavior when hiding an object to release or keep the free space + */ + hiddenBehavior: number; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * When on, animate call overrides current animation if applicable. + */ + overrideCurrentAnimation: boolean; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * Clockwise 2D rotation of the view in degrees. + */ + rotation: number; + + /** + * Clockwise rotation of the view in degrees (x-axis). + */ + rotationX: number; + + /** + * Clockwise rotation of the view in degrees (y-axis). + */ + rotationY: number; + + /** + * Scaling of the view in x-axis in pixels. + */ + scaleX: number; + + /** + * Scaling of the view in y-axis in pixels. + */ + scaleY: number; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Determines keyboard behavior when this view is focused. + */ + softKeyboardOnFocus: number; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * A material design visual construct that provides an instantaneous visual confirmation of touch point. + */ + touchFeedback: boolean; + + /** + * Optional touch feedback ripple color. This has no effect unless `touchFeedback` is true. + */ + touchFeedbackColor: string; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Horizontal location of the view relative to its left position in pixels. + */ + translationX: number; + + /** + * Vertical location of the view relative to its top position in pixels. + */ + translationY: number; + + /** + * Depth of the view relative to its elevation in pixels. + */ + translationZ: number; + + /** + * A name to identify this view in activity transition. + */ + transitionName: string; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines whether to keep the device screen on. + */ + keepScreenOn: boolean; + + /** + * Color of the text in this SearchView, as a color name or hex triplet. + */ + color: string; + + /** + * Text to show when the search view field is not focused. + */ + hintText: string; + + /** + * Value of the search view. + */ + value: string; + + /** + * Iconifies or expands the search view + */ + iconified: boolean; + + /** + * Sets the default or resting state of the search view + */ + iconifiedByDefault: boolean; + + /** + * Whether to display the submit button when necessary or never display. + */ + submitEnabled: boolean; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Causes the search view to lose focus. + */ + blur(): void; + + /** + * Causes the search view to gain focus. + */ + focus(): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledColor(backgroundDisabledColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundDisabledImage(backgroundDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedColor(backgroundFocusedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundFocusedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundFocusedImage(backgroundFocusedImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedColor(backgroundSelectedColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundSelectedImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundSelectedImage(backgroundSelectedImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getElevation(): number; + + /** + * Sets the value of the property. + */ + setElevation(elevation: number): void; + + /** + * Gets the value of the property. + */ + getFocusable(): boolean; + + /** + * Sets the value of the property. + */ + setFocusable(focusable: boolean): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getHiddenBehavior(): number; + + /** + * Sets the value of the property. + */ + setHiddenBehavior(hiddenBehavior: number): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getOverrideCurrentAnimation(): boolean; + + /** + * Sets the value of the property. + */ + setOverrideCurrentAnimation(overrideCurrentAnimation: boolean): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getRotation(): number; + + /** + * Sets the value of the property. + */ + setRotation(rotation: number): void; + + /** + * Gets the value of the property. + */ + getRotationX(): number; + + /** + * Sets the value of the property. + */ + setRotationX(rotationX: number): void; + + /** + * Gets the value of the property. + */ + getRotationY(): number; + + /** + * Sets the value of the property. + */ + setRotationY(rotationY: number): void; + + /** + * Gets the value of the property. + */ + getScaleX(): number; + + /** + * Sets the value of the property. + */ + setScaleX(scaleX: number): void; + + /** + * Gets the value of the property. + */ + getScaleY(): number; + + /** + * Sets the value of the property. + */ + setScaleY(scaleY: number): void; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getSoftKeyboardOnFocus(): number; + + /** + * Sets the value of the property. + */ + setSoftKeyboardOnFocus(softKeyboardOnFocus: number): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedback(): boolean; + + /** + * Sets the value of the property. + */ + setTouchFeedback(touchFeedback: boolean): void; + + /** + * Gets the value of the property. + */ + getTouchFeedbackColor(): string; + + /** + * Sets the value of the property. + */ + setTouchFeedbackColor(touchFeedbackColor: string): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getTranslationX(): number; + + /** + * Sets the value of the property. + */ + setTranslationX(translationX: number): void; + + /** + * Gets the value of the property. + */ + getTranslationY(): number; + + /** + * Sets the value of the property. + */ + setTranslationY(translationY: number): void; + + /** + * Gets the value of the property. + */ + getTranslationZ(): number; + + /** + * Sets the value of the property. + */ + setTranslationZ(translationZ: number): void; + + /** + * Gets the value of the property. + */ + getTransitionName(): string; + + /** + * Sets the value of the property. + */ + setTransitionName(transitionName: string): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getKeepScreenOn(): boolean; + + /** + * Sets the value of the property. + */ + setKeepScreenOn(keepScreenOn: boolean): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getHintText(): string; + + /** + * Sets the value of the property. + */ + setHintText(hintText: string): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getIconified(): boolean; + + /** + * Sets the value of the property. + */ + setIconified(iconified: boolean): void; + + /** + * Gets the value of the property. + */ + getIconifiedByDefault(): boolean; + + /** + * Sets the value of the property. + */ + setIconifiedByDefault(iconifiedByDefault: boolean): void; + + /** + * Gets the value of the property. + */ + getSubmitEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setSubmitEnabled(submitEnabled: boolean): void; + + } + } - export interface MobileWeb { - forwardGeocoderTimeout : number; - locationTimeout : number; - maximumHeadingAge : number; - maximumLocationAge : number; - reverseGeocoderTimeout : number; - getForwardGeocoderTimeout () : number; - getLocationTimeout () : number; - getMaximumHeadingAge () : number; - getMaximumLocationAge () : number; - getReverseGeocoderTimeout () : number; - setForwardGeocoderTimeout (forwardGeocoderTimeout: number) : void; - setLocationTimeout (locationTimeout: number) : void; - setMaximumHeadingAge (maximumHeadingAge: number) : void; - setMaximumLocationAge (maximumLocationAge: number) : void; - setReverseGeocoderTimeout (reverseGeocoderTimeout: number) : void; + + /** + * A module used for accessing clipboard data. + */ + namespace Clipboard { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Create a new named clipboard. + */ + let name: string; + + /** + * Create a new clipboard identified by a unique system-generated name. + */ + let unique: boolean; + + /** + * Create a clipboard identified by name if it doesn't exist. + */ + let allowCreation: boolean; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Deletes data of the specified MIME type stored in the clipboard. If MIME type omitted, all + * data is deleted. + */ + function clearData(type?: string): void; + + /** + * Deletes all text data stored in the clipboard. + */ + function clearText(): void; + + /** + * Gets data of the specified MIME type stored in the clipboard. + */ + function getData(type: string): string | Titanium.Blob; + + /** + * Gets text data stored in the clipboard. + */ + function getText(): string; + + /** + * Indicates whether any data of the specified MIME type is stored in the clipboard. + */ + function hasData(type: string): boolean; + + /** + * Indicates whether any text data is stored in the clipboard. + */ + function hasText(): boolean; + + /** + * Indicates whether any URLs are stored in the clipboard. + */ + function hasURLs(): boolean; + + /** + * Indicates whether any images are stored in the clipboard. + */ + function hasImages(): boolean; + + /** + * Indicates whether any colors are stored in the clipboard. + */ + function hasColors(): boolean; + + /** + * Stores data of the specified MIME type in the clipboard. + */ + function setData(type: string, data: any): void; + + /** + * Stores text data in the clipboard. + */ + function setText(text: string): void; + + /** + * Adds an array of items to a clipboard, and sets privacy options for all included items. + */ + function setItems(items: ClipboardItemsType): void; + + /** + * Gets the items that have been specified earlier using . + */ + function getItems(): any[]; + + /** + * Removes the clipboard. + */ + function remove(): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getName(): string; + + /** + * Sets the value of the property. + */ + function setName(name: string): void; + + /** + * Gets the value of the property. + */ + function getUnique(): boolean; + + /** + * Sets the value of the property. + */ + function setUnique(unique: boolean): void; + + /** + * Gets the value of the property. + */ + function getAllowCreation(): boolean; + + /** + * Sets the value of the property. + */ + function setAllowCreation(allowCreation: boolean): void; + } - } - export interface Proxy { - apiName : string; - bubbleParent : boolean; - addEventListener (name: string, callback: (...args : any[]) => any) : void; - applyProperties (props: Dictionary) : void; - fireEvent (name: string, event: Dictionary) : void; - getApiName () : string; - getBubbleParent () : boolean; - removeEventListener (name: string, callback: (...args : any[]) => any) : void; - setBubbleParent (bubbleParent: boolean) : void; - } - export module Map { - export var ANNOTATION_DRAG_STATE_CANCEL : number; - export var ANNOTATION_DRAG_STATE_DRAG : number; - export var ANNOTATION_DRAG_STATE_END : number; - export var ANNOTATION_DRAG_STATE_NONE : number; - export var ANNOTATION_DRAG_STATE_START : number; - export var ANNOTATION_GREEN : number; - export var ANNOTATION_PURPLE : number; - export var ANNOTATION_RED : number; - export var HYBRID_TYPE : number; - export var SATELLITE_TYPE : number; - export var STANDARD_TYPE : number; - export var TERRAIN_TYPE : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createAnnotation (parameters?: Dictionary) : Ti.Map.Annotation; - export function createView (parameters?: Dictionary) : Ti.Map.View; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface View extends Ti.UI.View { - animated : boolean; - annotations : Array; - hideAnnotationWhenTouchMap : boolean; - latitudeDelta : number; - longitudeDelta : number; - mapType : number; - region : MapRegionType; - regionFit : boolean; - userLocation : boolean; - addAnnotation (annotation: Dictionary) : void; - addAnnotation (annotation: Ti.Map.Annotation) : void; - addAnnotations (annotations: Array) : void; - addAnnotations (annotations: Array>) : void; - addRoute (route: MapRouteType) : void; - deselectAnnotation (annotation: string) : void; - deselectAnnotation (annotation: Ti.Map.Annotation) : void; - getAnimate () : boolean; - getAnimated () : boolean; - getAnnotations () : Array; - getHideAnnotationWhenTouchMap () : boolean; - getLatitudeDelta () : number; - getLongitudeDelta () : number; - getMapType () : number; - getRegion () : MapRegionType; - getRegionFit () : boolean; - getUserLocation () : boolean; - removeAllAnnotations () : void; - removeAnnotation (annotation: string) : void; - removeAnnotation (annotation: Ti.Map.Annotation) : void; - removeAnnotations (annotations: Array) : void; - removeAnnotations (annotations: Array) : void; - removeRoute (route: MapRouteType) : void; - selectAnnotation (annotation: string) : void; - selectAnnotation (annotation: Ti.Map.Annotation) : void; - setAnimate (animate: boolean) : void; - setAnimated (animated: boolean) : void; - setAnnotations (annotations: Array) : void; - setHideAnnotationWhenTouchMap (hideAnnotationWhenTouchMap: boolean) : void; - setLocation (location: MapLocationType) : void; - setMapType (mapType: number) : void; - setRegion (region: MapRegionType) : void; - setRegionFit (regionFit: boolean) : void; - setUserLocation (userLocation: boolean) : void; - zoom (level: number) : void; - } - export interface Annotation extends Ti.Proxy { - animate : boolean; - canShowCallout : boolean; - centerOffset : Point; - customView : Ti.UI.View; - draggable : boolean; - image : any; - latitude : number; - leftButton : any; - leftView : Ti.UI.View; - longitude : number; - pinImage : string; - pincolor : number; - rightButton : any; - rightView : Ti.UI.View; - subtitle : string; - subtitleid : string; - title : string; - titleid : string; - getAnimate () : boolean; - getCanShowCallout () : boolean; - getCenterOffset () : Point; - getCustomView () : Ti.UI.View; - getDraggable () : boolean; - getImage () : any; - getLatitude () : number; - getLeftButton () : any; - getLeftView () : Ti.UI.View; - getLongitude () : number; - getPinImage () : string; - getPincolor () : number; - getRightButton () : any; - getRightView () : Ti.UI.View; - getSubtitle () : string; - getSubtitleid () : string; - getTitle () : string; - getTitleid () : string; - setAnimate (animate: boolean) : void; - setCanShowCallout (canShowCallout: boolean) : void; - setCenterOffset (centerOffset: Point) : void; - setCustomView (customView: Ti.UI.View) : void; - setDraggable (draggable: boolean) : void; - setImage (image: string) : void; - setImage (image: Ti.Blob) : void; - setLatitude (latitude: number) : void; - setLeftButton (leftButton: number) : void; - setLeftButton (leftButton: string) : void; - setLeftView (leftView: Ti.UI.View) : void; - setLongitude (longitude: number) : void; - setPinImage (pinImage: string) : void; - setPincolor (pincolor: number) : void; - setRightButton (rightButton: number) : void; - setRightButton (rightButton: string) : void; - setRightView (rightView: Ti.UI.View) : void; - setSubtitle (subtitle: string) : void; - setSubtitleid (subtitleid: string) : void; - setTitle (title: string) : void; - setTitleid (titleid: string) : void; - } - } - export module Cloud { - export var accessToken : string; - export var apiName : string; - export var bubbleParent : boolean; - export var debug : boolean; - export var expiresIn : number; - export var ondatastream : (...args : any[]) => any; - export var onsendstream : (...args : any[]) => any; - export var sessionId : string; - export var useSecure : boolean; - export function applyProperties (props: Dictionary) : void; - export function getAccessToken () : string; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getDebug () : boolean; - export function getExpiresIn () : number; - export function getOndatastream () : (...args : any[]) => any; - export function getOnsendstream () : (...args : any[]) => any; - export function getSessionId () : string; - export function getUseSecure () : boolean; - export function hasStoredSession () : boolean; - export function retrieveStoredSession () : string; - export function sendRequest (parameters: Dictionary, callback: (...args : any[]) => any) : void; - export function setAccessToken (accessToken: string) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setDebug (debug: boolean) : void; - export function setOndatastream (ondatastream: (...args : any[]) => any) : void; - export function setOnsendstream (onsendstream: (...args : any[]) => any) : void; - export function setSessionId (sessionId: string) : void; - export function setUseSecure (useSecure: boolean) : void; - export interface Objects { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface SocialIntegrations { - externalAccountLink (parameters: Dictionary, callback: (...args : any[]) => any) : void; - externalAccountLogin (parameters: Dictionary, callback: (...args : any[]) => any) : void; - externalAccountUnlink (parameters: Dictionary, callback: (...args : any[]) => any) : void; - searchFacebookFriends (callback: (...args : any[]) => any) : void; - } - export interface PushNotifications { - notify (parameters: Dictionary, callback: (...args : any[]) => any) : void; - notifyTokens (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters: Dictionary, callback: (...args : any[]) => any) : void; - queryChannels (parameters: Dictionary, callback: (...args : any[]) => any) : void; - resetBadge (parameters: Dictionary, callback: (...args : any[]) => any) : void; - setBadge (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showChannels (parameters: Dictionary, callback: (...args : any[]) => any) : void; - subscribe (parameters: Dictionary, callback: (...args : any[]) => any) : void; - subscribeToken (parameters: Dictionary, callback: (...args : any[]) => any) : void; - unsubscribe (parameters: Dictionary, callback: (...args : any[]) => any) : void; - unsubscribeToken (parameters: Dictionary, callback: (...args : any[]) => any) : void; - updateSubscription (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Clients { - geolocate (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - } - export interface ACLs { - addUser (parameters: Dictionary, callback: (...args : any[]) => any) : void; - checkUser (parameters: Dictionary, callback: (...args : any[]) => any) : void; - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - removeUser (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - } - export interface Users { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - login (parameters: Dictionary, callback: (...args : any[]) => any) : void; - logout (callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - requestResetPassword (parameters: Dictionary, callback: (...args : any[]) => any) : void; - resendConfirmation (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - secureCreate (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - secureLogin (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - secureStatus () : boolean; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showMe (callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Messages { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - removeThread (parameters: Dictionary, callback: (...args : any[]) => any) : void; - reply (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showInbox (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showSent (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showThread (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showThreads (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Events { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - queryOccurrences (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - searchOccurrences (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - show (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - showOccurrences (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Reviews { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Chats { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - getChatGroups (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - query (parameters: Dictionary, callback: (...args : any[]) => any) : void; - queryChatGroups (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface KeyValues { - append (parameters: Dictionary, callback: (...args : any[]) => any) : void; - get (parameters: Dictionary, callback: (...args : any[]) => any) : void; - increment (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - set (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface GeoFences { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Checkins { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Friends { - add (parameters: Dictionary, callback: (...args : any[]) => any) : void; - approve (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - requests (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Files { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface PushSchedules { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Likes { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Photos { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Statuses { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - delete (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - search (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface PhotoCollections { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showPhotos (parameters: Dictionary, callback: (...args : any[]) => any) : void; - showSubCollections (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Posts { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Emails { - send (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - export interface Places { - create (parameters: Dictionary, callback: (...args : any[]) => any) : void; - query (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - remove (parameters: Dictionary, callback: (...args : any[]) => any) : void; - search (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; - show (parameters: Dictionary, callback: (...args : any[]) => any) : void; - update (parameters: Dictionary, callback: (...args : any[]) => any) : void; - } - } - export interface Blob extends Ti.Proxy { - file : Ti.Filesystem.File; - height : number; - length : number; - mimeType : string; - nativePath : string; - size : number; - text : string; - width : number; - append (blob: Ti.Blob) : void; - getFile () : Ti.Filesystem.File; - getHeight () : number; - getLength () : number; - getMimeType () : string; - getNativePath () : string; - getSize () : number; - getText () : string; - getWidth () : number; - imageAsCropped (options: Dictionary) : Ti.Blob; - imageAsResized (width: number, height: number) : Ti.Blob; - imageAsThumbnail (size: number, borderSize?: number, cornerRadius?: number) : Ti.Blob; - imageWithAlpha () : Ti.Blob; - imageWithRoundedCorner (cornerSize: number, borderSize?: number) : Ti.Blob; - imageWithTransparentBorder (size: number) : Ti.Blob; - toString () : string; - } - export interface Codec { - BIG_ENDIAN : number; - CHARSET_ASCII : string; - CHARSET_ISO_LATIN_1 : string; - CHARSET_UTF16 : string; - CHARSET_UTF16BE : string; - CHARSET_UTF16LE : string; - CHARSET_UTF8 : string; - LITTLE_ENDIAN : number; - TYPE_BYTE : string; - TYPE_DOUBLE : string; - TYPE_FLOAT : string; - TYPE_INT : string; - TYPE_LONG : string; - TYPE_SHORT : string; - decodeNumber (options: DecodeNumberDict) : number; - decodeString (options: DecodeStringDict) : string; - encodeNumber (options: EncodeNumberDict) : number; - encodeString (options: Dictionary) : number; - getNativeByteOrder () : number; - } - export interface Locale { - currentCountry : string; - currentLanguage : string; - currentLocale : string; - formatTelephoneNumber (number: string) : string; - getCurrencyCode (locale: string) : string; - getCurrencySymbol (currencyCode: string) : string; - getCurrentCountry () : string; - getCurrentLanguage () : string; - getCurrentLocale () : string; - getLocaleCurrencySymbol (locale: string) : string; - getString (key: string, hint?: string) : string; - } - export module App { - export var EVENT_ACCESSIBILITY_ANNOUNCEMENT : string; - export var EVENT_ACCESSIBILITY_CHANGED : string; - export var accessibilityEnabled : boolean; - export var analytics : boolean; - export var apiName : string; - export var bubbleParent : boolean; - export var copyright : string; - export var deployType : string; - export var description : string; - export var disableNetworkActivityIndicator : boolean; - export var forceSplashAsSnapshot : boolean; - export var guid : string; - export var id : string; - export var idleTimerDisabled : boolean; - export var installId : string; - export var keyboardVisible : boolean; - export var name : string; - export var proximityDetection : boolean; - export var proximityState : boolean; - export var publisher : string; - export var sessionId : string; - export var url : string; - export var version : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function fireSystemEvent (eventName: string, param?: any) : void; - export function getAccessibilityEnabled () : boolean; - export function getAnalytics () : boolean; - export function getApiName () : string; - export function getArguments () : launchOptions; - export function getBubbleParent () : boolean; - export function getCopyright () : string; - export function getDeployType () : string; - export function getDescription () : string; - export function getDisableNetworkActivityIndicator () : boolean; - export function getForceSplashAsSnapshot () : boolean; - export function getGuid () : string; - export function getId () : string; - export function getIdleTimerDisabled () : boolean; - export function getInstallId () : string; - export function getKeyboardVisible () : boolean; - export function getName () : string; - export function getProximityDetection () : boolean; - export function getProximityState () : boolean; - export function getPublisher () : string; - export function getSessionId () : string; - export function getUrl () : string; - export function getVersion () : string; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setDisableNetworkActivityIndicator (disableNetworkActivityIndicator: boolean) : void; - export function setForceSplashAsSnapshot (forceSplashAsSnapshot: boolean) : void; - export function setIdleTimerDisabled (idleTimerDisabled: boolean) : void; - export function setProximityDetection (proximityDetection: boolean) : void; - export module Android { - export var R : Ti.App.Android.R; - export var apiName : string; - export var appVersionCode : number; - export var appVersionName : string; - export var bubbleParent : boolean; - export var launchIntent : Ti.Android.Intent; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getAppVersionCode () : number; - export function getAppVersionName () : string; - export function getBubbleParent () : boolean; - export function getLaunchIntent () : Ti.Android.Intent; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface R { + + /** + * Apple iOS specific UI capabilities. All properties, methods and events in this namespace will + * only work on Apple iOS devices. + */ + namespace iOS { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Automatically use the large out-of-line title based on the state of the p + * revious item in the navigation bar. + */ + const LARGE_TITLE_DISPLAY_MODE_AUTOMATIC: number; + + /** + * Always use a larger title when this item is top most. + */ + const LARGE_TITLE_DISPLAY_MODE_ALWAYS: number; + + /** + * Never use a larger title when this item is top most. + */ + const LARGE_TITLE_DISPLAY_MODE_NEVER: number; + + /** + * Include treatments so this image can be shown directly over the content + * of the Live Photo. + */ + const LIVEPHOTO_BADGE_OPTIONS_OVER_CONTENT: number; + + /** + * To indicate that the Live Photo aspect is turned off and it will + * be treated as a still (e.g. for sharing). + */ + const LIVEPHOTO_BADGE_OPTIONS_LIVE_OFF: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * slowly and speeds up. + */ + const ANIMATION_CURVE_EASE_IN: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * slowly, and speeds up, then slows down at the end of the animation. + */ + const ANIMATION_CURVE_EASE_IN_OUT: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts + * quickly, then slows down at the end of the animation. + */ + const ANIMATION_CURVE_EASE_OUT: number; + + /** + * Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that proceeds + * at a constant rate. + */ + const ANIMATION_CURVE_LINEAR: number; + + /** + * Use with to specify a font. + */ + const ATTRIBUTE_FONT: number; + + /** + * Use with to specify a font color. + */ + const ATTRIBUTE_FOREGROUND_COLOR: number; + + /** + * Use with to specify a background color. + */ + const ATTRIBUTE_BACKGROUND_COLOR: number; + + /** + * Use with to enable or disable ligatures. + */ + const ATTRIBUTE_LIGATURE: number; + + /** + * Use with to use a letterpress text effect. + */ + const ATTRIBUTE_LETTERPRESS_STYLE: number; + + /** + * Use with to specify kerning (space between characters). + */ + const ATTRIBUTE_KERN: number; + + /** + * Use with to place a horizontal line through the text. + */ + const ATTRIBUTE_STRIKETHROUGH_STYLE: number; + + /** + * Use with to place a horizontal line under the text. + */ + const ATTRIBUTE_UNDERLINES_STYLE: number; + + /** + * Use with to specify a color for the stroke text. + */ + const ATTRIBUTE_STROKE_COLOR: number; + + /** + * Use with to specify the width of the stroke text. + */ + const ATTRIBUTE_STROKE_WIDTH: number; + + /** + * Use with to display a shadow behind the text. + */ + const ATTRIBUTE_SHADOW: number; + + /** + * Use with to control the direction of the text. + */ + const ATTRIBUTE_WRITING_DIRECTION: number; + + /** + * Use with to apply a text effect. + */ + const ATTRIBUTE_TEXT_EFFECT: number; + + /** + * Use with to create a link. + */ + const ATTRIBUTE_LINK: number; + + /** + * Use with to apply a different baseline to the text. + */ + const ATTRIBUTE_BASELINE_OFFSET: number; + + /** + * Use with to change the color of the horizontal line. + */ + const ATTRIBUTE_UNDERLINE_COLOR: number; + + /** + * Use with to change the color of the horizontal line. + */ + const ATTRIBUTE_STRIKETHROUGH_COLOR: number; + + /** + * Use with to skew the text. + */ + const ATTRIBUTE_OBLIQUENESS: number; + + /** + * Use with to stretch the text horizontally. + */ + const ATTRIBUTE_EXPANSION: number; + + /** + * Use with to not draw a line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_NONE: number; + + /** + * Use with to draw a single line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_SINGLE: number; + + /** + * Use with to draw a thick line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_THICK: number; + + /** + * Use with to draw a double line. + */ + const ATTRIBUTE_UNDERLINE_STYLE_DOUBLE: number; + + /** + * Use with to draw a solid line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_SOLID: number; + + /** + * Use with to draw a dotted line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DOT: number; + + /** + * Use with to draw a dashed line. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH: number; + + /** + * Use with to draw an alternating line of dashes and dots. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT: number; + + /** + * Use with to draw an alternating line of dashes and two dots. + */ + const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT: number; + + /** + * Use with to draw a line only underneath or through words. + */ + const ATTRIBUTE_UNDERLINE_BY_WORD: number; + + /** + * Use with to use the embedded text direction. + */ + const ATTRIBUTE_WRITING_DIRECTION_EMBEDDING: number; + + /** + * Use with to override the text direction. + */ + const ATTRIBUTE_WRITING_DIRECTION_OVERRIDE: number; + + /** + * Use with to use the + * [Unicode Bidirection Algorithm rules P2 and P3](http://www.unicode.org/reports/tr9/#The_Paragraph_Level) + * to determine which direction to use. + */ + const ATTRIBUTE_WRITING_DIRECTION_NATURAL: number; + + /** + * Use with to write text left to right. + */ + const ATTRIBUTE_WRITING_DIRECTION_LEFT_TO_RIGHT: number; + + /** + * Use with to write text right to left. + */ + const ATTRIBUTE_WRITING_DIRECTION_RIGHT_TO_LEFT: number; + + /** + * Converts strings formatted as addresses into clickable links. + */ + const AUTODETECT_ADDRESS: number; + + /** + * Converts all detectable types of data into clickable links. + */ + const AUTODETECT_ALL: number; + + /** + * Converts strings formatted as calendar events into clickable links. + */ + const AUTODETECT_CALENDAR: number; + + /** + * Converts strings formatted as URLs into clickable links. + */ + const AUTODETECT_LINK: number; + + /** + * Disables converting strings into clickable links. + */ + const AUTODETECT_NONE: number; + + /** + * Converts strings formatted as phone numbers into clickable links. + */ + const AUTODETECT_PHONE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_CLEAR: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR_BURN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COLOR_DODGE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_COPY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DARKEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_ATOP: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_IN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_OUT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DESTINATION_OVER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_DIFFERENCE: number; + + /** + * Image mode constant. Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_EXCLUSION: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_HARD_LIGHT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_HUE: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_LIGHTEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_LUMINOSITY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_MULTIPLY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_NORMAL: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_OVERLAY: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_PLUS_DARKER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_PLUS_LIGHTER: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SATURATION: number; + + /** + * Image mode constant. Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SCREEN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOFT_LIGHT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_ATOP: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_IN: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_SOURCE_OUT: number; + + /** + * Use with [MaskedImage.mode](Titanium.UI.MaskedImage.mode) to specify a blend mode. + */ + const BLEND_MODE_XOR: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_EXTRA_LIGHT: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_LIGHT: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_DARK: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_REGULAR: number; + + /** + * Use with [BlurView.effect](Titanium.UI.iOS.BlurView.effect) to specify a blur effect. + */ + const BLUR_EFFECT_STYLE_PROMINENT: number; + + /** + * Use with [AdView.adSize](Titanium.UI.iOS.AdView.adSize) to specify a banner ad size + * appropriate for portrait orientations. + */ + const AD_SIZE_PORTRAIT: string; + + /** + * Use with [AdView.adSize](Titanium.UI.iOS.AdView.adSize) to specify a banner ad size + * appropriate for landscape orientations. + */ + const AD_SIZE_LANDSCAPE: string; + + /** + * Use with to specify clipping behavior. + */ + const CLIP_MODE_DEFAULT: number; + + /** + * Use with to specify clipping behavior. + */ + const CLIP_MODE_DISABLED: number; + + /** + * Use with to specify clipping behavior. + */ + const CLIP_MODE_ENABLED: number; + + /** + * Use with to specify collisions with both items and + * boundaries. + */ + const COLLISION_MODE_ALL: number; + + /** + * Use with to specify collisions with + * boundaries only. + */ + const COLLISION_MODE_BOUNDARY: number; + + /** + * Use with to specify collisions with items only. + */ + const COLLISION_MODE_ITEM: number; + + /** + * Returns the iOS system texture used to render the background on a group table view. + */ + const COLOR_GROUP_TABLEVIEW_BACKGROUND: string; + + /** + * Returns the iOS system texture used to render the area behind scrollable content. + */ + const COLOR_SCROLLVIEW_BACKGROUND: string; + + /** + * Returns the iOS system texture used for the back side of a view while it is being flipped. + */ + const COLOR_VIEW_FLIPSIDE_BACKGROUND: string; + + /** + * Returns the iOS system texture used to render the background of a page. + */ + const COLOR_UNDER_PAGE_BACKGROUND: string; + + /** + * Determines if the 3D-Touch capability "Force Touch" is supported (`true`) or not (`false`) by the device. + */ + const forceTouchSupported: boolean; + + /** + * The feedback type to be used when specifying a selection in . + */ + const FEEDBACK_GENERATOR_TYPE_SELECTION: number; + + /** + * The feedback type to be used when specifying an impact in . + */ + const FEEDBACK_GENERATOR_TYPE_IMPACT: number; + + /** + * The feedback type to be used when specifying a received notification in . + */ + const FEEDBACK_GENERATOR_TYPE_NOTIFICATION: number; + + /** + * The success notification type used as the argument in . + */ + const FEEDBACK_GENERATOR_NOTIFICATION_TYPE_SUCCESS: number; + + /** + * The warning notification type used as the argument in . + */ + const FEEDBACK_GENERATOR_NOTIFICATION_TYPE_WARNING: number; + + /** + * The error notification type used as the argument in . + */ + const FEEDBACK_GENERATOR_NOTIFICATION_TYPE_ERROR: number; + + /** + * The light impact style used as the `style` argument when creating a with the + * type . + */ + const FEEDBACK_GENERATOR_IMPACT_STYLE_LIGHT: number; + + /** + * The medium impact style used as the `style` argument when creating a with the + * type . + */ + const FEEDBACK_GENERATOR_IMPACT_STYLE_MEDIUM: number; + + /** + * The heavy impact style used as the `style` argument when creating a with the + * type . + */ + const FEEDBACK_GENERATOR_IMPACT_STYLE_HEAVY: number; + + /** + * Plays back the entire motion and sound content of the Live Photo, including transition + * effects at the start and end. + */ + const LIVEPHOTO_PLAYBACK_STYLE_FULL: number; + + /** + * Plays back only a brief section of the motion content of the Live Photo, without sound. + */ + const LIVEPHOTO_PLAYBACK_STYLE_HINT: number; + + /** + * An arrow that points upward. + */ + const MENU_POPUP_ARROW_DIRECTION_UP: number; + + /** + * An arrow that points downward. + */ + const MENU_POPUP_ARROW_DIRECTION_DOWN: number; + + /** + * An arrow that points toward the left. + */ + const MENU_POPUP_ARROW_DIRECTION_LEFT: number; + + /** + * An arrow that points toward the right. + */ + const MENU_POPUP_ARROW_DIRECTION_RIGHT: number; + + /** + * An arrow that is automatically aligned. + */ + const MENU_POPUP_ARROW_DIRECTION_DEFAULT: number; + + /** + * View presented with the same style as its parent window. + */ + let MODAL_PRESENTATION_CURRENT_CONTEXT: number; + + /** + * Window width and height are smaller than those of the screen and the view is centered on + * the screen. + */ + const MODAL_PRESENTATION_FORMSHEET: number; + + /** + * Window covers the screen. + */ + const MODAL_PRESENTATION_FULLSCREEN: number; + + /** + * Window height is the height of the screen and width is equal to screen width in a portrait + * orientation. + */ + const MODAL_PRESENTATION_PAGESHEET: number; + + /** + * When the window is presented, its view slides up from the bottom of the screen. On dismissal, + * the view slides back down (default.) + */ + const MODAL_TRANSITION_STYLE_COVER_VERTICAL: number; + + /** + * When the window is presented, the current view fades out while the new view fades in at the + * same time. On dismissal, a similar type of cross-fade is used to return to the original view. + */ + const MODAL_TRANSITION_STYLE_CROSS_DISSOLVE: number; + + /** + * When the window is presented, the current view initiates a horizontal 3D flip from + * right-to-left, resulting in the revealing of the new view as if it were on the back of the + * previous view. On dismissal, the flip occurs from left-to-right, returning to the original + * view. + */ + const MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL: number; + + /** + * When the window is presented, one corner of the current view curls up to reveal the modal + * view underneath. On dismissal, the curled up page unfurls itself back on top of the modal + * view. + */ + const MODAL_TRANSITION_STYLE_PARTIAL_CURL: number; + + /** + * Use with to specifiy a continuous force. + */ + const PUSH_MODE_CONTINUOUS: number; + + /** + * Use with to specifiy an instantaneous force. + */ + const PUSH_MODE_INSTANTANEOUS: number; + + /** + * The normal style for preview actions. + */ + const PREVIEW_ACTION_STYLE_DEFAULT: number; + + /** + * The selected style for preview actions. + */ + const PREVIEW_ACTION_STYLE_SELECTED: number; + + /** + * The destructive style for preview actions. + */ + const PREVIEW_ACTION_STYLE_DESTRUCTIVE: number; + + /** + * The default style for . + */ + const ROW_ACTION_STYLE_DEFAULT: number; + + /** + * The destructive style for . + */ + const ROW_ACTION_STYLE_DESTRUCTIVE: number; + + /** + * The normal style for . + */ + const ROW_ACTION_STYLE_NORMAL: number; + + /** + * Use with to control deceleration rate. + */ + const SCROLL_DECELERATION_RATE_FAST: number; + + /** + * Use with to control deceleration rate. + */ + const SCROLL_DECELERATION_RATE_NORMAL: number; + + /** + * Use with to control keyboard dismiss mode. + */ + const KEYBOARD_DISMISS_MODE_NONE: number; + + /** + * Use with to control keyboard dismiss mode. + */ + const KEYBOARD_DISMISS_MODE_ON_DRAG: number; + + /** + * Use with to control keyboard dismiss mode. + */ + const KEYBOARD_DISMISS_MODE_INTERACTIVE: number; + + /** + * Use with to change the search bar style. + */ + const SEARCH_BAR_STYLE_PROMINENT: number; + + /** + * Use with to change the search bar style. + */ + const SEARCH_BAR_STYLE_MINIMAL: number; + + /** + * User tapped a link. + */ + const WEBVIEW_NAVIGATIONTYPE_LINK_CLICKED: number; + + /** + * User submitted a form. + */ + const WEBVIEW_NAVIGATIONTYPE_FORM_SUBMITTED: number; + + /** + * User tapped the back or forward button. + */ + const WEBVIEW_NAVIGATIONTYPE_BACK_FORWARD: number; + + /** + * User tapped the reload button. + */ + const WEBVIEW_NAVIGATIONTYPE_RELOAD: number; + + /** + * User resubmitted a form. + */ + const WEBVIEW_NAVIGATIONTYPE_FORM_RESUBMITTED: number; + + /** + * Some other action occurred. + */ + const WEBVIEW_NAVIGATIONTYPE_OTHER: number; + + /** + * String that represents the magnifying glass on the table view index bar + */ + const TABLEVIEW_INDEX_SEARCH: string; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_COMPOSE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_PLAY: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_PAUSE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_ADD: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_LOCATION: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_SEARCH: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_SHARE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_PROHIBIT: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CONTACT: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_HOME: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_MARK_LOCATION: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_FAVORITE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_LOVE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CLOUD: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_INVITATION: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CONFIRMATION: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_MAIL: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_MESSAGE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_DATE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_TIME: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CAPTURE_PHOTO: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_CAPTURE_VIDEO: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_TASK: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_TASK_COMPLETED: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_ALARM: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_BOOKMARK: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_SHUFFLE: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_AUDIO: number; + + /** + * Number that represents the icon used for the application shortcut + */ + const SHORTCUT_ICON_TYPE_UPDATE: number; + + /** + * Value of the badge for the application's springboard icon. + */ + let appBadge: number; + + /** + * Determines whether the shake to edit system-wide capability is enabled. + */ + let appSupportsShakeToEdit: boolean; + + /** + * Sets the global status bar background color for the application. + */ + let statusBarBackgroundColor: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates a transition animation when opening or closing windows in a + * or . + */ + function createTransitionAnimation(transition: transitionAnimationParam): Titanium.Proxy; + + /** + * Creates a live photo badge to be used together with the + * API. + */ + function createLivePhotoBadge(type: number): Titanium.Blob; + + /** + * Creates and returns an instance of . + */ + function create3DMatrix(parameters?: any): Titanium.UI.iOS.Matrix3D; + + /** + * Creates and returns an instance of . + */ + function createAdView(parameters?: any): Titanium.UI.iOS.AdView; + + /** + * Creates and returns an instance of . + */ + function createAnchorAttachmentBehavior(parameters?: any): Titanium.UI.iOS.AnchorAttachmentBehavior; + + /** + * Creates and returns an instance of . + */ + function createAnimator(parameters?: any): Titanium.UI.iOS.Animator; + + /** + * Creates and returns an instance of . + */ + function createApplicationShortcuts(parameters?: any): Titanium.UI.iOS.ApplicationShortcuts; + + /** + * Creates and returns an instance of . + */ + function createAttribute(parameters?: any): Titanium.UI.iOS.Attribute; + + /** + * Creates and returns an instance of . + */ + function createAttributedString(parameters?: any): Titanium.UI.iOS.AttributedString; + + /** + * Creates and returns an instance of . + */ + function createBlurView(parameters?: any): Titanium.UI.iOS.BlurView; + + /** + * Creates and returns an instance of . + */ + function createCollisionBehavior(parameters?: any): Titanium.UI.iOS.CollisionBehavior; + + /** + * Creates and returns an instance of . + */ + function createCoverFlowView(parameters?: any): Titanium.UI.iOS.CoverFlowView; + + /** + * Creates and returns an instance of . + */ + function createDocumentViewer(parameters?: any): Titanium.UI.iOS.DocumentViewer; + + /** + * Creates and returns an instance of . + */ + function createDynamicItemBehavior(parameters?: any): Titanium.UI.iOS.DynamicItemBehavior; + + /** + * Creates and returns an instance of . + */ + function createFeedbackGenerator(parameters?: any): Titanium.UI.iOS.FeedbackGenerator; + + /** + * Creates and returns an instance of . + */ + function createGravityBehavior(parameters?: any): Titanium.UI.iOS.GravityBehavior; + + /** + * Creates and returns an instance of . + */ + function createLivePhotoView(parameters?: any): Titanium.UI.iOS.LivePhotoView; + + /** + * Creates and returns an instance of . + */ + function createMenuPopup(parameters?: any): Titanium.UI.iOS.MenuPopup; + + /** + * Creates and returns an instance of . + */ + function createNavigationWindow(parameters?: any): Titanium.UI.iOS.NavigationWindow; + + /** + * Creates and returns an instance of . + */ + function createPreviewAction(parameters?: any): Titanium.UI.iOS.PreviewAction; + + /** + * Creates and returns an instance of . + */ + function createPreviewActionGroup(parameters?: any): Titanium.UI.iOS.PreviewActionGroup; + + /** + * Creates and returns an instance of . + */ + function createPreviewContext(parameters?: any): Titanium.UI.iOS.PreviewContext; + + /** + * Creates and returns an instance of . + */ + function createPushBehavior(parameters?: any): Titanium.UI.iOS.PushBehavior; + + /** + * Creates and returns an instance of . + */ + function createSnapBehavior(parameters?: any): Titanium.UI.iOS.SnapBehavior; + + /** + * Creates and returns an instance of . + */ + function createSplitWindow(parameters?: any): Titanium.UI.iOS.SplitWindow; + + /** + * Creates and returns an instance of . + */ + function createStepper(parameters?: any): Titanium.UI.iOS.Stepper; + + /** + * Creates and returns an instance of . + */ + function createTabbedBar(parameters?: any): Titanium.UI.iOS.TabbedBar; + + /** + * Creates and returns an instance of . + */ + function createToolbar(parameters?: any): Titanium.UI.iOS.Toolbar; + + /** + * Creates and returns an instance of . + */ + function createViewAttachmentBehavior(parameters?: any): Titanium.UI.iOS.ViewAttachmentBehavior; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getForceTouchSupported(): boolean; + + /** + * Sets the value of the property. + */ + function setMODAL_PRESENTATION_CURRENT_CONTEXT(MODAL_PRESENTATION_CURRENT_CONTEXT: number): void; + + /** + * Gets the value of the property. + */ + function getAppBadge(): number; + + /** + * Sets the value of the property. + */ + function setAppBadge(appBadge: number): void; + + /** + * Gets the value of the property. + */ + function getAppSupportsShakeToEdit(): boolean; + + /** + * Sets the value of the property. + */ + function setAppSupportsShakeToEdit(appSupportsShakeToEdit: boolean): void; + + /** + * Gets the value of the property. + */ + function getStatusBarBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + function setStatusBarBackgroundColor(statusBarBackgroundColor: string): void; + + /** + * The 3D Matrix is an object for holding values for a 3D affine transform. + */ + interface Matrix3D extends Titanium.Proxy { + /** + * The entry at position [1,1] in the matrix. + */ + m11: number; + + /** + * The entry at position [1,2] in the matrix. + */ + m12: number; + + /** + * The entry at position [1,3] in the matrix. + */ + m13: number; + + /** + * The entry at position [1,4] in the matrix. + */ + m14: number; + + /** + * The entry at position [2,1] in the matrix. + */ + m21: number; + + /** + * The entry at position [2,2] in the matrix. + */ + m22: number; + + /** + * The entry at position [2,3] in the matrix. + */ + m23: number; + + /** + * The entry at position [2,4] in the matrix. + */ + m24: number; + + /** + * The entry at position [3,1] in the matrix. + */ + m31: number; + + /** + * The entry at position [3,2] in the matrix. + */ + m32: number; + + /** + * The entry at position [3,3] in the matrix. + */ + m33: number; + + /** + * The entry at position [3,4] in the matrix. + */ + m34: number; + + /** + * The entry at position [4,1] in the matrix. + */ + m41: number; + + /** + * The entry at position [4,2] in the matrix. + */ + m42: number; + + /** + * The entry at position [4,3] in the matrix. + */ + m43: number; + + /** + * The entry at position [4,4] in the matrix. + */ + m44: number; + + /** + * Returns a matrix constructed by inverting an existing matrix. + */ + invert(): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by combining two existing matrices. + */ + multiply(t2: Titanium.UI.Matrix3D): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by rotating an existing matrix. + */ + rotate(angle: number, x: number, y: number, z: number): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by scaling an existing matrix. + */ + scale(sx: number, sy: number, sz: number): Titanium.UI.Matrix3D; + + /** + * Returns a matrix constructed by translating an existing matrix. + */ + translate(tx: number, ty: number, tz: number): Titanium.UI.Matrix3D; + + /** + * Gets the value of the property. + */ + getM11(): number; + + /** + * Sets the value of the property. + */ + setM11(m11: number): void; + + /** + * Gets the value of the property. + */ + getM12(): number; + + /** + * Sets the value of the property. + */ + setM12(m12: number): void; + + /** + * Gets the value of the property. + */ + getM13(): number; + + /** + * Sets the value of the property. + */ + setM13(m13: number): void; + + /** + * Gets the value of the property. + */ + getM14(): number; + + /** + * Sets the value of the property. + */ + setM14(m14: number): void; + + /** + * Gets the value of the property. + */ + getM21(): number; + + /** + * Sets the value of the property. + */ + setM21(m21: number): void; + + /** + * Gets the value of the property. + */ + getM22(): number; + + /** + * Sets the value of the property. + */ + setM22(m22: number): void; + + /** + * Gets the value of the property. + */ + getM23(): number; + + /** + * Sets the value of the property. + */ + setM23(m23: number): void; + + /** + * Gets the value of the property. + */ + getM24(): number; + + /** + * Sets the value of the property. + */ + setM24(m24: number): void; + + /** + * Gets the value of the property. + */ + getM31(): number; + + /** + * Sets the value of the property. + */ + setM31(m31: number): void; + + /** + * Gets the value of the property. + */ + getM32(): number; + + /** + * Sets the value of the property. + */ + setM32(m32: number): void; + + /** + * Gets the value of the property. + */ + getM33(): number; + + /** + * Sets the value of the property. + */ + setM33(m33: number): void; + + /** + * Gets the value of the property. + */ + getM34(): number; + + /** + * Sets the value of the property. + */ + setM34(m34: number): void; + + /** + * Gets the value of the property. + */ + getM41(): number; + + /** + * Sets the value of the property. + */ + setM41(m41: number): void; + + /** + * Gets the value of the property. + */ + getM42(): number; + + /** + * Sets the value of the property. + */ + setM42(m42: number): void; + + /** + * Gets the value of the property. + */ + getM43(): number; + + /** + * Sets the value of the property. + */ + setM43(m43: number): void; + + /** + * Gets the value of the property. + */ + getM44(): number; + + /** + * Sets the value of the property. + */ + setM44(m44: number): void; + + } + + /** + * The AdView is a view for display Apple iAds. + */ + interface AdView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Size of the advertisement when minimized. + */ + adSize: string; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Cancel a banner to uncover the user interface. + */ + cancelAction(): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getAdSize(): string; + + /** + * Sets the value of the property. + */ + setAdSize(adSize: string): void; + + } + + /** + * Dynamic behavior to support connections between an anchor point and an item. + */ + interface AnchorAttachmentBehavior extends Titanium.Proxy { + /** + * Anchor point for the attachment behavior relative to the animator's coordinate system. + */ + anchor: Point; + + /** + * Amount of damping to apply to the attachment behavior. + */ + damping: number; + + /** + * Distance, in points, between the two attachment points. + */ + distance: number; + + /** + * Frequency of oscillation for the behavior. + */ + frequency: number; + + /** + * Item to connect to use the attachment behavior. + */ + item: Titanium.UI.View; + + /** + * Offset from the center point of the item for the attachment. + */ + offset: Point; + + /** + * Gets the value of the property. + */ + getAnchor(): Point; + + /** + * Sets the value of the property. + */ + setAnchor(anchor: Point): void; + + /** + * Gets the value of the property. + */ + getDamping(): number; + + /** + * Sets the value of the property. + */ + setDamping(damping: number): void; + + /** + * Gets the value of the property. + */ + getDistance(): number; + + /** + * Sets the value of the property. + */ + setDistance(distance: number): void; + + /** + * Gets the value of the property. + */ + getFrequency(): number; + + /** + * Sets the value of the property. + */ + setFrequency(frequency: number): void; + + /** + * Gets the value of the property. + */ + getItem(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setItem(item: any): void; + + /** + * Gets the value of the property. + */ + getOffset(): Point; + + /** + * Sets the value of the property. + */ + setOffset(offset: Point): void; + + } + + /** + * Provides support for the built-in iOS dynamic animations + */ + interface Animator extends Titanium.Proxy { + /** + * Behaviors associated with this animator. + */ + behaviors: Titanium.Proxy[]; + + /** + * Titanium View object to initialize as the reference view for the animator. + */ + referenceView: Titanium.UI.View; + + /** + * Returns `true` if the animator is running else `false`. + */ + readonly running: boolean; + + /** + * Adds a dynamic behavior to the animator. + */ + addBehavior(behavior: Titanium.Proxy): void; + + /** + * Removes all behaviors from this animator. + */ + removeAllBehaviors(): void; + + /** + * Removes the specified behavior from the animator. + */ + removeBehavior(behavior: Titanium.Proxy): void; + + /** + * Starts the animation behaviors. + */ + startAnimator(): void; + + /** + * Stops the animation behaviors. + */ + stopAnimator(): void; + + /** + * Updates the animator's state information with the current state of the specified item. + */ + updateItemUsingCurrentState(item: any): void; + + /** + * Gets the value of the property. + */ + getBehaviors(): Titanium.Proxy[]; + + /** + * Sets the value of the property. + */ + setBehaviors(behaviors: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getReferenceView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setReferenceView(referenceView: any): void; + + /** + * Gets the value of the property. + */ + getRunning(): boolean; + + } + + /** + * The Home screen quick actions API is for adding shortcuts to your app icon that anticipate and accelerate a + * user's interaction with your app. + */ + interface ApplicationShortcuts extends Titanium.Proxy { + /** + * Returns an array of the application shortcuts created dynamically. + */ + listDynamicShortcuts(): ShortcutParams[]; + + /** + * Returns an array of the application shortcuts listed in your tiapp.xml file. + */ + listStaticShortcuts(): ShortcutParams[]; + + /** + * Removes all dynamically created application shortcuts. + */ + removeAllDynamicShortcuts(): void; + + /** + * Returns true or false depending if the provided shortcut object already exists. + */ + dynamicShortcutExists(itemtype: string): boolean; + + /** + * Creates a new dynamic application shortcut item. + */ + addDynamicShortcut(params: ShortcutParams): void; + + /** + * Removes the dynamic application shortcut item identified by the `itemtype`. + */ + removeDynamicShortcut(itemtype: string): void; + + /** + * Gets the dynamic application shortcut item identified by the `itemtype`. + */ + getDynamicShortcut(itemtype: string): void; + + } + + /** + * An abstract datatype for specifying an attributed string attribute. + */ + interface Attribute extends Titanium.Proxy { + /** + * Attribute to apply to the text. + */ + type: number; + + /** + * Attribute value. + */ + value: number; + + /** + * Attribute range. + */ + range: number[]; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + /** + * Gets the value of the property. + */ + getValue(): number; + + /** + * Sets the value of the property. + */ + setValue(value: number): void; + + /** + * Gets the value of the property. + */ + getRange(): number[]; + + /** + * Sets the value of the property. + */ + setRange(range: ReadonlyArray): void; + + } + + /** + * An attributed string proxy manages character strings and associated sets of attributes (for example, + * font and kerning) that apply to individual characters or ranges of characters in the string. + */ + interface AttributedString extends Titanium.Proxy { + /** + * The text applied to the attributed string. + */ + text: string; + + /** + * An array of attributes to add. + */ + attributes: Attribute[]; + + /** + * Adds an [attribute](Attribute) with the given name and value to the characters in the specified range. + */ + addAttribute(attribute: Attribute): void; + + /** + * Gets the value of the property. + */ + getText(): string; + + /** + * Sets the value of the property. + */ + setText(text: string): void; + + /** + * Gets the value of the property. + */ + getAttributes(): Attribute[]; + + /** + * Sets the value of the property. + */ + setAttributes(attributes: ReadonlyArray): void; + + } + + /** + * A object gives you an easy way implement some complex visual effects. + * The blur effect is applied to every view the blur view is added to by default. You can also place the + * blur view above other views and all visible views layered under the blur view are blurred as well. + * For more information on BlurView, please refer to the official [Apple documentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIVisualEffectView/). + * Note: Apple introduced two new constants and in + * iOS 10. These are internally mapped to and . + */ + interface BlurView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * The effect you provide for the view. + */ + effect: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getEffect(): number; + + /** + * Sets the value of the property. + */ + setEffect(effect: number): void; + + } + + /** + * Dynamic behavior to support collisions between items and boundaries. + */ + interface CollisionBehavior extends Titanium.Proxy { + /** + * Boundary identfiers added to this behavior. + */ + readonly boundaryIdentifiers: BoundaryIdentifier[]; + + /** + * Specifies the collision behavior. + */ + collisionMode: number; + + /** + * Items added to this behavior. + */ + readonly items: Titanium.UI.View[]; + + /** + * Insets to apply when using the animator's reference view as the boundary. + */ + referenceInsets: ReferenceInsets; + + /** + * Use the animator's reference view as the boundary. + */ + treatReferenceAsBoundary: boolean; + + /** + * Adds a boundary to this behavior. + */ + addBoundary(boundary: BoundaryIdentifier): void; + + /** + * Adds an item to this behavior. + */ + addItem(item: any): void; + + /** + * Removes all boundaries from this behavior. + */ + removeAllBoundaries(): void; + + /** + * Removes the specified boundary from this behavior. + */ + removeBoundary(boundary: BoundaryIdentifier): void; + + /** + * Removes the specified item from this behavior. + */ + removeItem(item: any): void; + + /** + * Gets the value of the property. + */ + getBoundaryIdentifiers(): BoundaryIdentifier[]; + + /** + * Gets the value of the property. + */ + getCollisionMode(): number; + + /** + * Sets the value of the property. + */ + setCollisionMode(collisionMode: number): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getReferenceInsets(): ReferenceInsets; + + /** + * Sets the value of the property. + */ + setReferenceInsets(referenceInsets: ReferenceInsets): void; + + /** + * Gets the value of the property. + */ + getTreatReferenceAsBoundary(): boolean; + + /** + * Sets the value of the property. + */ + setTreatReferenceAsBoundary(treatReferenceAsBoundary: boolean): void; + + } + + /** + * The cover flow view is a container showing animated three-dimensional images in a style + * consistent with the cover flow presentation style used for iPod, iTunes, and file browsing. + */ + interface CoverFlowView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Images to display in the view. + */ + images: string[] | Titanium.Blob[] | Titanium.Filesystem.File[] | CoverFlowImageType[]; + + /** + * Index to make selected. + */ + selected: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: string): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: Titanium.Blob): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: Titanium.Filesystem.File): void; + + /** + * Changes the image for a specified index. + */ + setImage(index: number, image: CoverFlowImageType): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getImages(): string[] | Titanium.Blob[] | Titanium.Filesystem.File[] | CoverFlowImageType[]; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setImages(images: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSelected(): number; + + /** + * Sets the value of the property. + */ + setSelected(selected: number): void; + + } + + /** + * A DocumentViewer provides in-app support for managing user interactions with files on the + * local system. + */ + interface DocumentViewer extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Name of the file (without the path). + */ + readonly name: string; + + /** + * URL of the document being previewed. + */ + url: string; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Dismisses the document viewer. + */ + hide(options?: DocumentViewerOptions): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Displays the document viewer over the current view. + */ + show(options?: DocumentViewerOptions): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * Base dynamic configuration for an item. + */ + interface DynamicItemBehavior extends Titanium.Proxy { + /** + * Specifies if this item can rotate. + */ + allowsRotation: boolean; + + /** + * Specifies the angular resistance of this item. + */ + angularResistance: number; + + /** + * Specifies the relative mass density of this item. + */ + density: number; + + /** + * Specifies the elasticity applied to collisions for this item. + */ + elasticity: number; + + /** + * Specifies the linear resistance of the item when it slides against another item. + */ + friction: number; + + /** + * Items added to this behavior. + */ + readonly items: Titanium.UI.View[]; + + /** + * Specifies the linear resistance of this item which reduces linear velocity over time. + */ + resistance: number; + + /** + * Adds a specified angular velocity for the item. + */ + addAngularVelocityForItem(item: any, velocity: number): void; + + /** + * Adds an item to this behavior. + */ + addItem(item: any): void; + + /** + * Adds a specified linear velocity for the item. + */ + addLinearVelocityForItem(item: any, velocity: Point): void; + + /** + * Returns the angular velocity of the item. + */ + angularVelocityForItem(item: any): number; + + /** + * Returns the linear velocity of the item. + */ + linearVelocityForItem(item: any): Point; + + /** + * Removes the specified item from this behavior. + */ + removeItem(item: any): void; + + /** + * Gets the value of the property. + */ + getAllowsRotation(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsRotation(allowsRotation: boolean): void; + + /** + * Gets the value of the property. + */ + getAngularResistance(): number; + + /** + * Sets the value of the property. + */ + setAngularResistance(angularResistance: number): void; + + /** + * Gets the value of the property. + */ + getDensity(): number; + + /** + * Sets the value of the property. + */ + setDensity(density: number): void; + + /** + * Gets the value of the property. + */ + getElasticity(): number; + + /** + * Sets the value of the property. + */ + setElasticity(elasticity: number): void; + + /** + * Gets the value of the property. + */ + getFriction(): number; + + /** + * Sets the value of the property. + */ + setFriction(friction: number): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getResistance(): number; + + /** + * Sets the value of the property. + */ + setResistance(resistance: number): void; + + } + + /** + * The feedback generator API is introduced in iOS 10 to handle the haptic feedback when using an iPhone 7 or + * later devices. + */ + interface FeedbackGenerator extends Titanium.Proxy { + /** + * The type of feedback generator you want to create. + */ + type: number; + + /** + * Used to prepare the haptic sensor for the upcoming interaction with it. + */ + prepare(): void; + + /** + * Used to trigger a haptic feedback after a selection has been made. + */ + selectionChanged(): void; + + /** + * Used to trigger a haptic feedback after an impact occurred. + */ + impactOccurred(): void; + + /** + * Used to trigger a haptic feedback after a notification has been received. + */ + notificationOccurred(notificationType: number): void; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + } + + /** + * Gravitational force to apply to an item. + */ + interface GravityBehavior extends Titanium.Proxy { + /** + * Specifies the angle of the gravity vector in radians. + */ + angle: number; + + /** + * Specifies the direction of the gravity vector as an x, y pair. + */ + gravityDirection: Point; + + /** + * Items added to this behavior. + */ + readonly items: Titanium.UI.View[]; + + /** + * Specifies the magnitude of the gravity vector. + */ + magnitude: number; + + /** + * Adds an item to this behavior. + */ + addItem(item: any): void; + + /** + * Removes the specified item from this behavior. + */ + removeItem(item: any): void; + + /** + * Gets the value of the property. + */ + getAngle(): number; + + /** + * Sets the value of the property. + */ + setAngle(angle: number): void; + + /** + * Gets the value of the property. + */ + getGravityDirection(): Point; + + /** + * Sets the value of the property. + */ + setGravityDirection(gravityDirection: Point): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getMagnitude(): number; + + /** + * Sets the value of the property. + */ + setMagnitude(magnitude: number): void; + + } + + /** + * A set of constants for the style that can be used for the `selectionStyle` property of a + * ListItem, which is set in the `properties` dictionary of either the or + * . + */ + interface ListViewCellSelectionStyle extends Titanium.Proxy { + /** + * The cell when selected has a blue background. This is the default value. + */ + readonly BLUE: number; + + /** + * The cell when selected has a gray background. + */ + readonly GRAY: number; + + /** + * The cell has no distinct style for when it is selected. + */ + readonly NONE: number; + + } + + /** + * A set of constants for the position value that can be used for the `position` property of + * when invoking the ListView's `scrollToItem`, `appendSection`, + * `deleteSectionAt`, `insertSectionAt` and `replaceSectionAt` methods. + */ + interface ListViewScrollPosition extends Titanium.Proxy { + /** + * The list view scrolls the row of interest to the bottom of the visible list view. + */ + readonly BOTTOM: number; + + /** + * The list view scrolls the row of interest to the middle of the list table view. + */ + readonly MIDDLE: number; + + /** + * The table view scrolls the row of interest to be fully visible with a minimal movement. + * If the row is already fully visible, no scrolling occurs. For example, if the row is above the + * visible area, the behavior is identical to that specified by `TOP`. This is the default. + */ + readonly NONE: number; + + /** + * The list view scrolls the row of interest to the top of the visible list view. + */ + readonly TOP: number; + + } + + /** + * A set of constants for the style that can be used for the `style` property of + * . + */ + interface ListViewStyle extends Titanium.Proxy { + /** + * A list view whose sections present distinct groups of rows. The section headers and footers + * do not float. + */ + readonly GROUPED: number; + + /** + * A plain list view. Any section headers or footers are displayed as inline separators and + * float when the list view is scrolled. + */ + readonly PLAIN: number; + + } + + /** + * Abstract object representing a live photo used in . + */ + interface LivePhoto extends Titanium.Proxy { + } + + /** + * A view to display a object introduced in iOS 9.1. + */ + interface LivePhotoView extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * The Live Photo displayed in the view. + */ + livePhoto: Titanium.UI.iOS.LivePhoto; + + /** + * A Boolean value that determines whether the view plays the audio content of its Live Photo. + */ + muted: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Begins playback of Live Photo content in the view. + */ + startPlaybackWithStyle(playbackStyle: number): void; + + /** + * Ends playback of Live Photo content in the view. + */ + stopPlayback(): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getLivePhoto(): Titanium.UI.iOS.LivePhoto; + + /** + * Sets the value of the property. + */ + setLivePhoto(livePhoto: Titanium.UI.iOS.LivePhoto): void; + + /** + * Gets the value of the property. + */ + getMuted(): boolean; + + /** + * Sets the value of the property. + */ + setMuted(muted: boolean): void; + + } + + /** + * A menu popup provides the ability to create custom tooltip options using the `items` property + * covering the native `UIMenuController` class. + * See also: + * * [iOS Developer Library: UIMenuController](https://developer.apple.com/library/prerelease/ios/documentation/iPhone/Reference/UIMenuController_Class/index.html) + */ + interface MenuPopup extends Titanium.Proxy { + /** + * The items of the menu popup. + */ + items: string; + + /** + * Shows the menu popup. + */ + show(params: MenuPopupShowParams): void; + + /** + * Hides the menu popup. + */ + hide(params?: MenuPopupHideParams): void; + + /** + * Indicates whether the menu popup is currently visible. + */ + isVisible(): void; + + /** + * Gets the value of the property. + */ + getItems(): string; + + /** + * Sets the value of the property. + */ + setItems(items: string): void; + + } + + /** + * A `NavigationWindow` implements a specialized view that manages the navigation of hierarchical + * content. + */ + interface NavigationWindow extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the window, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * Window's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Window's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * The opacity from 0.0-1.0. + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * Window's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * Window's top position, in platform-specific units. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + */ + extendEdges: number[]; + + /** + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + */ + includeOpaqueBars: boolean; + + /** + * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + */ + autoAdjustScrollViewInsets: boolean; + + /** + * Specifies whether the content (subviews) of the window will render inside the safe-area or not. + * Only used in iOS 11.0 and later. + */ + extendSafeArea: boolean; + + /** + * Boolean value indicating if the window is fullscreen. + */ + fullscreen: boolean; + + /** + * Set this to true to hide the navigation bar on swipe. + */ + hidesBarsOnSwipe: boolean; + + /** + * Set this to true to hide the navigation bar on tap. + */ + hidesBarsOnTap: boolean; + + /** + * Set this to true to hide the navigation bar when the keyboard appears. + */ + hidesBarsWhenKeyboardAppears: boolean; + + /** + * A Boolean value indicating whether the title should be displayed in a large format. + */ + largeTitleEnabled: string; + + /** + * The mode to use when displaying the title of the navigation bar. + */ + largeTitleDisplayMode: number; + + /** + * An Array of views to show in the left nav bar area. + */ + leftNavButtons: Titanium.UI.View[]; + + /** + * Indicates to open a modal window or not. + */ + modal: boolean; + + /** + * Array of supported orientation modes, specified using the orientation + * constants defined in . + */ + orientationModes: number[]; + + /** + * Current orientation of the window. + */ + readonly orientation: number; + + /** + * An Array of views to show in the right nav bar area. + */ + rightNavButtons: Titanium.UI.View[]; + + /** + * The status bar style associated with this window. + */ + statusBarStyle: number; + + /** + * Title text attributes of the window. + */ + titleAttributes: titleAttributesParams; + + /** + * Window to add to this navigation window. + */ + window: Titanium.UI.Window; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Closes the window. + */ + close(params?: any): void; + + /** + * Hides the navigation bar. + */ + hideNavBar(options?: any): void; + + /** + * Opens the window. + */ + open(params?: openWindowParams): void; + + /** + * Makes the navigation bar visible. + */ + showNavBar(options?: any): void; + + /** + * Makes the bottom toolbar visible. + */ + showToolbar(options?: any): void; + + /** + * Makes the bottom toolbar invisible. + */ + hideToolbar(options?: any): void; + + /** + * Closes a window and removes it from the navigation window. + */ + closeWindow(window: Titanium.UI.Window, options: any): void; + + /** + * Opens a window within the navigation window. + */ + openWindow(window: Titanium.UI.Window, options: any): void; + + /** + * Closes all windows that are currently opened inside the navigation window. + */ + popToRootWindow(options: any): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getExtendEdges(): number[]; + + /** + * Sets the value of the property. + */ + setExtendEdges(extendEdges: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getIncludeOpaqueBars(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeOpaqueBars(includeOpaqueBars: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoAdjustScrollViewInsets(): boolean; + + /** + * Sets the value of the property. + */ + setAutoAdjustScrollViewInsets(autoAdjustScrollViewInsets: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendSafeArea(): boolean; + + /** + * Sets the value of the property. + */ + setExtendSafeArea(extendSafeArea: boolean): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnSwipe(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnSwipe(hidesBarsOnSwipe: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnTap(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnTap(hidesBarsOnTap: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsWhenKeyboardAppears(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + + /** + * Gets the value of the property. + */ + getLargeTitleEnabled(): string; + + /** + * Sets the value of the property. + */ + setLargeTitleEnabled(largeTitleEnabled: string): void; + + /** + * Gets the value of the property. + */ + getLargeTitleDisplayMode(): number; + + /** + * Sets the value of the property. + */ + setLargeTitleDisplayMode(largeTitleDisplayMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setLeftNavButtons(leftNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getModal(): boolean; + + /** + * Sets the value of the property. + */ + setModal(modal: boolean): void; + + /** + * Gets the value of the property. + */ + getOrientationModes(): number[]; + + /** + * Sets the value of the property. + */ + setOrientationModes(orientationModes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrientation(): number; + + /** + * Gets the value of the property. + */ + getRightNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setRightNavButtons(rightNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getStatusBarStyle(): number; + + /** + * Sets the value of the property. + */ + setStatusBarStyle(statusBarStyle: number): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getWindow(): Titanium.UI.Window; + + /** + * Sets the value of the property. + */ + setWindow(window: Titanium.UI.Window): void; + + } + + /** + * A PreviewAction provides options to configure actions used by the iOS 9 3D-Touch "Peek and Pop" + * feature. + */ + interface PreviewAction extends Titanium.Proxy { + /** + * The title of the action. + */ + title: string; + + /** + * The style of the action. + */ + style: number; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * A PreviewActionGroup provides options to configure a group of actions used by the iOS9 3D-Touch + * feature "Peek and Pop". + */ + interface PreviewActionGroup extends Titanium.Proxy { + /** + * The title of the action group. + */ + title: string; + + /** + * The style of the action group. + */ + style: number; + + /** + * The preview actions assigned to this preview action group. + */ + actions: Titanium.UI.iOS.PreviewAction[]; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + /** + * Gets the value of the property. + */ + getActions(): Titanium.UI.iOS.PreviewAction[]; + + /** + * Sets the value of the property. + */ + setActions(actions: ReadonlyArray): void; + + } + + /** + * A PreviewContext provides options to configure the iOS 9 3D-Touch "Peek and Pop" feature. + */ + interface PreviewContext extends Titanium.Proxy { + /** + * The preview actions and preview action groups. + */ + actions: Titanium.UI.iOS.PreviewAction[]; + + /** + * The height of the preview. + */ + contentHeight: number; + + /** + * The preview view. + */ + preview: Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getActions(): Titanium.UI.iOS.PreviewAction[]; + + /** + * Sets the value of the property. + */ + setActions(actions: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getContentHeight(): number; + + /** + * Sets the value of the property. + */ + setContentHeight(contentHeight: number): void; + + /** + * Gets the value of the property. + */ + getPreview(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setPreview(preview: any): void; + + } + + /** + * Continuous or instantaneous force to apply to an item. + */ + interface PushBehavior extends Titanium.Proxy { + /** + * State of the push behavior's force. + */ + active: boolean; + + /** + * Specifies the angle of the force vector in radians. + */ + angle: number; + + /** + * Items added to this behavior. + */ + readonly items: Titanium.UI.View[]; + + /** + * Specifies the magnitude of the force vector. + */ + magnitude: number; + + /** + * Specifies the direction of the force vector as an x, y pair. + */ + pushDirection: Point; + + /** + * Specifies the push mode. + */ + pushMode: number; + + /** + * Adds an item to this behavior. + */ + addItem(item: any): void; + + /** + * Removes the specified item from this behavior. + */ + removeItem(item: any): void; + + /** + * Gets the value of the property. + */ + getActive(): boolean; + + /** + * Sets the value of the property. + */ + setActive(active: boolean): void; + + /** + * Gets the value of the property. + */ + getAngle(): number; + + /** + * Sets the value of the property. + */ + setAngle(angle: number): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getMagnitude(): number; + + /** + * Sets the value of the property. + */ + setMagnitude(magnitude: number): void; + + /** + * Gets the value of the property. + */ + getPushDirection(): Point; + + /** + * Sets the value of the property. + */ + setPushDirection(pushDirection: Point): void; + + /** + * Gets the value of the property. + */ + getPushMode(): number; + + /** + * Sets the value of the property. + */ + setPushMode(pushMode: number): void; + + } + + /** + * Dynamic behavior defining an item's movement to a specific point. + */ + interface SnapBehavior extends Titanium.Proxy { + /** + * Specifies the amount of oscillation during the conclusion of the snap. + */ + damping: number; + + /** + * Item to add to this behavior. + */ + item: Titanium.UI.View; + + /** + * Specifies the point to snap to. + */ + snapPoint: Point; + + /** + * Gets the value of the property. + */ + getDamping(): number; + + /** + * Sets the value of the property. + */ + setDamping(damping: number): void; + + /** + * Gets the value of the property. + */ + getItem(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setItem(item: any): void; + + /** + * Gets the value of the property. + */ + getSnapPoint(): Point; + + /** + * Sets the value of the property. + */ + setSnapPoint(snapPoint: Point): void; + + } + + /** + * A SplitWindow is a window that manages the presentation of two side-by-side view + * controllers. + */ + interface SplitWindow extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the window, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * Window's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Window's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * The opacity from 0.0-1.0. + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * Window's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * Window's top position, in platform-specific units. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Title for the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitle: string; + + /** + * The image to show as the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitleImage: string | Titanium.Blob; + + /** + * Background color for the nav bar, as a color name or hex triplet. + */ + barColor: string; + + /** + * Background image for the nav bar, specified as a URL to a local image. + */ + barImage: string; + + /** + * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + */ + extendEdges: number[]; + + /** + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + */ + includeOpaqueBars: boolean; + + /** + * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + */ + autoAdjustScrollViewInsets: boolean; + + /** + * Specifies whether the content (subviews) of the window will render inside the safe-area or not. + * Only used in iOS 11.0 and later. + */ + extendSafeArea: boolean; + + /** + * Boolean value indicating if the window is fullscreen. + */ + fullscreen: boolean; + + /** + * Set this to true to hide the shadow image of the navigation bar. + */ + hideShadow: boolean; + + /** + * Set this to true to hide the navigation bar on swipe. + */ + hidesBarsOnSwipe: boolean; + + /** + * Set this to true to hide the navigation bar on tap. + */ + hidesBarsOnTap: boolean; + + /** + * Set this to true to hide the navigation bar when the keyboard appears. + */ + hidesBarsWhenKeyboardAppears: boolean; + + /** + * A Boolean value indicating whether the title should be displayed in a large format. + */ + largeTitleEnabled: string; + + /** + * The mode to use when displaying the title of the navigation bar. + */ + largeTitleDisplayMode: number; + + /** + * View to show in the left nav bar area. + */ + leftNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the left nav bar area. + */ + leftNavButtons: Titanium.UI.View[]; + + /** + * Indicates to open a modal window or not. + */ + modal: boolean; + + /** + * Hides the navigation bar (`true`) or shows the navigation bar (`false`). + */ + navBarHidden: boolean; + + /** + * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + */ + navTintColor: string; + + /** + * Array of supported orientation modes, specified using the orientation + * constants defined in . + */ + orientationModes: number[]; + + /** + * Current orientation of the window. + */ + readonly orientation: number; + + /** + * View to show in the right nav bar area. + */ + rightNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the right nav bar area. + */ + rightNavButtons: Titanium.UI.View[]; + + /** + * Shadow image for the navigation bar, specified as a URL to a local image.. + */ + shadowImage: string; + + /** + * The status bar style associated with this window. + */ + statusBarStyle: number; + + /** + * Boolean value indicating if the tab bar should be hidden. + */ + tabBarHidden: boolean; + + /** + * Title of the window. + */ + title: string; + + /** + * Title text attributes of the window. + */ + titleAttributes: titleAttributesParams; + + /** + * View to show in the title area of the nav bar. + */ + titleControl: Titanium.UI.View; + + /** + * Image to show in the title area of the nav bar, specified as a local file path or URL. + */ + titleImage: string; + + /** + * Title prompt for the window. + */ + titlePrompt: string; + + /** + * Key identifying a string from the locale file to use for the window title. + */ + titleid: string; + + /** + * Key identifying a string from the locale file to use for the window title prompt. + */ + titlepromptid: string; + + /** + * Array of button objects to show in the window's toolbar. + */ + toolbar: any[]; + + /** + * Boolean value indicating if the nav bar is translucent. + */ + translucent: boolean; + + /** + * Loads a JavaScript file from a local URL. + */ + url: string; + + /** + * View for the detail view section of the SplitWindow. + */ + detailView: Titanium.UI.View; + + /** + * View for the master view section of the SplitWindow. + */ + masterView: Titanium.UI.View; + + /** + * Determines whether to show the master view in portrait orientation. + */ + showMasterInPortrait: boolean; + + /** + * Determines whether to show the master view is overlayed in portrait orientation. + */ + masterIsOverlayed: boolean; + + /** + * Determines the width of the `masterView` in portrait mode. + */ + portraitSplit: number; + + /** + * Determines the width of the `masterView` in landscape mode. + */ + landscapeSplit: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Closes the window. + */ + close(params?: any): void; + + /** + * Hides the navigation bar. + */ + hideNavBar(options?: any): void; + + /** + * Hides the tab bar. Must be called before opening the window. + */ + hideTabBar(): void; + + /** + * Opens the window. + */ + open(params?: openWindowParams): void; + + /** + * Sets the array of items to show in the window's toolbar. + */ + setToolbar(items: ReadonlyArray, params?: windowToolbarParam): void; + + /** + * Makes the navigation bar visible. + */ + showNavBar(options?: any): void; + + /** + * Makes the bottom toolbar visible. + */ + showToolbar(options?: any): void; + + /** + * Makes the bottom toolbar invisible. + */ + hideToolbar(options?: any): void; + + /** + * Sets the value of the [showMasterInPortrait](Titanium.UI.iOS.SplitWindow.showMasterInPortrait) property. + */ + setShowMasterInPortrait(showMasterInPortrait: boolean, animated?: animationOption): void; + + /** + * Sets the value of the [masterIsOverlayed](Titanium.UI.iOS.SplitWindow.masterIsOverlayed) property. + */ + setMasterIsOverlayed(masterIsOverlayed: boolean, animated?: animationOption): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setBackButtonTitle(backButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitleImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: string): void; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getBarImage(): string; + + /** + * Sets the value of the property. + */ + setBarImage(barImage: string): void; + + /** + * Gets the value of the property. + */ + getExtendEdges(): number[]; + + /** + * Sets the value of the property. + */ + setExtendEdges(extendEdges: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getIncludeOpaqueBars(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeOpaqueBars(includeOpaqueBars: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoAdjustScrollViewInsets(): boolean; + + /** + * Sets the value of the property. + */ + setAutoAdjustScrollViewInsets(autoAdjustScrollViewInsets: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendSafeArea(): boolean; + + /** + * Sets the value of the property. + */ + setExtendSafeArea(extendSafeArea: boolean): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHideShadow(): boolean; + + /** + * Sets the value of the property. + */ + setHideShadow(hideShadow: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnSwipe(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnSwipe(hidesBarsOnSwipe: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnTap(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnTap(hidesBarsOnTap: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsWhenKeyboardAppears(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + + /** + * Gets the value of the property. + */ + getLargeTitleEnabled(): string; + + /** + * Sets the value of the property. + */ + setLargeTitleEnabled(largeTitleEnabled: string): void; + + /** + * Gets the value of the property. + */ + getLargeTitleDisplayMode(): number; + + /** + * Sets the value of the property. + */ + setLargeTitleDisplayMode(largeTitleDisplayMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftNavButton(leftNavButton: any): void; + + /** + * Gets the value of the property. + */ + getLeftNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setLeftNavButtons(leftNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getModal(): boolean; + + /** + * Sets the value of the property. + */ + setModal(modal: boolean): void; + + /** + * Gets the value of the property. + */ + getNavBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setNavBarHidden(navBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getNavTintColor(): string; + + /** + * Sets the value of the property. + */ + setNavTintColor(navTintColor: string): void; + + /** + * Gets the value of the property. + */ + getOrientationModes(): number[]; + + /** + * Sets the value of the property. + */ + setOrientationModes(orientationModes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrientation(): number; + + /** + * Gets the value of the property. + */ + getRightNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightNavButton(rightNavButton: any): void; + + /** + * Gets the value of the property. + */ + getRightNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setRightNavButtons(rightNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getShadowImage(): string; + + /** + * Sets the value of the property. + */ + setShadowImage(shadowImage: string): void; + + /** + * Gets the value of the property. + */ + getStatusBarStyle(): number; + + /** + * Sets the value of the property. + */ + setStatusBarStyle(statusBarStyle: number): void; + + /** + * Gets the value of the property. + */ + getTabBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setTabBarHidden(tabBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getTitleControl(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setTitleControl(titleControl: any): void; + + /** + * Gets the value of the property. + */ + getTitleImage(): string; + + /** + * Sets the value of the property. + */ + setTitleImage(titleImage: string): void; + + /** + * Gets the value of the property. + */ + getTitlePrompt(): string; + + /** + * Sets the value of the property. + */ + setTitlePrompt(titlePrompt: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getTitlepromptid(): string; + + /** + * Sets the value of the property. + */ + setTitlepromptid(titlepromptid: string): void; + + /** + * Gets the value of the property. + */ + getToolbar(): any[]; + + /** + * Sets the value of the property. + */ + setToolbar(toolbar: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getDetailView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setDetailView(detailView: any): void; + + /** + * Gets the value of the property. + */ + getMasterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setMasterView(masterView: any): void; + + /** + * Gets the value of the property. + */ + getShowMasterInPortrait(): boolean; + + /** + * Sets the value of the property. + */ + setShowMasterInPortrait(showMasterInPortrait: boolean): void; + + /** + * Gets the value of the property. + */ + getMasterIsOverlayed(): boolean; + + /** + * Sets the value of the property. + */ + setMasterIsOverlayed(masterIsOverlayed: boolean): void; + + /** + * Gets the value of the property. + */ + getPortraitSplit(): number; + + /** + * Sets the value of the property. + */ + setPortraitSplit(portraitSplit: number): void; + + /** + * Gets the value of the property. + */ + getLandscapeSplit(): number; + + /** + * Sets the value of the property. + */ + setLandscapeSplit(landscapeSplit: number): void; + + } + + /** + * A widget used to increment and decrement a value. + */ + interface Stepper extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the stepper in its normal state, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * Sets the color for the widget, any backgroundImages added will be set to the same color. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Determines if the stepper is enabled or disabled. + */ + enabled: boolean; + + /** + * The current value of the stepper. + */ + value: number; + + /** + * If YES, value change events are sent immediately when the value changes during user interaction. + * If NO, a value change event is sent when user interaction ends. + * The default value is YES. + */ + continuous: boolean; + + /** + * If YES, the user pressing and holding on the stepper repeatedly alters value. + * The default value is YES. + */ + autorepeat: boolean; + + /** + * If YES, incrementing beyond sets value to . likewise, decrementing below + * sets value to . If NO, the stepper does not increment beyond nor + * does it decrement below but rather holds at those values. + * The default value is NO. + */ + wraps: boolean; + + /** + * The minimum value the stepper will be set to, the value must be smaller than the maximum value. + * If you attempt to set a value equal to or greater than maximum, the system will default the + * value to 0. + */ + minimum: number; + + /** + * The maximum value the stepper will be set to, the value must be greater than the minimum value. + * If you attempt to set a value equal to or lower than minimum, the system will default the + * value to 100. + */ + maximum: number; + + /** + * The value the stepper will increment and decrement by, default value for this property is 1. When setting + * a new value, it must be greater than 1. + */ + steps: number; + + /** + * Background image for the stepper decrement button in its normal state, specified as a local + * file path or URL. + */ + decrementImage: string; + + /** + * Background image for the stepper decrement button in its disabled state, specified as a local + * file path or URL. The decrement button enters a disabled state ones the value is equal to the + * minimumValue , setting the enabled property to false will have no effect to decrement button state. + */ + decrementDisabledImage: string; + + /** + * Background image for the stepper increment button in its normal state, specified as a local + * file path or URL. + */ + incrementImage: string; + + /** + * Background image for the stepper increment button in its disabled state, specified as a local + * file path or URL.The increment button enters a disabled state ones the value is equal to the + * maximumValue , setting the enabled property to false will have no effect to increment button state. + */ + incrementDisabledImage: string; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setEnabled(enabled: boolean): void; + + /** + * Gets the value of the property. + */ + getValue(): number; + + /** + * Sets the value of the property. + */ + setValue(value: number): void; + + /** + * Gets the value of the property. + */ + getContinuous(): boolean; + + /** + * Sets the value of the property. + */ + setContinuous(continuous: boolean): void; + + /** + * Gets the value of the property. + */ + getAutorepeat(): boolean; + + /** + * Sets the value of the property. + */ + setAutorepeat(autorepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getWraps(): boolean; + + /** + * Sets the value of the property. + */ + setWraps(wraps: boolean): void; + + /** + * Gets the value of the property. + */ + getMinimum(): number; + + /** + * Sets the value of the property. + */ + setMinimum(minimum: number): void; + + /** + * Gets the value of the property. + */ + getMaximum(): number; + + /** + * Sets the value of the property. + */ + setMaximum(maximum: number): void; + + /** + * Gets the value of the property. + */ + getSteps(): number; + + /** + * Sets the value of the property. + */ + setSteps(steps: number): void; + + /** + * Gets the value of the property. + */ + getDecrementImage(): string; + + /** + * Sets the value of the property. + */ + setDecrementImage(decrementImage: string): void; + + /** + * Gets the value of the property. + */ + getDecrementDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setDecrementDisabledImage(decrementDisabledImage: string): void; + + /** + * Gets the value of the property. + */ + getIncrementImage(): string; + + /** + * Sets the value of the property. + */ + setIncrementImage(incrementImage: string): void; + + /** + * Gets the value of the property. + */ + getIncrementDisabledImage(): string; + + /** + * Sets the value of the property. + */ + setIncrementDisabledImage(incrementDisabledImage: string): void; + + } + + /** + * A button bar that maintains a selected state. + */ + interface TabbedBar extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Index of the currently selected button. + */ + index: number; + + /** + * Array of labels for the tabbed bar. + */ + labels: string[] | BarItemType[]; + + /** + * Style of the tabbed bar. + */ + style: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getIndex(): number; + + /** + * Sets the value of the property. + */ + setIndex(index: number): void; + + /** + * Gets the value of the property. + */ + getLabels(): string[] | BarItemType[]; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Sets the value of the property. + */ + setLabels(labels: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getStyle(): number; + + /** + * Sets the value of the property. + */ + setStyle(style: number): void; + + } + + /** + * An iOS toolbar, which can contain buttons and certain other controls. + */ + interface Toolbar extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * The preview context used in the 3D-Touch feature "Peek and Pop". + */ + previewContext: Titanium.UI.iOS.PreviewContext; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Background color for the toolbar, as a color name or hex triplet. + */ + barColor: string; + + /** + * An array of buttons (or other widgets) contained in the toolbar. + */ + items: Titanium.UI.View[]; + + /** + * If `true`, the background of the toolbar extends upwards. + */ + extendBackground: boolean; + + /** + * If `true`, a translucent background color is used for the toolbar. + */ + translucent: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getPreviewContext(): Titanium.UI.iOS.PreviewContext; + + /** + * Sets the value of the property. + */ + setPreviewContext(previewContext: Titanium.UI.iOS.PreviewContext): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setItems(items: any[]): void; + + /** + * Gets the value of the property. + */ + getExtendBackground(): boolean; + + /** + * Sets the value of the property. + */ + setExtendBackground(extendBackground: boolean): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + } + + /** + * Dynamic behavior to support connections between two items. + */ + interface ViewAttachmentBehavior extends Titanium.Proxy { + /** + * Item to use as the anchor in this behavior. + */ + anchorItem: Titanium.UI.View; + + /** + * Offset from the center point of the anchor item for the attachment. + */ + anchorOffset: Point; + + /** + * Amount of damping to apply to the attachment behavior. + */ + damping: number; + + /** + * Distance, in points, between the two attachment points. + */ + distance: number; + + /** + * Frequency of oscillation for the behavior. + */ + frequency: number; + + /** + * Item to connect to use the attachment behavior. + */ + item: Titanium.UI.View; + + /** + * Offset from the center point of the item for the attachment. + */ + itemOffset: Point; + + /** + * Gets the value of the property. + */ + getAnchorItem(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setAnchorItem(anchorItem: any): void; + + /** + * Gets the value of the property. + */ + getAnchorOffset(): Point; + + /** + * Sets the value of the property. + */ + setAnchorOffset(anchorOffset: Point): void; + + /** + * Gets the value of the property. + */ + getDamping(): number; + + /** + * Sets the value of the property. + */ + setDamping(damping: number): void; + + /** + * Gets the value of the property. + */ + getDistance(): number; + + /** + * Sets the value of the property. + */ + setDistance(distance: number): void; + + /** + * Gets the value of the property. + */ + getFrequency(): number; + + /** + * Sets the value of the property. + */ + setFrequency(frequency: number): void; + + /** + * Gets the value of the property. + */ + getItem(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setItem(item: any): void; + + /** + * Gets the value of the property. + */ + getItemOffset(): Point; + + /** + * Sets the value of the property. + */ + setItemOffset(itemOffset: Point): void; + + } + + + /** + * A set of constants for the style that can be used for the `style` property of + * . + */ + namespace AlertDialogStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A standard alert dialog. This is the default value. + */ + const DEFAULT: number; + + /** + * An alert dialog that allows the user to enter text. + */ + const PLAIN_TEXT_INPUT: number; + + /** + * An alert dialog that allows the user to enter text. The text field is obscured. + */ + const SECURE_TEXT_INPUT: number; + + /** + * An alert dialog that allows the user to enter login identifier and password. + */ + const LOGIN_AND_PASSWORD_INPUT: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the animation styles used for view transitions. + * One of the group of animation style constants + * * [CURL_DOWN](Titanium.UI.iOS.AnimationStyle.CURL_DOWN) + * * [CURL_UP](Titanium.UI.iOS.AnimationStyle.CURL_UP) + * * [FLIP_FROM_LEFT](Titanium.UI.iOS.AnimationStyle.FLIP_FROM_LEFT) + * * [FLIP_FROM_RIGHT](Titanium.UI.iOS.AnimationStyle.FLIP_FROM_RIGHT) + * * [FLIP_FROM_TOP](Titanium.UI.iOS.AnimationStyle.FLIP_FROM_TOP) + * * [FLIP_FROM_BOTTOM](Titanium.UI.iOS.AnimationStyle.FLIP_FROM_BOTTOM) + * * [CROSS_DISSOLVE](Titanium.UI.iOS.AnimationStyle.CROSS_DISSOLVE) + * * [NONE](Titanium.UI.iOS.AnimationStyle.NONE) + */ + namespace AnimationStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Curl downwards during a transition animation. + */ + const CURL_DOWN: number; + + /** + * Curl upwards during a transition animation. + */ + const CURL_UP: number; + + /** + * Flip from left to right during a transition animation. + */ + const FLIP_FROM_LEFT: number; + + /** + * Flip from right to left during a transition animation. + */ + const FLIP_FROM_RIGHT: number; + + /** + * Flip from top to bottom during a transition animation. + */ + const FLIP_FROM_TOP: number; + + /** + * Flip from bottom to top during a transition animation. + */ + const FLIP_FROM_BOTTOM: number; + + /** + * A transition that dissolves from one view to the next. + */ + const CROSS_DISSOLVE: number; + + /** + * No animation. + */ + const NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the bar styles used on the `style` property of . + */ + namespace ProgressBarStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The style of progress view that is used in a toolbar. + */ + const BAR: number; + + /** + * he standard progress-view style. This is the default. + */ + const DEFAULT: number; + + /** + * The standard progress-view style. Same as `DEFAULT`. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the Animation Styles used for transition on table view rows. + */ + namespace RowAnimationStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The inserted row or rows slides in from the bottom; the deleted row or rows slides out + * toward the bottom. + */ + const BOTTOM: number; + + /** + * The inserted or deleted row or rows fades into or out of the table view. + */ + const FADE: number; + + /** + * The inserted row or rows slides in from the left; the deleted row or rows slides out to the + * left. + */ + const LEFT: number; + + /** + * No animation is performed. The new cell value appears as if the cell had just been reloaded. + */ + const NONE: number; + + /** + * The inserted row or rows slides in from the right; the deleted row or rows slides out to + * the right. + */ + const RIGHT: number; + + /** + * The inserted row or rows slides in from the top; the deleted row or rows slides out toward + * the top. + */ + const TOP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the styles available for scrollbars used with and properties. + */ + namespace ScrollIndicatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A style of indicator which is black smaller than the default style. This style is good + * against a white content background. + */ + const BLACK: number; + + /** + * The default style of scroll indicator, which is black with a white border. This style is + * good against any content background. + */ + const DEFAULT: number; + + /** + * A style of indicator is white and smaller than the default style. This style is good against + * a black content background. + */ + const WHITE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the status bar style. + */ + namespace StatusBar { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * No animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_NONE: number; + + /** + * Slide animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_SLIDE: number; + + /** + * Fade animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_FADE: number; + + /** + * Default status bar style. + */ + const DEFAULT: number; + + /** + * Gray-colored status bar style. + */ + const GRAY: number; + + /** + * Gray-colored status bar style. + */ + const GREY: number; + + /** + * Status bar style to use with dark backgrounds. Valid on iOS 7 and above. + */ + const LIGHT_CONTENT: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for creating standard iOS system buttons. + */ + namespace SystemButton { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Action** button. + */ + const ACTION: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create an activity indicator that + * can be used in navigation bars and toolbars. + */ + const ACTIVITY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Add** button. + */ + const ADD: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Bookmarks** button. + */ + const BOOKMARKS: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Camera** button. + */ + const CAMERA: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Cancel** button. + */ + const CANCEL: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Compose** button. + */ + const COMPOSE: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a **ContactAdd** button. + */ + const CONTACT_ADD: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a **Disclosure** button. + */ + const DISCLOSURE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Done** button. + */ + const DONE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Edit** button. + */ + const EDIT: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Fast Forward** button. + */ + const FAST_FORWARD: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create a fixed-width blank space + * for spacing items in toolbars. + */ + const FIXED_SPACE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create a flexible blank space + * for spacing items in toolbars. + */ + const FLEXIBLE_SPACE: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a dark-colored **Info** button. + */ + const INFO_DARK: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a light-colored **Info** button. + */ + const INFO_LIGHT: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Organize** button. + */ + const ORGANIZE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Pause** button. + */ + const PAUSE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Play** button. + */ + const PLAY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Refresh** button. + */ + const REFRESH: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Reply** button. + */ + const REPLY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Rewind** button. + */ + const REWIND: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Save** button. + */ + const SAVE: number; + + /** + * Identical to [ACTIVITY](Titanium.UI.iOS.SystemButton.ACTIVITY). + */ + const SPINNER: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Stop** button. + */ + const STOP: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Trash** button. + */ + const TRASH: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the system button styles that can be used for the button `style` property. + */ + namespace SystemButtonStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A simple button style with a border. + */ + const BORDERED: number; + + /** + * The style for a **Done** button--for example, a button that completes some task and returns + * to the previous view. + */ + const DONE: number; + + /** + * Specifies a borderless button, the default style for toolbars, button bars, and tabbed bars. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the system icon styles that can be used on a tab group tab. + */ + namespace SystemIcon { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Bookmark style icon + */ + const BOOKMARKS: number; + + /** + * Contacts style icon + */ + const CONTACTS: number; + + /** + * Downloads style icon + */ + const DOWNLOADS: number; + + /** + * Favorites style icon + */ + const FAVORITES: number; + + /** + * Featured style icon + */ + const FEATURED: number; + + /** + * History style icon + */ + const HISTORY: number; + + /** + * More style icon + */ + const MORE: number; + + /** + * Most recent style icon + */ + const MOST_RECENT: number; + + /** + * Most viewed style icon + */ + const MOST_VIEWED: number; + + /** + * Recents style icon + */ + const RECENTS: number; + + /** + * Search style icon + */ + const SEARCH: number; + + /** + * Top rated style icon + */ + const TOP_RATED: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `selectionStyle` property of + * . + */ + namespace TableViewCellSelectionStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The cell when selected has a blue background. This is the default value. + */ + const BLUE: number; + + /** + * Then cell when selected has a gray background. + */ + const GRAY: number; + + /** + * The cell has no distinct style for when it is selected. + */ + const NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the position value that can be used for the `position` property of + * when invoking `scrollToIndex`. + */ + namespace TableViewScrollPosition { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The table view scrolls the row of interest to the bottom of the visible table view. + */ + const BOTTOM: number; + + /** + * The table view scrolls the row of interest to the middle of the visible table view. + */ + const MIDDLE: number; + + /** + * The table view scrolls the row of interest to be fully visible with a minimum of movement. If the row is already fully visible, no scrolling occurs. For example, if the row is above the visible area, the behavior is identical to that specified by `TOP`. This is the default. + */ + const NONE: number; + + /** + * The table view scrolls the row of interest to the top of the visible table view. + */ + const TOP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the button `style` property of + * . + */ + namespace TableViewStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A table view whose sections present distinct groups of rows. The section headers and footers + * do not float. + */ + const GROUPED: number; + + /** + * A plain table view. Any section headers or footers are displayed as inline separators and + * float when the table view is scrolled. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; } } - export module iOS { - export var BACKGROUNDFETCHINTERVAL_MIN : number; - export var BACKGROUNDFETCHINTERVAL_NEVER : number; - export var EVENT_ACCESSIBILITY_LAYOUT_CHANGED : string; - export var EVENT_ACCESSIBILITY_SCREEN_CHANGED : string; - export var USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND : number; - export var USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND : number; - export var USER_NOTIFICATION_TYPE_ALERT : number; - export var USER_NOTIFICATION_TYPE_BADGE : number; - export var USER_NOTIFICATION_TYPE_NONE : number; - export var USER_NOTIFICATION_TYPE_SOUND : number; - export var apiName : string; - export var applicationOpenSettingsURL : string; - export var bubbleParent : boolean; - export var currentUserNotificationSettings : UserNotificationSettings; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function cancelAllLocalNotifications () : void; - export function cancelLocalNotification (id: number) : void; - export function cancelLocalNotification (id: string) : void; - export function createUserNotificationAction (parameters?: Dictionary) : Ti.App.iOS.UserNotificationAction; - export function createUserNotificationCategory (parameters?: Dictionary) : Ti.App.iOS.UserNotificationCategory; - export function endBackgroundHandler (handlerID: string) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getApplicationOpenSettingsURL () : string; - export function getBubbleParent () : boolean; - export function getCurrentUserNotificationSettings () : UserNotificationSettings; - export function registerBackgroundService (params: Dictionary) : Ti.App.iOS.BackgroundService; - export function registerUserNotificationSettings (params: UserNotificationSettings) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function scheduleLocalNotification (params: NotificationParams) : Ti.App.iOS.LocalNotification; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setMinimumBackgroundFetchInterval (fetchInterval: number) : void; - export interface UserNotificationAction extends Ti.Proxy { - activationMode : number; - authenticationRequired : boolean; - destructive : boolean; - identifier : string; - title : string; - getActivationMode () : number; - getAuthenticationRequired () : boolean; - getDestructive () : boolean; - getIdentifier () : string; - getTitle () : string; + + /** + * iPad specific UI capabilities. + */ + namespace iPad { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * An arrow that points in any direction. + */ + const POPOVER_ARROW_DIRECTION_ANY: number; + + /** + * An arrow that points downward. + */ + const POPOVER_ARROW_DIRECTION_DOWN: number; + + /** + * An arrow that points toward the left. + */ + const POPOVER_ARROW_DIRECTION_LEFT: number; + + /** + * An arrow that points toward the right. + */ + const POPOVER_ARROW_DIRECTION_RIGHT: number; + + /** + * The status of the arrow is currently unknown. + */ + const POPOVER_ARROW_DIRECTION_UNKNOWN: number; + + /** + * An arrow that points upward. + */ + const POPOVER_ARROW_DIRECTION_UP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of . + */ + function createDocumentViewer(parameters?: any): Titanium.UI.iPad.DocumentViewer; + + /** + * Creates and returns an instance of . + */ + function createPopover(parameters?: any): Titanium.UI.iPad.Popover; + + /** + * Creates and returns an instance of . + */ + function createSplitWindow(parameters?: any): Titanium.UI.iPad.SplitWindow; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * A DocumentViewer provides in-app support for managing user interactions with files on the + * local system. + */ + interface DocumentViewer extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the view, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * View's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * View's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * Opacity of this view, from 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * View's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * The view's top position. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Removes all child views from this view's hierarchy. + */ + removeAllChildren(): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Displays the document viewer over the current view. + */ + show(animated: boolean, view: any): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Sets the url of the document viewer. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + } - export interface LocalNotification extends Ti.Proxy { - cancel () : void; + + /** + * A Popover is used to manage the presentation of content in a popover. + */ + interface Popover extends Titanium.Proxy { + /** + * Sets the background color of the popover. + */ + backgroundColor: string; + + /** + * Height of the popover. + */ + height: number | string; + + /** + * Width of the popover. + */ + width: number | string; + + /** + * Indicates the arrow direction of the popover. + */ + arrowDirection: number; + + /** + * View to use for the popover content. Must be set before calling the `show()` method. + */ + contentView: Titanium.UI.View; + + /** + * Left button in the navigation area of the popover. + */ + leftNavButton: any; + + /** + * Passthrough views to use when the popover is shown. + */ + passthroughViews: Titanium.UI.View[]; + + /** + * Right button in the navigation area of the popover. + */ + rightNavButton: any; + + /** + * Title of the navigation area of the popover. + */ + title: string; + + /** + * Adds a child to the popover. + */ + add(view: any): void; + + /** + * Adds a child to the popover. + */ + add(view: any[]): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides the popover. + */ + hide(options: PopoverParams): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child from the popover. + */ + remove(view: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Displays the popover. + */ + show(params: PopoverParams): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getArrowDirection(): number; + + /** + * Sets the value of the property. + */ + setArrowDirection(arrowDirection: number): void; + + /** + * Gets the value of the property. + */ + getContentView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setContentView(contentView: any): void; + + /** + * Gets the value of the property. + */ + getLeftNavButton(): any; + + /** + * Sets the value of the property. + */ + setLeftNavButton(leftNavButton: any): void; + + /** + * Gets the value of the property. + */ + getPassthroughViews(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setPassthroughViews(passthroughViews: any[]): void; + + /** + * Gets the value of the property. + */ + getRightNavButton(): any; + + /** + * Sets the value of the property. + */ + setRightNavButton(rightNavButton: any): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + } - export interface UserNotificationCategory extends Ti.Proxy { - actionsForDefaultContext : Array; - actionsForMinimalContext : Array; - identifier : string; - getActionsForDefaultContext () : Array; - getActionsForMinimalContext () : Array; - getIdentifier () : string; - } - export interface BackgroundService extends Ti.Proxy { - url : string; - getUrl () : string; - stop () : void; - unregister () : void; + + /** + * A SplitWindow is a window that manages the presentation of two side-by-side view + * controllers. + */ + interface SplitWindow extends Titanium.Proxy { + /** + * Whether the view should be "hidden" from (i.e., ignored by) the accessibility service. + */ + accessibilityHidden: boolean; + + /** + * Briefly describes what performing an action (such as a click) on the view will do. + */ + accessibilityHint: string; + + /** + * A succint label identifying the view for the device's accessibility service. + */ + accessibilityLabel: string; + + /** + * A string describing the value (if any) of the view for the device's accessibility service. + */ + accessibilityValue: string; + + /** + * Coordinate of the view about which to pivot an animation. + */ + anchorPoint: Point; + + /** + * Current position of the view during an animation. + */ + readonly animatedCenter: Point; + + /** + * Background color of the window, as a color name or hex triplet. + */ + backgroundColor: string; + + /** + * A background gradient for the view. + */ + backgroundGradient: Gradient; + + /** + * Background image for the view, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Determines whether to tile a background across a view. + */ + backgroundRepeat: boolean; + + /** + * Size of the left end cap. + */ + backgroundLeftCap: number; + + /** + * Size of the top end cap. + */ + backgroundTopCap: number; + + /** + * Border color of the view, as a color name or hex triplet. + */ + borderColor: string; + + /** + * Radius for the rounded corners of the view's border. + */ + borderRadius: number; + + /** + * Border width of the view. + */ + borderWidth: number; + + /** + * Window's bottom position, in platform-specific units. + */ + bottom: number | string; + + /** + * View's center position, in the parent view's coordinates. + */ + center: Point; + + /** + * Array of this view's child views. + */ + readonly children: Titanium.UI.View[]; + + /** + * View's clipping behavior. + */ + clipMode: number; + + /** + * View height, in platform-specific units. + */ + height: number | string; + + /** + * Window's left position, in platform-specific units. + */ + left: number | string; + + /** + * Specifies how the view positions its children. + * One of: 'composite', 'vertical', or 'horizontal'. + */ + layout: string; + + /** + * The opacity from 0.0-1.0. + */ + opacity: number; + + /** + * Background color of the wrapper view when this view is used as either or . + */ + pullBackgroundColor: string; + + /** + * Window's right position, in platform-specific units. + */ + right: number | string; + + /** + * The bounding box of the view relative to its parent, in system units. + */ + readonly rect: Dimension; + + /** + * The size of the view in system units. + */ + readonly size: Dimension; + + /** + * The view's tintColor. This property is applicable on iOS 7 and greater. + */ + tintColor: string; + + /** + * Window's top position, in platform-specific units. + */ + top: number | string; + + /** + * Determines whether view should receive touch events. + */ + touchEnabled: boolean; + + /** + * Transformation matrix to apply to the view. + */ + transform: Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Determines the blur radius used to create the shadow. + */ + viewShadowRadius: number; + + /** + * Determines the color of the shadow. + */ + viewShadowColor: string; + + /** + * Determines the offset for the shadow of the view. + */ + viewShadowOffset: Point; + + /** + * Determines whether the view is visible. + */ + visible: boolean; + + /** + * View's width, in platform-specific units. + */ + width: number | string; + + /** + * Determines whether the layout has wrapping behavior. + */ + horizontalWrap: boolean; + + /** + * Z-index stack order position, relative to other sibling views. + */ + zIndex: number; + + /** + * Title for the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitle: string; + + /** + * The image to show as the back button. This is only valid when the window is a child of a tab. + */ + backButtonTitleImage: string | Titanium.Blob; + + /** + * Background color for the nav bar, as a color name or hex triplet. + */ + barColor: string; + + /** + * Background image for the nav bar, specified as a URL to a local image. + */ + barImage: string; + + /** + * An array of supported values specified using the EXTEND_EDGE constants in . Valid on iOS 7 and greater. + */ + extendEdges: number[]; + + /** + * Specifies if the edges should extend beyond opaque bars (navigation bar, tab bar, toolbar). Valid on iOS 7 and greater. + */ + includeOpaqueBars: boolean; + + /** + * Specifies whether or not the view controller should automatically adjust its scroll view insets. Valid on iOS 7 and greater. + */ + autoAdjustScrollViewInsets: boolean; + + /** + * Specifies whether the content (subviews) of the window will render inside the safe-area or not. + * Only used in iOS 11.0 and later. + */ + extendSafeArea: boolean; + + /** + * Boolean value indicating if the window is fullscreen. + */ + fullscreen: boolean; + + /** + * Set this to true to hide the shadow image of the navigation bar. + */ + hideShadow: boolean; + + /** + * Set this to true to hide the navigation bar on swipe. + */ + hidesBarsOnSwipe: boolean; + + /** + * Set this to true to hide the navigation bar on tap. + */ + hidesBarsOnTap: boolean; + + /** + * Set this to true to hide the navigation bar when the keyboard appears. + */ + hidesBarsWhenKeyboardAppears: boolean; + + /** + * A Boolean value indicating whether the title should be displayed in a large format. + */ + largeTitleEnabled: string; + + /** + * The mode to use when displaying the title of the navigation bar. + */ + largeTitleDisplayMode: number; + + /** + * View to show in the left nav bar area. + */ + leftNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the left nav bar area. + */ + leftNavButtons: Titanium.UI.View[]; + + /** + * Indicates to open a modal window or not. + */ + modal: boolean; + + /** + * Hides the navigation bar (`true`) or shows the navigation bar (`false`). + */ + navBarHidden: boolean; + + /** + * The tintColor to apply to the navigation bar. This property is applicable on iOS 7 and greater. + */ + navTintColor: string; + + /** + * Array of supported orientation modes, specified using the orientation + * constants defined in . + */ + orientationModes: number[]; + + /** + * Current orientation of the window. + */ + readonly orientation: number; + + /** + * View to show in the right nav bar area. + */ + rightNavButton: Titanium.UI.View; + + /** + * An Array of views to show in the right nav bar area. + */ + rightNavButtons: Titanium.UI.View[]; + + /** + * Shadow image for the navigation bar, specified as a URL to a local image.. + */ + shadowImage: string; + + /** + * The status bar style associated with this window. + */ + statusBarStyle: number; + + /** + * Boolean value indicating if the tab bar should be hidden. + */ + tabBarHidden: boolean; + + /** + * Title of the window. + */ + title: string; + + /** + * Title text attributes of the window. + */ + titleAttributes: titleAttributesParams; + + /** + * View to show in the title area of the nav bar. + */ + titleControl: Titanium.UI.View; + + /** + * Image to show in the title area of the nav bar, specified as a local file path or URL. + */ + titleImage: string; + + /** + * Title prompt for the window. + */ + titlePrompt: string; + + /** + * Key identifying a string from the locale file to use for the window title. + */ + titleid: string; + + /** + * Key identifying a string from the locale file to use for the window title prompt. + */ + titlepromptid: string; + + /** + * Array of button objects to show in the window's toolbar. + */ + toolbar: any[]; + + /** + * Boolean value indicating if the nav bar is translucent. + */ + translucent: boolean; + + /** + * Loads a JavaScript file from a local URL. + */ + url: string; + + /** + * View for the detail view section of the SplitWindow. + */ + detailView: Titanium.UI.View; + + /** + * View for the master view section of the SplitWindow. + */ + masterView: Titanium.UI.View; + + /** + * Determines whether to show the master view in portrait orientation. + */ + showMasterInPortrait: boolean; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any): void; + + /** + * Adds a child to this view's hierarchy. + */ + add(view: any[]): void; + + /** + * Animates this view. + */ + animate(animation: any, callback?: (param0: any) => any): void; + + /** + * Finishes a batch update of the View's layout properties and schedules a layout pass of the + * view tree. + */ + finishLayout(): void; + + /** + * Hides this view. + */ + hide(options?: AnimationOption): void; + + /** + * Inserts a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + insertAt(params: any): void; + + /** + * Removes a child view from this view's hierarchy. + */ + remove(view: any): void; + + /** + * Replaces a view at the specified position in the [children](Titanium.UI.View.children) array. + */ + replaceAt(params: any): void; + + /** + * Makes this view visible. + */ + show(options?: AnimationOption): void; + + /** + * Starts a batch update of this view's layout properties. + */ + startLayout(): void; + + /** + * Returns an image of the rendered view, as a Blob. + */ + toImage(callback?: (param0: Titanium.Blob) => any, honorScaleFactor?: boolean): Titanium.Blob; + + /** + * Performs a batch update of all supplied layout properties and schedules a layout pass after + * they have been updated. + */ + updateLayout(params: any): void; + + /** + * Translates a point from this view's coordinate system to another view's coordinate system. + */ + convertPointToView(point: Point, destinationView: any): Point; + + /** + * Returns the matching view of a given view ID. + */ + getViewById(id: string): Titanium.UI.View; + + /** + * Closes the window. + */ + close(params?: any): void; + + /** + * Hides the navigation bar. + */ + hideNavBar(options?: any): void; + + /** + * Hides the tab bar. Must be called before opening the window. + */ + hideTabBar(): void; + + /** + * Opens the window. + */ + open(params?: openWindowParams): void; + + /** + * Sets the array of items to show in the window's toolbar. + */ + setToolbar(items: ReadonlyArray, params?: windowToolbarParam): void; + + /** + * Makes the navigation bar visible. + */ + showNavBar(options?: any): void; + + /** + * Makes the bottom toolbar visible. + */ + showToolbar(options?: any): void; + + /** + * Makes the bottom toolbar invisible. + */ + hideToolbar(options?: any): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHidden(): boolean; + + /** + * Sets the value of the property. + */ + setAccessibilityHidden(accessibilityHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getAccessibilityHint(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityHint(accessibilityHint: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityLabel(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityLabel(accessibilityLabel: string): void; + + /** + * Gets the value of the property. + */ + getAccessibilityValue(): string; + + /** + * Sets the value of the property. + */ + setAccessibilityValue(accessibilityValue: string): void; + + /** + * Gets the value of the property. + */ + getAnchorPoint(): Point; + + /** + * Sets the value of the property. + */ + setAnchorPoint(anchorPoint: Point): void; + + /** + * Gets the value of the property. + */ + getAnimatedCenter(): Point; + + /** + * Gets the value of the property. + */ + getBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setBackgroundColor(backgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundGradient(): Gradient; + + /** + * Sets the value of the property. + */ + setBackgroundGradient(backgroundGradient: Gradient): void; + + /** + * Gets the value of the property. + */ + getBackgroundImage(): string; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Gets the value of the property. + */ + getBackgroundRepeat(): boolean; + + /** + * Sets the value of the property. + */ + setBackgroundRepeat(backgroundRepeat: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundLeftCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundLeftCap(backgroundLeftCap: number): void; + + /** + * Gets the value of the property. + */ + getBackgroundTopCap(): number; + + /** + * Sets the value of the property. + */ + setBackgroundTopCap(backgroundTopCap: number): void; + + /** + * Gets the value of the property. + */ + getBorderColor(): string; + + /** + * Sets the value of the property. + */ + setBorderColor(borderColor: string): void; + + /** + * Gets the value of the property. + */ + getBorderRadius(): number; + + /** + * Sets the value of the property. + */ + setBorderRadius(borderRadius: number): void; + + /** + * Gets the value of the property. + */ + getBorderWidth(): number; + + /** + * Sets the value of the property. + */ + setBorderWidth(borderWidth: number): void; + + /** + * Gets the value of the property. + */ + getBottom(): number | string; + + /** + * Sets the value of the property. + */ + setBottom(bottom: number): void; + + /** + * Sets the value of the property. + */ + setBottom(bottom: string): void; + + /** + * Gets the value of the property. + */ + getCenter(): Point; + + /** + * Sets the value of the property. + */ + setCenter(center: Point): void; + + /** + * Gets the value of the property. + */ + getChildren(): Titanium.UI.View[]; + + /** + * Gets the value of the property. + */ + getClipMode(): number; + + /** + * Sets the value of the property. + */ + setClipMode(clipMode: number): void; + + /** + * Gets the value of the property. + */ + getHeight(): number | string; + + /** + * Sets the value of the property. + */ + setHeight(height: number): void; + + /** + * Sets the value of the property. + */ + setHeight(height: string): void; + + /** + * Gets the value of the property. + */ + getLeft(): number | string; + + /** + * Sets the value of the property. + */ + setLeft(left: number): void; + + /** + * Sets the value of the property. + */ + setLeft(left: string): void; + + /** + * Gets the value of the property. + */ + getLayout(): string; + + /** + * Sets the value of the property. + */ + setLayout(layout: string): void; + + /** + * Gets the value of the property. + */ + getOpacity(): number; + + /** + * Sets the value of the property. + */ + setOpacity(opacity: number): void; + + /** + * Gets the value of the property. + */ + getPullBackgroundColor(): string; + + /** + * Sets the value of the property. + */ + setPullBackgroundColor(pullBackgroundColor: string): void; + + /** + * Gets the value of the property. + */ + getRight(): number | string; + + /** + * Sets the value of the property. + */ + setRight(right: number): void; + + /** + * Sets the value of the property. + */ + setRight(right: string): void; + + /** + * Gets the value of the property. + */ + getRect(): Dimension; + + /** + * Gets the value of the property. + */ + getSize(): Dimension; + + /** + * Gets the value of the property. + */ + getTintColor(): string; + + /** + * Sets the value of the property. + */ + setTintColor(tintColor: string): void; + + /** + * Gets the value of the property. + */ + getTop(): number | string; + + /** + * Sets the value of the property. + */ + setTop(top: number): void; + + /** + * Sets the value of the property. + */ + setTop(top: string): void; + + /** + * Gets the value of the property. + */ + getTouchEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setTouchEnabled(touchEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getTransform(): Titanium.UI.Matrix2D | Titanium.UI.Matrix3D; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix2D): void; + + /** + * Sets the value of the property. + */ + setTransform(transform: Titanium.UI.Matrix3D): void; + + /** + * Gets the value of the property. + */ + getViewShadowRadius(): number; + + /** + * Sets the value of the property. + */ + setViewShadowRadius(viewShadowRadius: number): void; + + /** + * Gets the value of the property. + */ + getViewShadowColor(): string; + + /** + * Sets the value of the property. + */ + setViewShadowColor(viewShadowColor: string): void; + + /** + * Gets the value of the property. + */ + getViewShadowOffset(): Point; + + /** + * Sets the value of the property. + */ + setViewShadowOffset(viewShadowOffset: Point): void; + + /** + * Gets the value of the property. + */ + getVisible(): boolean; + + /** + * Sets the value of the property. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getWidth(): number | string; + + /** + * Sets the value of the property. + */ + setWidth(width: number): void; + + /** + * Sets the value of the property. + */ + setWidth(width: string): void; + + /** + * Gets the value of the property. + */ + getHorizontalWrap(): boolean; + + /** + * Sets the value of the property. + */ + setHorizontalWrap(horizontalWrap: boolean): void; + + /** + * Gets the value of the property. + */ + getZIndex(): number; + + /** + * Sets the value of the property. + */ + setZIndex(zIndex: number): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitle(): string; + + /** + * Sets the value of the property. + */ + setBackButtonTitle(backButtonTitle: string): void; + + /** + * Gets the value of the property. + */ + getBackButtonTitleImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: string): void; + + /** + * Sets the value of the property. + */ + setBackButtonTitleImage(backButtonTitleImage: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getBarColor(): string; + + /** + * Sets the value of the property. + */ + setBarColor(barColor: string): void; + + /** + * Gets the value of the property. + */ + getBarImage(): string; + + /** + * Sets the value of the property. + */ + setBarImage(barImage: string): void; + + /** + * Gets the value of the property. + */ + getExtendEdges(): number[]; + + /** + * Sets the value of the property. + */ + setExtendEdges(extendEdges: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getIncludeOpaqueBars(): boolean; + + /** + * Sets the value of the property. + */ + setIncludeOpaqueBars(includeOpaqueBars: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoAdjustScrollViewInsets(): boolean; + + /** + * Sets the value of the property. + */ + setAutoAdjustScrollViewInsets(autoAdjustScrollViewInsets: boolean): void; + + /** + * Gets the value of the property. + */ + getExtendSafeArea(): boolean; + + /** + * Sets the value of the property. + */ + setExtendSafeArea(extendSafeArea: boolean): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getHideShadow(): boolean; + + /** + * Sets the value of the property. + */ + setHideShadow(hideShadow: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnSwipe(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnSwipe(hidesBarsOnSwipe: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsOnTap(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsOnTap(hidesBarsOnTap: boolean): void; + + /** + * Gets the value of the property. + */ + getHidesBarsWhenKeyboardAppears(): boolean; + + /** + * Sets the value of the property. + */ + setHidesBarsWhenKeyboardAppears(hidesBarsWhenKeyboardAppears: boolean): void; + + /** + * Gets the value of the property. + */ + getLargeTitleEnabled(): string; + + /** + * Sets the value of the property. + */ + setLargeTitleEnabled(largeTitleEnabled: string): void; + + /** + * Gets the value of the property. + */ + getLargeTitleDisplayMode(): number; + + /** + * Sets the value of the property. + */ + setLargeTitleDisplayMode(largeTitleDisplayMode: number): void; + + /** + * Gets the value of the property. + */ + getLeftNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftNavButton(leftNavButton: any): void; + + /** + * Gets the value of the property. + */ + getLeftNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setLeftNavButtons(leftNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getModal(): boolean; + + /** + * Sets the value of the property. + */ + setModal(modal: boolean): void; + + /** + * Gets the value of the property. + */ + getNavBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setNavBarHidden(navBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getNavTintColor(): string; + + /** + * Sets the value of the property. + */ + setNavTintColor(navTintColor: string): void; + + /** + * Gets the value of the property. + */ + getOrientationModes(): number[]; + + /** + * Sets the value of the property. + */ + setOrientationModes(orientationModes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrientation(): number; + + /** + * Gets the value of the property. + */ + getRightNavButton(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightNavButton(rightNavButton: any): void; + + /** + * Gets the value of the property. + */ + getRightNavButtons(): Titanium.UI.View[]; + + /** + * Sets the value of the property. + */ + setRightNavButtons(rightNavButtons: any[]): void; + + /** + * Gets the value of the property. + */ + getShadowImage(): string; + + /** + * Sets the value of the property. + */ + setShadowImage(shadowImage: string): void; + + /** + * Gets the value of the property. + */ + getStatusBarStyle(): number; + + /** + * Sets the value of the property. + */ + setStatusBarStyle(statusBarStyle: number): void; + + /** + * Gets the value of the property. + */ + getTabBarHidden(): boolean; + + /** + * Sets the value of the property. + */ + setTabBarHidden(tabBarHidden: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleAttributes(): titleAttributesParams; + + /** + * Sets the value of the property. + */ + setTitleAttributes(titleAttributes: titleAttributesParams): void; + + /** + * Gets the value of the property. + */ + getTitleControl(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setTitleControl(titleControl: any): void; + + /** + * Gets the value of the property. + */ + getTitleImage(): string; + + /** + * Sets the value of the property. + */ + setTitleImage(titleImage: string): void; + + /** + * Gets the value of the property. + */ + getTitlePrompt(): string; + + /** + * Sets the value of the property. + */ + setTitlePrompt(titlePrompt: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + /** + * Gets the value of the property. + */ + getTitlepromptid(): string; + + /** + * Sets the value of the property. + */ + setTitlepromptid(titlepromptid: string): void; + + /** + * Gets the value of the property. + */ + getToolbar(): any[]; + + /** + * Sets the value of the property. + */ + setToolbar(toolbar: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getTranslucent(): boolean; + + /** + * Sets the value of the property. + */ + setTranslucent(translucent: boolean): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getDetailView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setDetailView(detailView: any): void; + + /** + * Gets the value of the property. + */ + getMasterView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setMasterView(masterView: any): void; + + /** + * Gets the value of the property. + */ + getShowMasterInPortrait(): boolean; + + /** + * Sets the value of the property. + */ + setShowMasterInPortrait(showMasterInPortrait: boolean): void; + } + } - export interface Properties { - getBool (property: string, _default?: boolean) : boolean; - getDouble (property: string, _default?: number) : number; - getInt (property: string, _default?: number) : number; - getList (property: string, _default?: Array) : Array; - getObject (property: string, _default?: any) : any; - getString (property: string, _default?: string) : string; - hasProperty (property: string) : boolean; - listProperties () : Array; - removeProperty (property: string) : void; - setBool (property: string, value: boolean) : void; - setDouble (property: string, value: number) : void; - setInt (property: string, value: number) : void; - setList (property: string, value: Array) : void; - setObject (property: string, value: any) : void; - setString (property: string, value: string) : void; - } - export interface Tizen { - categories : Array; - iconPath : string; - id : string; - installDate : Date; - name : string; - show : boolean; - size : number; - exit () : void; - getCategories () : Array; - getIconPath () : string; - getId () : string; - getInstallDate () : Date; - getName () : string; - getShow () : boolean; - getSize () : number; - hide () : void; + + /** + * The iPhone/iPad-specific UI capabilities. All properties, methods and events in this namespace + * will only work on Apple iOS systems. + */ + namespace iPhone { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * View presented with the same style as its parent window. + */ + const MODAL_PRESENTATION_CURRENT_CONTEXT: number; + + /** + * Window width and height are smaller than those of the screen and the view is centered on + * the screen. + */ + const MODAL_PRESENTATION_FORMSHEET: number; + + /** + * Window covers the screen. + */ + const MODAL_PRESENTATION_FULLSCREEN: number; + + /** + * Window height is the height of the screen and width is equal to screen width in a portrait + * orientation. + */ + const MODAL_PRESENTATION_PAGESHEET: number; + + /** + * When the window is presented, its view slides up from the bottom of the screen. On dismissal, + * the view slides back down (default.) + */ + const MODAL_TRANSITION_STYLE_COVER_VERTICAL: number; + + /** + * When the window is presented, the current view fades out while the new view fades in at the + * same time. On dismissal, a similar type of cross-fade is used to return to the original view. + */ + const MODAL_TRANSITION_STYLE_CROSS_DISSOLVE: number; + + /** + * When the window is presented, the current view initiates a horizontal 3D flip from + * right-to-left, resulting in the revealing of the new view as if it were on the back of the + * previous view. On dismissal, the flip occurs from left-to-right, returning to the original + * view. + */ + const MODAL_TRANSITION_STYLE_FLIP_HORIZONTAL: number; + + /** + * When the window is presented, one corner of the current view curls up to reveal the modal + * view underneath. On dismissal, the curled up page unfurls itself back on top of the modal + * view. + */ + const MODAL_TRANSITION_STYLE_PARTIAL_CURL: number; + + /** + * Value of the badge for the application's springboard icon. + */ + let appBadge: number; + + /** + * Determines whether the shake to edit system-wide capability is enabled. + */ + let appSupportsShakeToEdit: boolean; + + /** + * Determines whether the status bar is hidden. + */ + const statusBarHidden: boolean; + + /** + * Determines the status bar color style. + */ + const statusBarStyle: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Hides the status bar. + */ + function hideStatusBar(params?: hideStatusBarParams): void; + + /** + * Shows the status bar. + */ + function showStatusBar(params?: showStatusBarParams): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getAppBadge(): number; + + /** + * Sets the value of the property. + */ + function setAppBadge(appBadge: number): void; + + /** + * Gets the value of the property. + */ + function getAppSupportsShakeToEdit(): boolean; + + /** + * Sets the value of the property. + */ + function setAppSupportsShakeToEdit(appSupportsShakeToEdit: boolean): void; + + /** + * Gets the value of the property. + */ + function getStatusBarHidden(): boolean; + + /** + * Gets the value of the property. + */ + function getStatusBarStyle(): number; + + /** + * A set of constants for the style that can be used for the `selectionStyle` property of a + * ListItem, which is set in the `properties` dictionary of either the or + * . + */ + interface ListViewCellSelectionStyle extends Titanium.Proxy { + /** + * The cell when selected has a blue background. This is the default value. + */ + readonly BLUE: number; + + /** + * The cell when selected has a gray background. + */ + readonly GRAY: number; + + /** + * The cell has no distinct style for when it is selected. + */ + readonly NONE: number; + + } + + /** + * A set of constants for the position value that can be used for the `position` property of + * when invoking the ListView's `scrollToItem`, `appendSection`, + * `deleteSectionAt`, `insertSectionAt` and `replaceSectionAt` methods. + */ + interface ListViewScrollPosition extends Titanium.Proxy { + /** + * The list view scrolls the row of interest to the bottom of the visible list view. + */ + readonly BOTTOM: number; + + /** + * The list view scrolls the row of interest to the middle of the list table view. + */ + readonly MIDDLE: number; + + /** + * The table view scrolls the row of interest to be fully visible with a minimal movement. + * If the row is already fully visible, no scrolling occurs. For example, if the row is above the + * visible area, the behavior is identical to that specified by `TOP`. This is the default. + */ + readonly NONE: number; + + /** + * The list view scrolls the row of interest to the top of the visible list view. + */ + readonly TOP: number; + + } + + /** + * A set of constants for the style that can be used for the `style` property of + * . + */ + interface ListViewStyle extends Titanium.Proxy { + /** + * A list view whose sections present distinct groups of rows. The section headers and footers + * do not float. + */ + readonly GROUPED: number; + + /** + * A plain list view. Any section headers or footers are displayed as inline separators and + * float when the list view is scrolled. + */ + readonly PLAIN: number; + + } + + + /** + * A set of constants for the styles available for objects. + */ + namespace ActivityIndicatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Large white spinning indicator. + */ + const BIG: number; + + /** + * Small gray spinning indicator. + */ + const DARK: number; + + /** + * Small white spinning indicator (default.) + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `style` property of + * . + */ + namespace AlertDialogStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A standard alert dialog. This is the default value. + */ + const DEFAULT: number; + + /** + * An alert dialog that allows the user to enter text. + */ + const PLAIN_TEXT_INPUT: number; + + /** + * An alert dialog that allows the user to enter text. The text field is obscured. + */ + const SECURE_TEXT_INPUT: number; + + /** + * An alert dialog that allows the user to enter login identifier and password. + */ + const LOGIN_AND_PASSWORD_INPUT: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the animation styles used for view transitions. + */ + namespace AnimationStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Curl downwards during a transition animation. + */ + const CURL_DOWN: number; + + /** + * Curl upwards during a transition animation. + */ + const CURL_UP: number; + + /** + * Flip from left to right during a transition animation. + */ + const FLIP_FROM_LEFT: number; + + /** + * Flip from right to left during a transition animation. + */ + const FLIP_FROM_RIGHT: number; + + /** + * No animation. + */ + const NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `separatorStyle` property of + * . + */ + namespace ListViewSeparatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The separator cell has no distinct style. + */ + const NONE: number; + + /** + * The separator cell has a single line running across its width. This is the default value. + */ + const SINGLE_LINE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the bar styles used on the `style` property of . + */ + namespace ProgressBarStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The style of progress view that is used in a toolbar. + */ + const BAR: number; + + /** + * he standard progress-view style. This is the default. + */ + const DEFAULT: number; + + /** + * The standard progress-view style. Same as `DEFAULT`. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the Animation Styles used for transition on table view rows. + */ + namespace RowAnimationStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The inserted row or rows slides in from the bottom; the deleted row or rows slides out + * toward the bottom. + */ + const BOTTOM: number; + + /** + * The inserted or deleted row or rows fades into or out of the table view. + */ + const FADE: number; + + /** + * The inserted row or rows slides in from the left; the deleted row or rows slides out to the + * left. + */ + const LEFT: number; + + /** + * No animation is performed. The new cell value appears as if the cell had just been reloaded. + */ + const NONE: number; + + /** + * The inserted row or rows slides in from the right; the deleted row or rows slides out to + * the right. + */ + const RIGHT: number; + + /** + * The inserted row or rows slides in from the top; the deleted row or rows slides out toward + * the top. + */ + const TOP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the styles available for scrollbars used with and properties. + */ + namespace ScrollIndicatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A style of indicator which is black smaller than the default style. This style is good + * against a white content background. + */ + const BLACK: number; + + /** + * The default style of scroll indicator, which is black with a white border. This style is + * good against any content background. + */ + const DEFAULT: number; + + /** + * A style of indicator is white and smaller than the default style. This style is good against + * a black content background. + */ + const WHITE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the status bar style. + */ + namespace StatusBar { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * No animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_NONE: number; + + /** + * Slide animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_SLIDE: number; + + /** + * Fade animation style, when the status bar is hidden or shown. + */ + const ANIMATION_STYLE_FADE: number; + + /** + * Default status bar style. + */ + const DEFAULT: number; + + /** + * Gray-colored status bar style. + */ + const GRAY: number; + + /** + * Gray-colored status bar style. + */ + const GREY: number; + + /** + * Status bar style to use with dark backgrounds. Valid on iOS 7 and above. + */ + const LIGHT_CONTENT: number; + + /** + * Opaque black-colored status bar style. + */ + const OPAQUE_BLACK: number; + + /** + * Translucent black-colored status bar style, which provides some degree of transparency to + * the device background. + */ + const TRANSLUCENT_BLACK: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for creating standard iOS system buttons. + */ + namespace SystemButton { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Action** button. + */ + const ACTION: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create an activity indicator that + * can be used in navigation bars and toolbars. + */ + const ACTIVITY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Add** button. + */ + const ADD: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Bookmarks** button. + */ + const BOOKMARKS: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Camera** button. + */ + const CAMERA: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Cancel** button. + */ + const CANCEL: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Compose** button. + */ + const COMPOSE: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a **ContactAdd** button. + */ + const CONTACT_ADD: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a **Disclosure** button. + */ + const DISCLOSURE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Done** button. + */ + const DONE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Edit** button. + */ + const EDIT: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Fast Forward** button. + */ + const FAST_FORWARD: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create a fixed-width blank space + * for spacing items in toolbars. + */ + const FIXED_SPACE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to create a flexible blank space + * for spacing items in toolbars. + */ + const FLEXIBLE_SPACE: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a dark-colored **Info** button. + */ + const INFO_DARK: number; + + /** + * Use with [Button.style](Titanium.UI.Button.style) to specify a light-colored **Info** button. + */ + const INFO_LIGHT: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify an **Organize** button. + */ + const ORGANIZE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Pause** button. + */ + const PAUSE: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Play** button. + */ + const PLAY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Refresh** button. + */ + const REFRESH: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Reply** button. + */ + const REPLY: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Rewind** button. + */ + const REWIND: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Save** button. + */ + const SAVE: number; + + /** + * Identical to [ACTIVITY](Titanium.UI.iPhone.SystemButton.ACTIVITY). + */ + const SPINNER: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Stop** button. + */ + const STOP: number; + + /** + * Use with [Button.systemButton](Titanium.UI.Button.systemButton) to specify a **Trash** button. + */ + const TRASH: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the system button styles that can be used for the button `style` property. + */ + namespace SystemButtonStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Used with [ButtonBar](Titanium.UI.ButtonBar) or [TabbedBar](Titanium.UI.iOS.TabbedBar) only, + * to use the more condensed style used in nav bars and tool bars. + */ + const BAR: number; + + /** + * A simple button style with a border. + */ + const BORDERED: number; + + /** + * The style for a **Done** button--for example, a button that completes some task and returns + * to the previous view. + */ + const DONE: number; + + /** + * Specifies a borderless button, the default style for toolbars, button bars, and tabbed bars. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the system icon styles that can be used on a tab group tab. + */ + namespace SystemIcon { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Bookmark style icon + */ + const BOOKMARKS: number; + + /** + * Contacts style icon + */ + const CONTACTS: number; + + /** + * Downloads style icon + */ + const DOWNLOADS: number; + + /** + * Favorites style icon + */ + const FAVORITES: number; + + /** + * Featured style icon + */ + const FEATURED: number; + + /** + * History style icon + */ + const HISTORY: number; + + /** + * More style icon + */ + const MORE: number; + + /** + * Most recent style icon + */ + const MOST_RECENT: number; + + /** + * Most viewed style icon + */ + const MOST_VIEWED: number; + + /** + * Recents style icon + */ + const RECENTS: number; + + /** + * Search style icon + */ + const SEARCH: number; + + /** + * Top rated style icon + */ + const TOP_RATED: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `selectionStyle` property of + * . + */ + namespace TableViewCellSelectionStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The cell when selected has a blue background. This is the default value. + */ + const BLUE: number; + + /** + * Then cell when selected has a gray background. + */ + const GRAY: number; + + /** + * The cell has no distinct style for when it is selected. + */ + const NONE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the position value that can be used for the `position` property of + * when invoking `scrollToIndex`. + */ + namespace TableViewScrollPosition { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The table view scrolls the row of interest to the bottom of the visible table view. + */ + const BOTTOM: number; + + /** + * The table view scrolls the row of interest to the middle of the visible table view. + */ + const MIDDLE: number; + + /** + * The table view scrolls the row of interest to be fully visible with a minimum of movement. If the row is already fully visible, no scrolling occurs. For example, if the row is above the visible area, the behavior is identical to that specified by `TOP`. This is the default. + */ + const NONE: number; + + /** + * The table view scrolls the row of interest to the top of the visible table view. + */ + const TOP: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the `separatorStyle` property of + * . + */ + namespace TableViewSeparatorStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The separator cell has no distinct style. + */ + const NONE: number; + + /** + * The separator cell has a single line running across its width. This is the default value. + */ + const SINGLE_LINE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } + + /** + * A set of constants for the style that can be used for the button `style` property of + * . + */ + namespace TableViewStyle { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * A table view whose sections present distinct groups of rows. The section headers and footers + * do not float. + */ + const GROUPED: number; + + /** + * A plain table view. Any section headers or footers are displayed as inline separators and + * float when the table view is scrolled. + */ + const PLAIN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + } } } - export module Android { - export var ACTION_AIRPLANE_MODE_CHANGED : string; - export var ACTION_ALL_APPS : string; - export var ACTION_ANSWER : string; - export var ACTION_ATTACH_DATA : string; - export var ACTION_BATTERY_CHANGED : string; - export var ACTION_BATTERY_LOW : string; - export var ACTION_BATTERY_OKAY : string; - export var ACTION_BOOT_COMPLETED : string; - export var ACTION_BUG_REPORT : string; - export var ACTION_CALL : string; - export var ACTION_CALL_BUTTON : string; - export var ACTION_CAMERA_BUTTON : string; - export var ACTION_CHOOSER : string; - export var ACTION_CLOSE_SYSTEM_DIALOGS : string; - export var ACTION_CONFIGURATION_CHANGED : string; - export var ACTION_CREATE_SHORTCUT : string; - export var ACTION_DATE_CHANGED : string; - export var ACTION_DEFAULT : string; - export var ACTION_DELETE : string; - export var ACTION_DEVICE_STORAGE_LOW : string; - export var ACTION_DIAL : string; - export var ACTION_EDIT : string; - export var ACTION_GET_CONTENT : string; - export var ACTION_GTALK_SERVICE_CONNECTED : string; - export var ACTION_GTALK_SERVICE_DISCONNECTED : string; - export var ACTION_HEADSET_PLUG : string; - export var ACTION_INPUT_METHOD_CHANGED : string; - export var ACTION_INSERT : string; - export var ACTION_INSERT_OR_EDIT : string; - export var ACTION_MAIN : string; - export var ACTION_MANAGE_PACKAGE_STORAGE : string; - export var ACTION_MEDIA_BAD_REMOVAL : string; - export var ACTION_MEDIA_BUTTON : string; - export var ACTION_MEDIA_CHECKING : string; - export var ACTION_MEDIA_EJECT : string; - export var ACTION_MEDIA_MOUNTED : string; - export var ACTION_MEDIA_NOFS : string; - export var ACTION_MEDIA_REMOVED : string; - export var ACTION_MEDIA_SCANNER_FINISHED : string; - export var ACTION_MEDIA_SCANNER_SCAN_FILE : string; - export var ACTION_MEDIA_SCANNER_STARTED : string; - export var ACTION_MEDIA_SHARED : string; - export var ACTION_MEDIA_UNMOUNTABLE : string; - export var ACTION_MEDIA_UNMOUNTED : string; - export var ACTION_NEW_OUTGOING_CALL : string; - export var ACTION_PACKAGE_ADDED : string; - export var ACTION_PACKAGE_CHANGED : string; - export var ACTION_PACKAGE_DATA_CLEARED : string; - export var ACTION_PACKAGE_INSTALL : string; - export var ACTION_PACKAGE_REMOVED : string; - export var ACTION_PACKAGE_REPLACED : string; - export var ACTION_PACKAGE_RESTARTED : string; - export var ACTION_PICK : string; - export var ACTION_PICK_ACTIVITY : string; - export var ACTION_POWER_CONNECTED : string; - export var ACTION_POWER_DISCONNECTED : string; - export var ACTION_POWER_USAGE_SUMMARY : string; - export var ACTION_PROVIDER_CHANGED : string; - export var ACTION_REBOOT : string; - export var ACTION_RUN : string; - export var ACTION_SCREEN_OFF : string; - export var ACTION_SCREEN_ON : string; - export var ACTION_SEARCH : string; - export var ACTION_SEARCH_LONG_PRESS : string; - export var ACTION_SEND : string; - export var ACTION_SENDTO : string; - export var ACTION_SEND_MULTIPLE : string; - export var ACTION_SET_WALLPAPER : string; - export var ACTION_SHUTDOWN : string; - export var ACTION_SYNC : string; - export var ACTION_SYSTEM_TUTORIAL : string; - export var ACTION_TIME_CHANGED : string; - export var ACTION_TIME_TICK : string; - export var ACTION_UID_REMOVED : string; - export var ACTION_UMS_CONNECTED : string; - export var ACTION_UMS_DISCONNECTED : string; - export var ACTION_USER_PRESENT : string; - export var ACTION_VIEW : string; - export var ACTION_VOICE_COMMAND : string; - export var ACTION_WALLPAPER_CHANGED : string; - export var ACTION_WEB_SEARCH : string; - export var CATEGORY_ALTERNATIVE : string; - export var CATEGORY_BROWSABLE : string; - export var CATEGORY_DEFAULT : string; - export var CATEGORY_DEVELOPMENT_PREFERENCE : string; - export var CATEGORY_EMBED : string; - export var CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST : string; - export var CATEGORY_HOME : string; - export var CATEGORY_INFO : string; - export var CATEGORY_LAUNCHER : string; - export var CATEGORY_MONKEY : string; - export var CATEGORY_OPENABLE : string; - export var CATEGORY_PREFERENCE : string; - export var CATEGORY_SAMPLE_CODE : string; - export var CATEGORY_SELECTED_ALTERNATIVE : string; - export var CATEGORY_TAB : string; - export var CATEGORY_TEST : string; - export var CATEGORY_UNIT_TEST : string; - export var DEFAULT_ALL : number; - export var DEFAULT_LIGHTS : number; - export var DEFAULT_SOUND : number; - export var DEFAULT_VIBRATE : number; - export var EXTRA_ALARM_COUNT : string; - export var EXTRA_BCC : string; - export var EXTRA_CC : string; - export var EXTRA_DATA_REMOVED : string; - export var EXTRA_DONT_KILL_APP : string; - export var EXTRA_EMAIL : string; - export var EXTRA_INTENT : string; - export var EXTRA_KEY_EVENT : string; - export var EXTRA_PHONE_NUMBER : string; - export var EXTRA_REPLACING : string; - export var EXTRA_SHORTCUT_ICON : string; - export var EXTRA_SHORTCUT_ICON_RESOURCE : string; - export var EXTRA_SHORTCUT_INTENT : string; - export var EXTRA_SHORTCUT_NAME : string; - export var EXTRA_STREAM : string; - export var EXTRA_SUBJECT : string; - export var EXTRA_TEMPLATE : string; - export var EXTRA_TEXT : string; - export var EXTRA_TITLE : string; - export var EXTRA_UID : string; - export var FILL_IN_ACTION : number; - export var FILL_IN_CATEGORIES : number; - export var FILL_IN_COMPONENT : number; - export var FILL_IN_DATA : number; - export var FILL_IN_PACKAGE : number; - export var FLAG_ACTIVITY_BROUGHT_TO_FRONT : number; - export var FLAG_ACTIVITY_CLEAR_TOP : number; - export var FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET : number; - export var FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS : number; - export var FLAG_ACTIVITY_FORWARD_RESULT : number; - export var FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY : number; - export var FLAG_ACTIVITY_MULTIPLE_TASK : number; - export var FLAG_ACTIVITY_NEW_TASK : number; - export var FLAG_ACTIVITY_NO_ANIMATION : number; - export var FLAG_ACTIVITY_NO_HISTORY : number; - export var FLAG_ACTIVITY_NO_USER_ACTION : number; - export var FLAG_ACTIVITY_PREVIOUS_IS_TOP : number; - export var FLAG_ACTIVITY_REORDER_TO_FRONT : number; - export var FLAG_ACTIVITY_RESET_TASK_IF_NEEDED : number; - export var FLAG_ACTIVITY_SINGLE_TOP : number; - export var FLAG_AUTO_CANCEL : number; - export var FLAG_CANCEL_CURRENT : number; - export var FLAG_DEBUG_LOG_RESOLUTION : number; - export var FLAG_FROM_BACKGROUND : number; - export var FLAG_GRANT_READ_URI_PERMISSION : number; - export var FLAG_GRANT_WRITE_URI_PERMISSION : number; - export var FLAG_INSISTENT : number; - export var FLAG_NO_CLEAR : number; - export var FLAG_NO_CREATE : number; - export var FLAG_ONE_SHOT : number; - export var FLAG_ONGOING_EVENT : number; - export var FLAG_ONLY_ALERT_ONCE : number; - export var FLAG_RECEIVER_REGISTERED_ONLY : number; - export var FLAG_SHOW_LIGHTS : number; - export var FLAG_UPDATE_CURRENT : number; - export var NAVIGATION_MODE_STANDARD : number; - export var NAVIGATION_MODE_TABS : number; - export var PENDING_INTENT_FOR_ACTIVITY : number; - export var PENDING_INTENT_FOR_BROADCAST : number; - export var PENDING_INTENT_FOR_SERVICE : number; - export var PENDING_INTENT_MAX_VALUE : number; - export var R : Ti.Android.R; - export var RESULT_CANCELED : number; - export var RESULT_FIRST_USER : number; - export var RESULT_OK : number; - export var SCREEN_ORIENTATION_BEHIND : number; - export var SCREEN_ORIENTATION_LANDSCAPE : number; - export var SCREEN_ORIENTATION_NOSENSOR : number; - export var SCREEN_ORIENTATION_PORTRAIT : number; - export var SCREEN_ORIENTATION_SENSOR : number; - export var SCREEN_ORIENTATION_UNSPECIFIED : number; - export var SCREEN_ORIENTATION_USER : number; - export var SHOW_AS_ACTION_ALWAYS : number; - export var SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW : number; - export var SHOW_AS_ACTION_IF_ROOM : number; - export var SHOW_AS_ACTION_NEVER : number; - export var SHOW_AS_ACTION_WITH_TEXT : number; - export var START_NOT_STICKY : number; - export var START_REDELIVER_INTENT : number; - export var STREAM_ALARM : number; - export var STREAM_DEFAULT : number; - export var STREAM_MUSIC : number; - export var STREAM_NOTIFICATION : number; - export var STREAM_RING : number; - export var STREAM_SYSTEM : number; - export var STREAM_VOICE_CALL : number; - export var URI_INTENT_SCHEME : number; - export var apiName : string; - export var bubbleParent : boolean; - export var currentActivity : Ti.Android.Activity; - export var currentService : Ti.Android.Service; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createBroadcastIntent (options: BroadcastIntentOptions) : Ti.Android.Intent; - export function createBroadcastReceiver (parameters?: Dictionary) : Ti.Android.BroadcastReceiver; - export function createIntent (parameters?: Dictionary) : Ti.Android.Intent; - export function createIntentChooser (intent: Ti.Android.Intent, title: string) : Ti.Android.Intent; - export function createNotification (parameters?: Dictionary) : Ti.Android.Notification; - export function createPendingIntent (parameters?: Dictionary) : Ti.Android.PendingIntent; - export function createRemoteViews (parameters?: Dictionary) : Ti.Android.RemoteViews; - export function createService (intent: Ti.Android.Intent) : Ti.Android.Service; - export function createServiceIntent (options: ServiceIntentOptions) : Ti.Android.Intent; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getCurrentActivity () : Ti.Android.Activity; - export function getCurrentService () : Ti.Android.Service; - export function isServiceRunning (intent: Ti.Android.Intent) : boolean; - export function registerBroadcastReceiver (broadcastReceiver: Ti.Android.BroadcastReceiver, actions: Array) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function startService (intent: Ti.Android.Intent) : void; - export function stopService (intent: Ti.Android.Intent) : void; - export function unregisterBroadcastReceiver (broadcastReceiver: Ti.Android.BroadcastReceiver) : void; - export interface Intent extends Ti.Proxy { - action : string; - className : string; - data : string; - flags : number; - packageName : string; - type : string; - url : string; - addCategory (name: string) : void; - addFlags (flags: number) : void; - getAction () : string; - getBlobExtra (name: string) : Ti.Blob; - getBooleanExtra (name: string) : boolean; - getClassName () : string; - getData () : string; - getDoubleExtra (name: string) : number; - getFlags () : number; - getIntExtra (name: string) : number; - getLongExtra (name: string) : number; - getPackageName () : string; - getStringExtra (name: string) : string; - getType () : string; - getUrl () : string; - hasExtra (name: string) : boolean; - putExtra (name: string, value: any) : void; - putExtraUri (name: string, value: string) : void; - setFlags (flags: number) : void; - } - export interface Notification extends Ti.Proxy { - audioStreamType : number; - contentIntent : Ti.Android.PendingIntent; - contentText : string; - contentTitle : string; - contentView : Ti.Android.RemoteViews; - defaults : number; - deleteIntent : Ti.Android.PendingIntent; - flags : number; - icon : any; - ledARGB : number; - ledOffMS : number; - ledOnMS : number; - number : number; - sound : string; - tickerText : string; - when : any; - getAudioStreamType () : number; - getContentIntent () : Ti.Android.PendingIntent; - getContentText () : string; - getContentTitle () : string; - getDefaults () : number; - getDeleteIntent () : Ti.Android.PendingIntent; - getFlags () : number; - getIcon () : any; - getLedARGB () : number; - getLedOffMS () : number; - getLedOnMS () : number; - getNumber () : number; - getSound () : string; - getTickerText () : string; - getWhen () : any; - setAudioStreamType (audioStreamType: number) : void; - setContentIntent (contentIntent: Ti.Android.PendingIntent) : void; - setContentText (contentText: string) : void; - setContentTitle (contentTitle: string) : void; - setContentView (contentView: Ti.Android.RemoteViews) : void; - setDefaults (defaults: number) : void; - setDeleteIntent (deleteIntent: Ti.Android.PendingIntent) : void; - setFlags (flags: number) : void; - setIcon (icon: number) : void; - setIcon (icon: string) : void; - setLatestEventInfo (contentTitle: string, contentText: string, contentIntent: Ti.Android.PendingIntent) : void; - setLedARGB (ledARGB: number) : void; - setLedOffMS (ledOffMS: number) : void; - setLedOnMS (ledOnMS: number) : void; - setNumber (number: number) : void; - setSound (sound: string) : void; - setTickerText (tickerText: string) : void; - setWhen (when: Date) : void; - setWhen (when: number) : void; - } - export module Calendar { - export var METHOD_ALERT : number; - export var METHOD_DEFAULT : number; - export var METHOD_EMAIL : number; - export var METHOD_SMS : number; - export var STATE_DISMISSED : number; - export var STATE_FIRED : number; - export var STATE_SCHEDULED : number; - export var STATUS_CANCELED : number; - export var STATUS_CONFIRMED : number; - export var STATUS_TENTATIVE : number; - export var VISIBILITY_CONFIDENTIAL : number; - export var VISIBILITY_DEFAULT : number; - export var VISIBILITY_PRIVATE : number; - export var VISIBILITY_PUBLIC : number; - export var allAlerts : Array; - export var allCalendars : Array; - export var apiName : string; - export var bubbleParent : boolean; - export var selectableCalendars : Array; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllAlerts () : Array; - export function getAllCalendars () : Array; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getCalendarById (id: number) : Ti.Android.Calendar.Calendar; - export function getSelectableCalendars () : Array; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Event extends Ti.Proxy { - alerts : Array; - allDay : boolean; - begin : Date; - description : string; - end : Date; - extendedProperties : Dictionary; - hasAlarm : boolean; - hasExtendedProperties : boolean; - id : string; - location : string; - reminders : Array; - status : number; - title : string; - visibility : number; - createAlert (data: Dictionary) : Ti.Android.Calendar.Alert; - createReminder (data: Dictionary) : Ti.Android.Calendar.Reminder; - getAlerts () : Array; - getAllDay () : boolean; - getBegin () : Date; - getDescription () : string; - getEnd () : Date; - getExtendedProperties () : Dictionary; - getExtendedProperty (name: string) : string; - getHasAlarm () : boolean; - getHasExtendedProperties () : boolean; - getId () : string; - getLocation () : string; - getReminders () : Array; - getStatus () : number; - getTitle () : string; - getVisibility () : number; - setExtendedProperty (name: string, value: string) : void; - } - export interface Reminder extends Ti.Proxy { - id : string; - method : number; - minutes : number; - getId () : string; - getMethod () : number; - getMinutes () : number; - } - export interface Calendar extends Ti.Proxy { - hidden : boolean; - id : string; - name : string; - selected : boolean; - createEvent (properties: Dictionary) : Ti.Android.Calendar.Event; - getEventById (id: number) : Ti.Android.Calendar.Event; - getEventsBetweenDates (date1: Date, date2: Date) : Array; - getEventsInDate (year: number, month: number, day: number) : Array; - getEventsInMonth (year: number, month: number) : Array; - getEventsInYear (year: number) : Array; - getHidden () : boolean; - getId () : string; - getName () : string; - getSelected () : boolean; - } - export interface Alert extends Ti.Proxy { - alarmTime : Date; - begin : Date; - end : Date; - eventId : number; - id : string; - minutes : number; - state : number; - getAlarmTime () : Date; - getBegin () : Date; - getEnd () : Date; - getEventId () : number; - getId () : string; - getMinutes () : number; - getState () : number; - } - } - export interface MenuItem extends Ti.Proxy { - actionView : Ti.UI.View; - actionViewExpanded : boolean; - checkable : boolean; - checked : boolean; - enabled : boolean; - groupId : number; - icon : any; - itemId : number; - order : number; - showAsAction : number; - title : string; - titleCondensed : string; - visible : boolean; - collapseActionView () : void; - expandActionView () : void; - getActionView () : Ti.UI.View; - getGroupId () : number; - getItemId () : number; - getOrder () : number; - getTitle () : string; - getTitleCondensed () : string; - isActionViewExpanded () : boolean; - isCheckable () : boolean; - isChecked () : boolean; - isEnabled () : boolean; - isVisible () : boolean; - setActionView (actionView: Ti.UI.View) : void; - setCheckable (checkable: boolean) : void; - setChecked (enabled: boolean) : void; - setEnabled (enabled: boolean) : void; - setIcon (icon: number) : void; - setIcon (icon: string) : void; - setShowAsAction (showAsAction: number) : void; - setTitle (title: string) : void; - setTitleCondensed (titleCondensed: string) : void; - setVisible (visible: boolean) : void; - } - export interface NotificationManager { - DEFAULT_ALL : number; - DEFAULT_LIGHTS : number; - DEFAULT_SOUND : number; - DEFAULT_VIBRATE : number; - FLAG_AUTO_CANCEL : number; - FLAG_INSISTENT : number; - FLAG_NO_CLEAR : number; - FLAG_ONGOING_EVENT : number; - FLAG_ONLY_ALERT_ONCE : number; - FLAG_SHOW_LIGHTS : number; - STREAM_DEFAULT : number; - cancel (id: number) : void; - cancelAll () : void; - notify (id: number, notification: Ti.Android.Notification) : void; - } - export interface R extends Ti.Proxy { - anim : any; - array : any; - attr : any; - color : any; - dimen : any; - drawable : any; - id : any; - integer : any; - layout : any; - string : any; - style : any; - styleable : any; - } - export interface ActionBar extends Ti.Proxy { - backgroundImage : string; - displayHomeAsUp : boolean; - homeButtonEnabled : boolean; - icon : string; - logo : string; - navigationMode : number; - onHomeIconItemSelected : (...args : any[]) => any; - subtitle : string; - title : string; - getNavigationMode () : number; - getSubtitle () : string; - getTitle () : string; - hide () : void; - setBackgroundImage (backgroundImage: string) : void; - setDisplayHomeAsUp (displayHomeAsUp: boolean) : void; - setDisplayShowHomeEnabled (show: boolean) : void; - setDisplayShowTitleEnabled (show: boolean) : void; - setHomeButtonEnabled (homeButtonEnabled: boolean) : void; - setIcon (icon: string) : void; - setLogo (logo: string) : void; - setNavigationMode (navigationMode: number) : void; - setOnHomeIconItemSelected (onHomeIconItemSelected: (...args : any[]) => any) : void; - setSubtitle (subtitle: string) : void; - setTitle (title: string) : void; - show () : void; - } - export interface BroadcastReceiver extends Ti.Proxy { - onReceived : (...args : any[]) => any; - url : string; - getOnReceived () : (...args : any[]) => any; - getUrl () : string; - setOnReceived (onReceived: (...args : any[]) => any) : void; - setUrl (url: string) : void; - } - export interface Menu extends Ti.Proxy { - items : Array; - add (options: any) : Ti.Android.MenuItem; - clear () : void; - close () : void; - findItem (item: number) : Ti.Android.MenuItem; - findItem (item: Ti.Android.MenuItem) : Ti.Android.MenuItem; - getItem (index: number) : Ti.Android.MenuItem; - getItems () : Array; - hasVisibleItems () : boolean; - removeGroup (groupId: number) : void; - removeItem (itemId: number) : void; - setGroupEnabled (groupId: number, enabled: boolean) : void; - setGroupVisible (groupId: number, visible: boolean) : void; - size () : number; - } - export interface Activity extends Ti.Proxy { - actionBar : Ti.Android.ActionBar; - intent : Ti.Android.Intent; - onCreate : (...args : any[]) => any; - onCreateOptionsMenu : (...args : any[]) => any; - onDestroy : (...args : any[]) => any; - onPause : (...args : any[]) => any; - onPrepareOptionsMenu : (...args : any[]) => any; - onRestart : (...args : any[]) => any; - onResume : (...args : any[]) => any; - onStart : (...args : any[]) => any; - onStop : (...args : any[]) => any; - requestedOrientation : number; - finish () : void; - getActionBar () : Ti.Android.ActionBar; - getIntent () : Ti.Android.Intent; - getOnCreate () : (...args : any[]) => any; - getOnCreateOptionsMenu () : (...args : any[]) => any; - getOnDestroy () : (...args : any[]) => any; - getOnPause () : (...args : any[]) => any; - getOnPrepareOptionsMenu () : (...args : any[]) => any; - getOnRestart () : (...args : any[]) => any; - getOnResume () : (...args : any[]) => any; - getOnStart () : (...args : any[]) => any; - getOnStop () : (...args : any[]) => any; - getString (resourceId: number, format: any) : string; - invalidateOptionsMenu () : void; - openOptionsMenu () : void; - sendBroadcast (intent: Ti.Android.Intent) : void; - sendBroadcastWithPermission (intent: Ti.Android.Intent, receiverPermission?: string) : void; - setOnCreate (onCreate: (...args : any[]) => any) : void; - setOnCreateOptionsMenu (onCreateOptionsMenu: (...args : any[]) => any) : void; - setOnDestroy (onDestroy: (...args : any[]) => any) : void; - setOnPause (onPause: (...args : any[]) => any) : void; - setOnPrepareOptionsMenu (onPrepareOptionsMenu: (...args : any[]) => any) : void; - setOnRestart (onRestart: (...args : any[]) => any) : void; - setOnResume (onResume: (...args : any[]) => any) : void; - setOnStart (onStart: (...args : any[]) => any) : void; - setOnStop (onStop: (...args : any[]) => any) : void; - setRequestedOrientation (orientation: number) : void; - setResult (resultCode: number, intent?: Ti.Android.Intent) : void; - startActivity (intent: Ti.Android.Intent) : void; - startActivityForResult (intent: Ti.Android.Intent, callback: (...args : any[]) => any) : void; - } - export interface Service extends Ti.Proxy { - intent : Ti.Android.Intent; - serviceInstanceId : number; - getIntent () : Ti.Android.Intent; - getServiceInstanceId () : number; - start () : void; - stop () : void; - } - export interface RemoteViews extends Ti.Proxy { - layoutId : number; - packageName : string; - getLayoutId () : number; - getPackageName () : string; - setBoolean (viewId: number, methodName: string, value: boolean) : void; - setChronometer (viewId: number, base: Date, format: string, started: boolean) : void; - setDouble (viewId: number, methodName: string, value: number) : void; - setImageViewResource (viewId: number, srcId: number) : void; - setImageViewUri (viewId: number, uri: string) : void; - setInt (viewId: number, methodName: string, value: number) : void; - setOnClickPendingIntent (viewId: number, pendingIntent: Ti.Android.PendingIntent) : void; - setProgressBar (viewId: number, max: number, progress: number, indeterminate: boolean) : void; - setString (viewId: number, methodName: string, value: string) : void; - setTextColor (viewId: number, color: number) : void; - setTextViewText (viewId: number, text: string) : void; - setUri (viewId: number, methodName: string, value: string) : void; - setViewVisibility (viewId: number, visibility: number) : void; - } - export interface PendingIntent extends Ti.Proxy { - flags : number; - intent : Ti.Android.Intent; - updateCurrentIntent : boolean; - getFlags () : number; - getIntent () : Ti.Android.Intent; - getUpdateCurrentIntent () : boolean; - } - } - export module Database { - export var FIELD_TYPE_DOUBLE : number; - export var FIELD_TYPE_FLOAT : number; - export var FIELD_TYPE_INT : number; - export var FIELD_TYPE_STRING : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function install (path: string, dbName: string) : Ti.Database.DB; - export function open (dbName: string) : Ti.Database.DB; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface ResultSet extends Ti.Proxy { - rowCount : number; - validRow : boolean; - close () : void; - field (index: number, type?: number) : any; - fieldByName (name: string, type?: number) : any; - fieldCount () : number; - fieldName (index: number) : string; - getFieldCount () : number; - getFieldName (index: number) : string; - getRowCount () : number; - getValidRow () : boolean; - isValidRow () : boolean; - next () : boolean; - } - export interface DB extends Ti.Proxy { - file : Ti.Filesystem.File; - lastInsertRowId : number; - name : string; - rowsAffected : number; - close () : void; - execute (sql: string, vararg?: string) : Ti.Database.ResultSet; - execute (vararg?: Array) : Ti.Database.ResultSet; - execute (vararg?: any) : Ti.Database.ResultSet; - execute (sql: string, vararg?: Array) : Ti.Database.ResultSet; - getFile () : Ti.Filesystem.File; - getLastInsertRowId () : number; - getName () : string; - getRowsAffected () : number; - remove () : void; - setLastInsertRowId (lastInsertRowId: number) : void; - setName (name: string) : void; - setRowsAffected (rowsAffected: number) : void; - } - } - export module Contacts { - export var AUTHORIZATION_AUTHORIZED : number; - export var AUTHORIZATION_DENIED : number; - export var AUTHORIZATION_RESTRICTED : number; - export var AUTHORIZATION_UNKNOWN : number; - export var CONTACTS_KIND_ORGANIZATION : number; - export var CONTACTS_KIND_PERSON : number; - export var CONTACTS_SORT_FIRST_NAME : number; - export var CONTACTS_SORT_LAST_NAME : number; - export var apiName : string; - export var bubbleParent : boolean; - export var contactsAuthorization : number; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createGroup (parameters?: Dictionary) : Ti.Contacts.Group; - export function createPerson (parameters?: Dictionary) : Ti.Contacts.Person; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllGroups () : Array; - export function getAllPeople (limit: number) : Array; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getContactsAuthorization () : number; - export function getGroupByID (id: number) : Ti.Contacts.Group; - export function getPeopleWithName (name: string) : Array; - export function getPersonByID (id: number) : Ti.Contacts.Person; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function removeGroup (group: Ti.Contacts.Group) : void; - export function removePerson (person: Ti.Contacts.Person) : void; - export function requestAuthorization (callback: (...args : any[]) => any) : void; - export function revert () : void; - export function save (contacts: Array) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function showContacts (params: showContactsParams) : void; - export module Tizen { - export var apiName : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllPeople (callback: (...args : any[]) => any) : void; - export function getApiName () : string; - export function getPeopleWithName (name: string, callback: (...args : any[]) => any) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export interface Group { - members (group: Ti.Contacts.Group, callback: (...args : any[]) => any) : void; - sortedMembers (sortBy: number, group: Ti.Contacts.Group, callback: (...args : any[]) => any) : void; - } - } - export interface Group extends Ti.Proxy { - name : string; - recordId : number; - add (person: Ti.Contacts.Person) : void; - getName () : string; - getRecordId () : number; - members () : Array; - remove (person: Ti.Contacts.Person) : void; - setName (name: string) : void; - setRecordId (recordId: number) : void; - sortedMembers (sortBy: number) : Array; - } - export interface Person extends Ti.Proxy { - address : Dictionary; - birthday : string; - created : string; - date : Dictionary; - department : string; - email : Dictionary; - firstName : string; - firstPhonetic : string; - fullName : string; - id : number; - image : Ti.Blob; - instantMessage : Dictionary; - jobTitle : string; - kind : number; - lastName : string; - lastPhonetic : string; - middleName : string; - middlePhonetic : string; - modified : string; - nickname : string; - note : string; - organization : string; - phone : Dictionary; - prefix : string; - recordId : number; - relatedNames : Dictionary; - suffix : string; - url : Dictionary; - getAddress () : Dictionary; - getBirthday () : string; - getCreated () : string; - getDate () : Dictionary; - getDepartment () : string; - getEmail () : Dictionary; - getFirstName () : string; - getFirstPhonetic () : string; - getFullName () : string; - getId () : number; - getImage () : Ti.Blob; - getInstantMessage () : Dictionary; - getJobTitle () : string; - getKind () : number; - getLastName () : string; - getLastPhonetic () : string; - getMiddleName () : string; - getMiddlePhonetic () : string; - getModified () : string; - getNickname () : string; - getNote () : string; - getOrganization () : string; - getPhone () : Dictionary; - getPrefix () : string; - getRecordId () : number; - getRelatedNames () : Dictionary; - getSuffix () : string; - getUrl () : Dictionary; - setAddress (address: Dictionary) : void; - setBirthday (birthday: string) : void; - setDate (date: Dictionary) : void; - setDepartment (department: string) : void; - setEmail (email: Dictionary) : void; - setFirstName (firstName: string) : void; - setFirstPhonetic (firstPhonetic: string) : void; - setImage (image: Ti.Blob) : void; - setInstantMessage (instantMessage: Dictionary) : void; - setJobTitle (jobTitle: string) : void; - setKind (kind: number) : void; - setLastName (lastName: string) : void; - setLastPhonetic (lastPhonetic: string) : void; - setMiddleName (middleName: string) : void; - setMiddlePhonetic (middlePhonetic: string) : void; - setNickname (nickname: string) : void; - setNote (note: string) : void; - setOrganization (organization: string) : void; - setPhone (phone: Dictionary) : void; - setRecordId (recordId: number) : void; - setRelatedNames (relatedNames: Dictionary) : void; - setUrl (url: Dictionary) : void; - } - } - export interface CloudPush { - SERVICE_DISABLED : number; - SERVICE_INVALID : number; - SERVICE_MISSING : number; - SERVICE_VERSION_UPDATE_REQUIRED : number; - SUCCESS : number; - enabled : boolean; - focusAppOnPush : boolean; - showAppOnTrayClick : boolean; - showTrayNotification : boolean; - showTrayNotificationsWhenFocused : boolean; - singleCallback : boolean; - clearStatus () : void; - getEnabled () : boolean; - getFocusAppOnPush () : boolean; - getShowAppOnTrayClick () : boolean; - getShowTrayNotification () : boolean; - getShowTrayNotificationsWhenFocused () : boolean; - getSingleCallback () : boolean; - isGooglePlayServicesAvailable () : number; - retrieveDeviceToken (config: CloudPushNotificationConfig) : void; - setEnabled (enabled: boolean) : void; - setFocusAppOnPush (focusAppOnPush: boolean) : void; - setShowAppOnTrayClick (showAppOnTrayClick: boolean) : void; - setShowTrayNotification (showTrayNotification: boolean) : void; - setShowTrayNotificationsWhenFocused (showTrayNotificationsWhenFocused: boolean) : void; - setSingleCallback (singleCallback: boolean) : void; - } - export module Media { - export var AUDIO_FILEFORMAT_3GP2 : number; - export var AUDIO_FILEFORMAT_3GPP : number; - export var AUDIO_FILEFORMAT_AIFF : number; - export var AUDIO_FILEFORMAT_AMR : number; - export var AUDIO_FILEFORMAT_CAF : number; - export var AUDIO_FILEFORMAT_MP3 : number; - export var AUDIO_FILEFORMAT_MP4 : number; - export var AUDIO_FILEFORMAT_MP4A : number; - export var AUDIO_FILEFORMAT_WAVE : number; - export var AUDIO_FORMAT_AAC : number; - export var AUDIO_FORMAT_ALAW : number; - export var AUDIO_FORMAT_APPLE_LOSSLESS : number; - export var AUDIO_FORMAT_ILBC : number; - export var AUDIO_FORMAT_IMA4 : number; - export var AUDIO_FORMAT_LINEAR_PCM : number; - export var AUDIO_FORMAT_ULAW : number; - export var AUDIO_HEADPHONES : number; - export var AUDIO_HEADPHONES_AND_MIC : number; - export var AUDIO_HEADSET_INOUT : number; - export var AUDIO_LINEOUT : number; - export var AUDIO_MICROPHONE : number; - export var AUDIO_MUTED : number; - export var AUDIO_RECEIVER_AND_MIC : number; - export var AUDIO_SESSION_CATEGORY_AMBIENT : string; - export var AUDIO_SESSION_CATEGORY_PLAYBACK : string; - export var AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD : string; - export var AUDIO_SESSION_CATEGORY_RECORD : string; - export var AUDIO_SESSION_CATEGORY_SOLO_AMBIENT : string; - export var AUDIO_SESSION_MODE_AMBIENT : number; - export var AUDIO_SESSION_MODE_PLAYBACK : number; - export var AUDIO_SESSION_MODE_PLAY_AND_RECORD : number; - export var AUDIO_SESSION_MODE_RECORD : number; - export var AUDIO_SESSION_MODE_SOLO_AMBIENT : number; - export var AUDIO_SESSION_OVERRIDE_ROUTE_NONE : number; - export var AUDIO_SESSION_OVERRIDE_ROUTE_SPEAKER : number; - export var AUDIO_SESSION_PORT_AIRPLAY : string; - export var AUDIO_SESSION_PORT_BLUETOOTHA2DP : string; - export var AUDIO_SESSION_PORT_BLUETOOTHHFP : string; - export var AUDIO_SESSION_PORT_BLUETOOTHLE : string; - export var AUDIO_SESSION_PORT_BUILTINMIC : string; - export var AUDIO_SESSION_PORT_BUILTINRECEIVER : string; - export var AUDIO_SESSION_PORT_BUILTINSPEAKER : string; - export var AUDIO_SESSION_PORT_CARAUDIO : string; - export var AUDIO_SESSION_PORT_HDMI : string; - export var AUDIO_SESSION_PORT_HEADPHONES : string; - export var AUDIO_SESSION_PORT_HEADSETMIC : string; - export var AUDIO_SESSION_PORT_LINEIN : string; - export var AUDIO_SESSION_PORT_LINEOUT : string; - export var AUDIO_SESSION_PORT_USBAUDIO : string; - export var AUDIO_SPEAKER : number; - export var AUDIO_UNAVAILABLE : number; - export var AUDIO_UNKNOWN : number; - export var CAMERA_FLASH_AUTO : number; - export var CAMERA_FLASH_OFF : number; - export var CAMERA_FLASH_ON : number; - export var CAMERA_FRONT : number; - export var CAMERA_REAR : number; - export var DEVICE_BUSY : number; - export var MEDIA_TYPE_PHOTO : string; - export var MEDIA_TYPE_VIDEO : string; - export var MUSIC_MEDIA_GROUP_ALBUM : number; - export var MUSIC_MEDIA_GROUP_ALBUM_ARTIST : number; - export var MUSIC_MEDIA_GROUP_ARTIST : number; - export var MUSIC_MEDIA_GROUP_COMPOSER : number; - export var MUSIC_MEDIA_GROUP_GENRE : number; - export var MUSIC_MEDIA_GROUP_PLAYLIST : number; - export var MUSIC_MEDIA_GROUP_PODCAST_TITLE : number; - export var MUSIC_MEDIA_GROUP_TITLE : number; - export var MUSIC_MEDIA_TYPE_ALL : number; - export var MUSIC_MEDIA_TYPE_ANY_AUDIO : number; - export var MUSIC_MEDIA_TYPE_AUDIOBOOK : number; - export var MUSIC_MEDIA_TYPE_MUSIC : number; - export var MUSIC_MEDIA_TYPE_PODCAST : number; - export var MUSIC_PLAYER_REPEAT_ALL : number; - export var MUSIC_PLAYER_REPEAT_DEFAULT : number; - export var MUSIC_PLAYER_REPEAT_NONE : number; - export var MUSIC_PLAYER_REPEAT_ONE : number; - export var MUSIC_PLAYER_SHUFFLE_ALBUMS : number; - export var MUSIC_PLAYER_SHUFFLE_DEFAULT : number; - export var MUSIC_PLAYER_SHUFFLE_NONE : number; - export var MUSIC_PLAYER_SHUFFLE_SONGS : number; - export var MUSIC_PLAYER_STATE_INTERRUPTED : number; - export var MUSIC_PLAYER_STATE_PAUSED : number; - export var MUSIC_PLAYER_STATE_PLAYING : number; - export var MUSIC_PLAYER_STATE_SEEK_BACKWARD : number; - export var MUSIC_PLAYER_STATE_SEEK_FORWARD : number; - export var MUSIC_PLAYER_STATE_STOPPED : number; - export var NO_CAMERA : number; - export var NO_VIDEO : number; - export var QUALITY_HIGH : number; - export var QUALITY_LOW : number; - export var QUALITY_MEDIUM : number; - export var UNKNOWN_ERROR : number; - export var VIDEO_CONTROL_DEFAULT : number; - export var VIDEO_CONTROL_EMBEDDED : number; - export var VIDEO_CONTROL_FULLSCREEN : number; - export var VIDEO_CONTROL_HIDDEN : number; - export var VIDEO_CONTROL_NONE : number; - export var VIDEO_CONTROL_VOLUME_ONLY : number; - export var VIDEO_FINISH_REASON_PLAYBACK_ENDED : number; - export var VIDEO_FINISH_REASON_PLAYBACK_ERROR : number; - export var VIDEO_FINISH_REASON_USER_EXITED : number; - export var VIDEO_LOAD_STATE_PLAYABLE : number; - export var VIDEO_LOAD_STATE_PLAYTHROUGH_OK : number; - export var VIDEO_LOAD_STATE_STALLED : number; - export var VIDEO_LOAD_STATE_UNKNOWN : number; - export var VIDEO_MEDIA_TYPE_AUDIO : number; - export var VIDEO_MEDIA_TYPE_NONE : number; - export var VIDEO_MEDIA_TYPE_VIDEO : number; - export var VIDEO_PLAYBACK_STATE_INTERRUPTED : number; - export var VIDEO_PLAYBACK_STATE_PAUSED : number; - export var VIDEO_PLAYBACK_STATE_PLAYING : number; - export var VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD : number; - export var VIDEO_PLAYBACK_STATE_SEEKING_FORWARD : number; - export var VIDEO_PLAYBACK_STATE_STOPPED : number; - export var VIDEO_REPEAT_MODE_NONE : number; - export var VIDEO_REPEAT_MODE_ONE : number; - export var VIDEO_SCALING_ASPECT_FILL : number; - export var VIDEO_SCALING_ASPECT_FIT : number; - export var VIDEO_SCALING_MODE_FILL : number; - export var VIDEO_SCALING_NONE : number; - export var VIDEO_SOURCE_TYPE_FILE : number; - export var VIDEO_SOURCE_TYPE_STREAMING : number; - export var VIDEO_SOURCE_TYPE_UNKNOWN : number; - export var VIDEO_TIME_OPTION_EXACT : number; - export var VIDEO_TIME_OPTION_NEAREST_KEYFRAME : number; - export var apiName : string; - export var appMusicPlayer : Ti.Media.MusicPlayer; - export var audioLineType : number; - export var audioPlaying : boolean; - export var audioSessionCategory : number; - export var audioSessionMode : number; - export var availableCameraMediaTypes : Array; - export var availableCameras : Array; - export var availablePhotoGalleryMediaTypes : Array; - export var availablePhotoMediaTypes : Array; - export var averageMicrophonePower : number; - export var bubbleParent : boolean; - export var cameraFlashMode : number; - export var canRecord : boolean; - export var currentRoute : RouteDescription; - export var isCameraSupported : boolean; - export var peakMicrophonePower : number; - export var systemMusicPlayer : Ti.Media.MusicPlayer; - export var volume : number; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function beep () : void; - export function createAudioPlayer (parameters?: Dictionary) : Ti.Media.AudioPlayer; - export function createAudioRecorder (parameters?: Dictionary) : Ti.Media.AudioRecorder; - export function createItem (parameters?: Dictionary) : Ti.Media.Item; - export function createMusicPlayer (parameters?: Dictionary) : Ti.Media.MusicPlayer; - export function createSound (parameters?: Dictionary) : Ti.Media.Sound; - export function createVideoPlayer (parameters?: Dictionary) : Ti.Media.VideoPlayer; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getAppMusicPlayer () : Ti.Media.MusicPlayer; - export function getAudioLineType () : number; - export function getAudioPlaying () : boolean; - export function getAudioSessionCategory () : number; - export function getAudioSessionMode () : number; - export function getAvailableCameraMediaTypes () : Array; - export function getAvailableCameras () : Array; - export function getAvailablePhotoGalleryMediaTypes () : Array; - export function getAvailablePhotoMediaTypes () : Array; - export function getAverageMicrophonePower () : number; - export function getBubbleParent () : boolean; - export function getCameraFlashMode () : number; - export function getCanRecord () : boolean; - export function getCurrentRoute () : RouteDescription; - export function getIsCameraSupported () : boolean; - export function getPeakMicrophonePower () : number; - export function getSystemMusicPlayer () : Ti.Media.MusicPlayer; - export function getVolume () : number; - export function hideCamera () : void; - export function hideMusicLibrary () : void; - export function isMediaTypeSupported (source: string, type: string) : boolean; - export function openMusicLibrary (options: MusicLibraryOptionsType) : void; - export function openPhotoGallery (options: PhotoGalleryOptionsType) : void; - export function previewImage (options: Dictionary) : void; - export function queryMusicLibrary (query: MediaQueryType) : Array; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function requestAuthorization (callback: (...args : any[]) => any) : void; - export function saveToPhotoGallery (media: Ti.Blob, callbacks: any) : void; - export function saveToPhotoGallery (media: Ti.Filesystem.File, callbacks: any) : void; - export function setAudioSessionCategory (audioSessionCategory: number) : void; - export function setAudioSessionMode (audioSessionMode: number) : void; - export function setAvailableCameraMediaTypes (availableCameraMediaTypes: Array) : void; - export function setAvailablePhotoGalleryMediaTypes (availablePhotoGalleryMediaTypes: Array) : void; - export function setAvailablePhotoMediaTypes (availablePhotoMediaTypes: Array) : void; - export function setAverageMicrophonePower (averageMicrophonePower: number) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setCameraFlashMode (cameraFlashMode: number) : void; - export function setOverrideAudioRoute (route: number) : void; - export function showCamera (options: CameraOptionsType) : void; - export function startMicrophoneMonitor () : void; - export function stopMicrophoneMonitor () : void; - export function switchCamera (camera: number) : void; - export function takePicture () : void; - export function takeScreenshot (callback: (...args : any[]) => any) : void; - export function vibrate (pattern?: Array) : void; - export interface Sound extends Ti.Proxy { - STATE_BUFFERING : number; - STATE_INITIALIZED : number; - STATE_PAUSED : number; - STATE_PLAYING : number; - STATE_STARTING : number; - STATE_STOPPED : number; - STATE_STOPPING : number; - STATE_WAITING_FOR_DATA : number; - STATE_WAITING_FOR_QUEUE : number; - allowBackground : boolean; - duration : number; - looping : boolean; - paused : boolean; - playing : boolean; - time : number; - url : string; - volume : number; - getDuration () : number; - getTime () : number; - getUrl () : string; - getVolume () : number; - isLooping () : boolean; - isPaused () : boolean; - isPlaying () : boolean; - pause () : void; - play () : void; - release () : void; - reset () : void; - setLooping (looping: boolean) : void; - setPaused (paused: boolean) : void; - setTime (time: number) : void; - setUrl (url: string) : void; - setVolume (volume: number) : void; - stop () : void; - } - export interface VideoPlayer extends Ti.UI.View { - allowsAirPlay : boolean; - autoplay : boolean; - contentURL : string; - currentPlaybackTime : number; - duration : number; - endPlaybackTime : number; - fullscreen : boolean; - initialPlaybackTime : number; - loadState : number; - media : any; - mediaControlStyle : number; - mediaTypes : number; - movieControlMode : number; - naturalSize : MovieSize; - playableDuration : number; - playbackState : number; - playing : boolean; - repeatMode : number; - scalingMode : number; - sourceType : number; - url : any; - useApplicationAudioSession : boolean; - volume : number; - cancelAllThumbnailImageRequests () : void; - getAllowsAirPlay () : boolean; - getAutoplay () : boolean; - getContentURL () : string; - getCurrentPlaybackTime () : number; - getDuration () : number; - getEndPlaybackTime () : number; - getFullscreen () : boolean; - getInitialPlaybackTime () : number; - getLoadState () : number; - getMediaControlStyle () : number; - getMediaTypes () : number; - getMovieControlMode () : number; - getNaturalSize () : MovieSize; - getPlayableDuration () : number; - getPlaybackState () : number; - getPlaying () : boolean; - getRepeatMode () : number; - getScalingMode () : number; - getSourceType () : number; - getUrl () : any; - getUseApplicationAudioSession () : boolean; - getVolume () : number; - pause () : void; - play () : void; - release () : void; - requestThumbnailImagesAtTimes (times: Array, option: number, callback: (...args : any[]) => any) : void; - setAllowsAirPlay (allowsAirPlay: boolean) : void; - setAutoplay (autoplay: boolean) : void; - setBackgroundView (view: Ti.UI.View) : void; - setContentURL (contentURL: string) : void; - setCurrentPlaybackTime (currentPlaybackTime: number) : void; - setDuration (duration: number) : void; - setEndPlaybackTime (endPlaybackTime: number) : void; - setFullscreen (fullscreen: boolean) : void; - setInitialPlaybackTime (initialPlaybackTime: number) : void; - setMedia (media: Ti.Blob) : void; - setMedia (media: Ti.Filesystem.File) : void; - setMedia (media: string) : void; - setMediaControlStyle (mediaControlStyle: number) : void; - setMediaTypes (mediaTypes: number) : void; - setMovieControlMode (movieControlMode: number) : void; - setNaturalSize (naturalSize: MovieSize) : void; - setRepeatMode (repeatMode: number) : void; - setScalingMode (scalingMode: number) : void; - setSourceType (sourceType: number) : void; - setUrl (url: string) : void; - setUrl (url: Array) : void; - setUseApplicationAudioSession (useApplicationAudioSession: boolean) : void; - setVolume (volume: number) : void; - stop () : void; - thumbnailImageAtTime (time: number, option: number) : Ti.Blob; - } - export interface AudioRecorder extends Ti.Proxy { - compression : number; - format : number; - paused : boolean; - recording : boolean; - stopped : boolean; - getCompression () : number; - getFormat () : number; - getPaused () : boolean; - getRecording () : boolean; - getStopped () : boolean; - pause () : void; - resume () : void; - setCompression (compression: number) : void; - setFormat (format: number) : void; - start () : void; - stop () : Ti.Filesystem.File; - } - export interface Item extends Ti.Proxy { - albumArtist : string; - albumTitle : string; - albumTrackCount : number; - albumTrackNumber : number; - artist : string; - artwork : Ti.Blob; - composer : string; - discCount : number; - discNumber : number; - genre : string; - isCompilation : boolean; - lyrics : string; - mediaType : number; - playCount : number; - playbackDuration : number; - podcastTitle : string; - rating : number; - skipCount : number; - title : string; - getAlbumArtist () : string; - getAlbumTitle () : string; - getAlbumTrackCount () : number; - getAlbumTrackNumber () : number; - getArtist () : string; - getArtwork () : Ti.Blob; - getComposer () : string; - getDiscCount () : number; - getDiscNumber () : number; - getGenre () : string; - getIsCompilation () : boolean; - getLyrics () : string; - getMediaType () : number; - getPlayCount () : number; - getPlaybackDuration () : number; - getPodcastTitle () : string; - getRating () : number; - getSkipCount () : number; - getTitle () : string; - } - export interface MusicPlayer extends Ti.Proxy { - currentPlaybackTime : number; - nowPlaying : Ti.Media.Item; - playbackState : number; - repeatMode : number; - shuffleMode : number; - volume : number; - getCurrentPlaybackTime () : number; - getNowPlaying () : Ti.Media.Item; - getPlaybackState () : number; - getRepeatMode () : number; - getShuffleMode () : number; - getVolume () : number; - pause () : void; - play () : void; - seekBackward () : void; - seekForward () : void; - setCurrentPlaybackTime (currentPlaybackTime: number) : void; - setQueue (queue: Ti.Media.Item) : void; - setQueue (queue: Array) : void; - setQueue (queue: PlayerQueue) : void; - setRepeatMode (repeatMode: number) : void; - setShuffleMode (shuffleMode: number) : void; - setVolume (volume: number) : void; - skipToBeginning () : void; - skipToNext () : void; - skipToPrevious () : void; - stop () : void; - stopSeeking () : void; - } - export interface AudioPlayer extends Ti.Proxy { - STATE_BUFFERING : number; - STATE_INITIALIZED : number; - STATE_PAUSED : number; - STATE_PLAYING : number; - STATE_STARTING : number; - STATE_STOPPED : number; - STATE_STOPPING : number; - STATE_WAITING_FOR_DATA : number; - STATE_WAITING_FOR_QUEUE : number; - allowBackground : boolean; - autoplay : boolean; - bitRate : number; - bufferSize : number; - duration : number; - idle : boolean; - paused : boolean; - playing : boolean; - progress : number; - state : number; - time : number; - url : string; - volume : number; - waiting : boolean; - getAllowBackground () : boolean; - getAutoplay () : boolean; - getBitRate () : number; - getBufferSize () : number; - getDuration () : number; - getIdle () : boolean; - getPaused () : boolean; - getPlaying () : boolean; - getProgress () : number; - getState () : number; - getTime () : number; - getUrl () : string; - getVolume () : number; - getWaiting () : boolean; - isPaused () : boolean; - isPlaying () : boolean; - pause () : void; - play () : void; - release () : void; - setBitRate (bitRate: number) : void; - setBufferSize (bufferSize: number) : void; - setPaused (paused: boolean) : void; - setTime (time: number) : void; - setUrl (url: string) : void; - setVolume (volume: number) : void; - start () : void; - stateDescription (state: number) : string; - stop () : void; - } - export interface Android { - scanMediaFiles (paths: Array, mimeTypes: Array, callback: (...args : any[]) => any) : void; - setSystemWallpaper (image: Ti.Blob, scale: boolean) : void; - } - } - export module Platform { - export var BATTERY_STATE_CHARGING : number; - export var BATTERY_STATE_FULL : number; - export var BATTERY_STATE_UNKNOWN : number; - export var BATTERY_STATE_UNPLUGGED : number; - export var address : string; - export var apiName : string; - export var architecture : string; - export var availableMemory : number; - export var batteryLevel : number; - export var batteryMonitoring : boolean; - export var batteryState : number; - export var bubbleParent : boolean; - export var displayCaps : Ti.Platform.DisplayCaps; - export var id : string; - export var locale : string; - export var macaddress : string; - export var manufacturer : string; - export var model : string; - export var name : string; - export var netmask : string; - export var osname : string; - export var ostype : string; - export var processorCount : number; - export var runtime : string; - export var username : string; - export var version : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function canOpenURL (url: string) : boolean; - export function createUUID () : string; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAddress () : string; - export function getApiName () : string; - export function getArchitecture () : string; - export function getAvailableMemory () : number; - export function getBatteryLevel () : number; - export function getBatteryMonitoring () : boolean; - export function getBatteryState () : number; - export function getBubbleParent () : boolean; - export function getDisplayCaps () : Ti.Platform.DisplayCaps; - export function getId () : string; - export function getLocale () : string; - export function getMacaddress () : string; - export function getManufacturer () : string; - export function getModel () : string; - export function getName () : string; - export function getNetmask () : string; - export function getOsname () : string; - export function getOstype () : string; - export function getProcessorCount () : number; - export function getRuntime () : string; - export function getUsername () : string; - export function getVersion () : string; - export function is24HourTimeFormat () : boolean; - export function openURL (url: string) : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBatteryMonitoring (batteryMonitoring: boolean) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface DisplayCaps extends Ti.Proxy { - density : string; - dpi : number; - logicalDensityFactor : number; - platformHeight : number; - platformWidth : number; - xdpi : number; - ydpi : number; - getDensity () : string; - getDpi () : number; - getLogicalDensityFactor () : number; - getPlatformHeight () : number; - getPlatformWidth () : number; - getXdpi () : number; - getYdpi () : number; - } - export interface Android { - API_LEVEL : number; - PHYSICAL_SIZE_CATEGORY_LARGE : number; - PHYSICAL_SIZE_CATEGORY_NORMAL : number; - PHYSICAL_SIZE_CATEGORY_SMALL : number; - PHYSICAL_SIZE_CATEGORY_UNDEFINED : number; - PHYSICAL_SIZE_CATEGORY_XLARGE : number; - physicalSizeCategory : number; - getPhysicalSizeCategory () : number; - } - } - export interface Buffer extends Ti.Proxy { - byteOrder : number; - length : number; - type : string; - value : any; - append (sourceBuffer: Ti.Buffer, sourceOffset?: number, sourceLength?: number) : number; - clear () : void; - clone (offset?: number, length?: number) : Ti.Buffer; - copy (sourceBuffer: Ti.Buffer, offset: number, sourceOffset?: number, sourceLength?: number) : number; - fill (fillByte: number, offset?: number, length?: number) : void; - getByteOrder () : number; - getLength () : number; - getType () : string; - getValue () : any; - insert (sourceBuffer: Ti.Buffer, offset: number, sourceOffset?: number, sourceLength?: number) : number; - release () : void; - setLength (length: number) : void; - toBlob () : Ti.Blob; - toString () : string; - } - export enum BufferStream { + + /** + * Base type for all Titanium modules. + */ + namespace Module { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; } - export module Calendar { - export var AUTHORIZATION_AUTHORIZED : number; - export var AUTHORIZATION_DENIED : number; - export var AUTHORIZATION_RESTRICTED : number; - export var AUTHORIZATION_UNKNOWN : number; - export var AVAILABILITY_BUSY : number; - export var AVAILABILITY_FREE : number; - export var AVAILABILITY_NOTSUPPORTED : number; - export var AVAILABILITY_TENTATIVE : number; - export var AVAILABILITY_UNAVAILABLE : number; - export var METHOD_ALERT : number; - export var METHOD_DEFAULT : number; - export var METHOD_EMAIL : number; - export var METHOD_SMS : number; - export var RECURRENCEFREQUENCY_DAILY : number; - export var RECURRENCEFREQUENCY_MONTHLY : number; - export var RECURRENCEFREQUENCY_WEEKLY : number; - export var RECURRENCEFREQUENCY_YEARLY : number; - export var SPAN_FUTUREEVENTS : number; - export var SPAN_THISEVENT : number; - export var STATE_DISMISSED : number; - export var STATE_FIRED : number; - export var STATE_SCHEDULED : number; - export var STATUS_CANCELED : number; - export var STATUS_CONFIRMED : number; - export var STATUS_NONE : number; - export var STATUS_TENTATIVE : number; - export var VISIBILITY_CONFIDENTIAL : number; - export var VISIBILITY_DEFAULT : number; - export var VISIBILITY_PRIVATE : number; - export var VISIBILITY_PUBLIC : number; - export var allAlerts : Array; - export var allCalendars : Array; - export var allEditableCalendars : Array; - export var apiName : string; - export var bubbleParent : boolean; - export var defaultCalendar : Ti.Calendar.Calendar; - export var eventsAuthorization : number; - export var selectableCalendars : Array; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllAlerts () : Array; - export function getAllCalendars () : Array; - export function getAllEditableCalendars () : Array; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getCalendarById (id: string) : Ti.Calendar.Calendar; - export function getDefaultCalendar () : Ti.Calendar.Calendar; - export function getEventsAuthorization () : number; - export function getSelectableCalendars () : Array; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function requestEventsAuthorization (callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface Calendar extends Ti.Proxy { - hidden : boolean; - id : string; - name : string; - selected : boolean; - createEvent (properties: Dictionary) : Ti.Calendar.Event; - getEventById (id: number) : Ti.Calendar.Event; - getEventsBetweenDates (date1: Date, date2: Date) : Array; - getEventsInDate (year: number, month: number, day: number) : Array; - getEventsInMonth (year: number, month: number) : Array; - getEventsInYear (year: number) : Array; - getHidden () : boolean; - getId () : string; - getName () : string; - getSelected () : boolean; - } - export interface Reminder extends Ti.Proxy { - id : string; - method : number; - minutes : number; - getId () : string; - getMethod () : number; - getMinutes () : number; - } - export interface Event extends Ti.Proxy { - alerts : Array; - allDay : boolean; - availability : number; - begin : Date; - description : string; - end : Date; - extendedProperties : Dictionary; - hasAlarm : boolean; - id : string; - isDetached : boolean; - location : string; - notes : string; - recurenceRule : Ti.Calendar.RecurrenceRule; - recurenceRules : Array; - reminders : Array; - status : number; - title : string; - visibility : number; - addRecurrenceRule (rule: Ti.Calendar.RecurrenceRule) : void; - createAlert (data: Dictionary) : Ti.Calendar.Alert; - createRecurenceRule (data: Dictionary) : Ti.Calendar.RecurrenceRule; - createReminder (data: Dictionary) : Ti.Calendar.Reminder; - getAlerts () : Array; - getAllDay () : boolean; - getAvailability () : number; - getBegin () : Date; - getDescription () : string; - getEnd () : Date; - getExtendedProperties () : Dictionary; - getExtendedProperty (name: string) : string; - getHasAlarm () : boolean; - getId () : string; - getIsDetached () : boolean; - getLocation () : string; - getNotes () : string; - getRecurenceRule () : Ti.Calendar.RecurrenceRule; - getRecurenceRules () : Array; - getReminders () : Array; - getStatus () : number; - getTitle () : string; - getVisibility () : number; - refresh () : boolean; - remove (span: number) : boolean; - removeRecurenceRule (rule: Ti.Calendar.RecurrenceRule) : void; - save (span: number) : boolean; - setAlerts (alerts: Array) : void; - setAllDay (allDay: boolean) : void; - setBegin (begin: Date) : void; - setEnd (end: Date) : void; - setExtendedProperty (name: string, value: string) : void; - setLocation (location: string) : void; - setNotes (notes: string) : void; - setRecurenceRule (recurenceRule: Ti.Calendar.RecurrenceRule) : void; - setRecurenceRules (recurenceRules: Array) : void; - setTitle (title: string) : void; - } - export interface RecurrenceRule extends Ti.Proxy { - calendarID : string; - daysOfTheMonth : Array; - daysOfTheWeek : daysOfTheWeekDictionary; - daysOfTheYear : Array; - end : recurrenceEndDictionary; - frequency : number; - interval : number; - monthsOfTheYear : Array; - setPositions : Array; - weeksOfTheYear : Array; - getCalendarID () : string; - getDaysOfTheMonth () : Array; - getDaysOfTheWeek () : daysOfTheWeekDictionary; - getDaysOfTheYear () : Array; - getEnd () : recurrenceEndDictionary; - getFrequency () : number; - getInterval () : number; - getMonthsOfTheYear () : Array; - getSetPositions () : Array; - getWeeksOfTheYear () : Array; - } - export interface Alert extends Ti.Proxy { - absoluteDate : Date; - alarmTime : Date; - begin : Date; - end : Date; - eventId : number; - id : string; - minutes : number; - relativeOffset : number; - state : number; - getAbsoluteDate () : Date; - getAlarmTime () : Date; - getBegin () : Date; - getEnd () : Date; - getEventId () : number; - getId () : string; - getMinutes () : number; - getRelativeOffset () : number; - getState () : number; - setAbsoluteDate (absoluteDate: Date) : void; - setRelativeOffset (relativeOffset: number) : void; - } + + /** + * The top-level API module, containing methods to output messages to the system log. + */ + namespace API { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Logs messages with a `debug` severity-level. + */ + function debug(message: ReadonlyArray): void; + + /** + * Logs messages with a `debug` severity-level. + */ + function debug(message: string): void; + + /** + * Logs messages with an `error` severity-level. + */ + function error(message: ReadonlyArray): void; + + /** + * Logs messages with an `error` severity-level. + */ + function error(message: string): void; + + /** + * Logs messages with an `info` severity-level. + */ + function info(message: ReadonlyArray): void; + + /** + * Logs messages with an `info` severity-level. + */ + function info(message: string): void; + + /** + * Logs messages with the specified severity-level. + */ + function log(level: string, message: ReadonlyArray): void; + + /** + * Logs messages with the specified severity-level. + */ + function log(level: string, message: string): void; + + /** + * Logs messages with a `timestamp` severity-level, prefixed with a timestamp float number + * representing the number of seconds since January 1st, 2001. + */ + function timestamp(message: ReadonlyArray): void; + + /** + * Logs messages with a `timestamp` severity-level, prefixed with a timestamp float number + * representing the number of seconds since January 1st, 2001. + */ + function timestamp(message: string): void; + + /** + * Logs messages with a `trace` severity-level. + */ + function trace(message: ReadonlyArray): void; + + /** + * Logs messages with a `trace` severity-level. + */ + function trace(message: string): void; + + /** + * Logs messages with a `warn` severity-level. + */ + function warn(message: ReadonlyArray): void; + + /** + * Logs messages with a `warn` severity-level. + */ + function warn(message: string): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + } - export module Filesystem { - export var MODE_APPEND : number; - export var MODE_READ : number; - export var MODE_WRITE : number; - export var apiName : string; - export var applicationCacheDirectory : string; - export var applicationDataDirectory : string; - export var applicationDirectory : string; - export var applicationSupportDirectory : string; - export var bubbleParent : boolean; - export var externalStorageDirectory : string; - export var lineEnding : string; - export var resRawDirectory : string; - export var resourcesDirectory : string; - export var separator : string; - export var tempDirectory : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createTempDirectory () : Ti.Filesystem.File; - export function createTempFile () : Ti.Filesystem.File; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getApplicationCacheDirectory () : string; - export function getApplicationDataDirectory () : string; - export function getApplicationDirectory () : string; - export function getApplicationSupportDirectory () : string; - export function getBubbleParent () : boolean; - export function getExternalStorageDirectory () : string; - export function getFile (path: string, ...extraPaths: string[]) : Ti.Filesystem.File; - export function getLineEnding () : string; - export function getResRawDirectory () : string; - export function getResourcesDirectory () : string; - export function getSeparator () : string; - export function getTempDirectory () : string; - export function isExternalStoragePresent () : boolean; - export function openStream (mode: number, path: string, ...extraPaths: string[]) : Ti.Filesystem.FileStream; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface File extends Ti.Proxy { - executable : boolean; - hidden : boolean; - name : string; - nativePath : string; - parent : Ti.Filesystem.File; - readonly : boolean; - remoteBackup : boolean; - size : number; - symbolicLink : boolean; - writable : boolean; - writeable : boolean; - append (data: string) : boolean; - append (data: Ti.Blob) : boolean; - append (data: Ti.Filesystem.File) : boolean; - copy (destinationPath: string) : boolean; - createDirectory () : boolean; - createFile () : boolean; - createTimestamp () : number; - deleteDirectory (recursive?: boolean) : boolean; - deleteFile () : boolean; - exists () : boolean; - extension () : string; - getDirectoryListing () : Array; - getExecutable () : boolean; - getHidden () : boolean; - getName () : string; - getNativePath () : string; - getParent () : any; - getReadonly () : boolean; - getRemoteBackup () : boolean; - getSize () : number; - getSymbolicLink () : boolean; - getWritable () : boolean; - getWriteable () : boolean; - isDirectory () : boolean; - isFile () : boolean; - modificationTimestamp () : number; - move (newpath: string) : boolean; - open (mode: number) : Ti.Filesystem.FileStream; - read () : Ti.Blob; - rename (newname: string) : boolean; - resolve () : string; - setHidden (hidden: boolean) : void; - setRemoteBackup (remoteBackup: boolean) : void; - spaceAvailable () : number; - write (data: string, append?: boolean) : boolean; - write (data: Ti.Filesystem.File, append?: boolean) : boolean; - write (data: Ti.Blob, append?: boolean) : boolean; + + /** + * The top-level Accelerometer module, used to determine the device's physical position. + */ + namespace Accelerometer { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * Used for transmitting developer-defined Analytics events to the Appcelerator Analytics product. + */ + namespace Analytics { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * JSON representation of the last analytics event generated. + */ + const lastEvent: string; + + /** + * Sends a generic event for this application session. + * **Not displayed in Analytics UI**. + */ + function addEvent(type: string, name: string, data?: any): void; + + /** + * Sends a feature event for this application session. + */ + function featureEvent(name: string, data?: any): number; + + /** + * Sets a list of events that will not be sent to the analytics server. + */ + function filterEvents(events: ReadonlyArray): void; + + /** + * Sends a navigation event for this application session. + * **Not displayed in Analytics UI**. + */ + function navEvent(from: string, to: string, name?: string, data?: any): void; + + /** + * Sends a settings event for this application session. + * **Not displayed in Analytics UI**. + */ + function settingsEvent(name: string, data?: any): void; + + /** + * Send a timed event for this application session. + * **Not displayed in Analytics UI**. + */ + function timedEvent(name: string, start: Date, stop: Date, duration: number, data?: any): void; + + /** + * Sends a user event for this application session. **Not displayed in Analytics UI**. + */ + function userEvent(name: string, data?: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getLastEvent(): string; + + } + + /** + * The top-level Android module. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * User switched airplane mode on or off. + */ + const ACTION_AIRPLANE_MODE_CHANGED: string; + + /** + * List all applications. + */ + const ACTION_ALL_APPS: string; + + /** + * Handle an incoming phone call. + */ + const ACTION_ANSWER: string; + + /** + * Used to indicate that the data is an attachment. + */ + const ACTION_ATTACH_DATA: string; + + /** + * Listen to battery state change status. + */ + const ACTION_BATTERY_CHANGED: string; + + /** + * Indicates low battery condition on the device. + */ + const ACTION_BATTERY_LOW: string; + + /** + * Inidicates the battery is now okay after being low. + */ + const ACTION_BATTERY_OKAY: string; + + /** + * Indicates the system has finished booting. + */ + const ACTION_BOOT_COMPLETED: string; + + /** + * Show activity for reporting a bug. + */ + const ACTION_BUG_REPORT: string; + + /** + * Perform a call to someone specified by the `data` property. + */ + const ACTION_CALL: string; + + /** + * User pressed the call button. + */ + const ACTION_CALL_BUTTON: string; + + /** + * The camera button was pressed. + */ + const ACTION_CAMERA_BUTTON: string; + + /** + * Display an activity chooser. + */ + const ACTION_CHOOSER: string; + + /** + * User dismissed a temporary system dialog, such as the notification drawer or recent-app drawer. + */ + const ACTION_CLOSE_SYSTEM_DIALOGS: string; + + /** + * The device's configuration changed. + */ + const ACTION_CONFIGURATION_CHANGED: string; + + /** + * Create a shortcut. + */ + const ACTION_CREATE_SHORTCUT: string; + + /** + * Date changed. + */ + const ACTION_DATE_CHANGED: string; + + /** + * Default action, which is `Titanium.Android.ACTION_VIEW` + */ + const ACTION_DEFAULT: string; + + /** + * Delete the data specified by the Intent's `data` property. + */ + const ACTION_DELETE: string; + + /** + * Indicates a low memory condition on the device. + */ + const ACTION_DEVICE_STORAGE_LOW: string; + + /** + * Dial a number specified by the Intent's `data` property. + */ + const ACTION_DIAL: string; + + /** + * Provide editable access to the data specified by the Intent's `data` property. + */ + const ACTION_EDIT: string; + + /** + * Allow the user to select a particular kind of data specified by the Intent's `type` property. + */ + const ACTION_GET_CONTENT: string; + + /** + * GTalk connection has been established. + */ + const ACTION_GTALK_SERVICE_CONNECTED: string; + + /** + * GTalk connections has been disconnected. + */ + const ACTION_GTALK_SERVICE_DISCONNECTED: string; + + /** + * A wired headset has been plugged in or unplugged. + */ + const ACTION_HEADSET_PLUG: string; + + /** + * An input method has been changed. + */ + const ACTION_INPUT_METHOD_CHANGED: string; + + /** + * Insert an empty item into the given container. + */ + const ACTION_INSERT: string; + + /** + * Pick an existing item or insert an empty item, then edit it. + */ + const ACTION_INSERT_OR_EDIT: string; + + /** + * Start as the main entry point. + */ + const ACTION_MAIN: string; + + /** + * Indicates low memory condition notification acknowledged by user and package management should be started. + */ + const ACTION_MANAGE_PACKAGE_STORAGE: string; + + /** + * External media was removed from SD card slot, but mount point was not unmounted. + */ + const ACTION_MEDIA_BAD_REMOVAL: string; + + /** + * The media button was pressed. + */ + const ACTION_MEDIA_BUTTON: string; + + /** + * External media is present and being disk-checked + */ + const ACTION_MEDIA_CHECKING: string; + + /** + * User has expressed the desire to remove the external storage media. + */ + const ACTION_MEDIA_EJECT: string; + + /** + * External media is present and mounted at its mount point. + */ + const ACTION_MEDIA_MOUNTED: string; + + /** + * External media is present, but is using an incompatible filesystem or is blank. + */ + const ACTION_MEDIA_NOFS: string; + + /** + * External media has been removed. + */ + const ACTION_MEDIA_REMOVED: string; + + /** + * The media scanner has finished scanning a directory. + */ + const ACTION_MEDIA_SCANNER_FINISHED: string; + + /** + * Request the media scanner to scan a file and add it to the media database. + */ + const ACTION_MEDIA_SCANNER_SCAN_FILE: string; + + /** + * The media scanner has started scanning a directory. + */ + const ACTION_MEDIA_SCANNER_STARTED: string; + + /** + * External media is unmounted because it is being shared via USB mass storage. + */ + const ACTION_MEDIA_SHARED: string; + + /** + * Corresponds to the Android `Intent.ACTION_MEDIA_UNMOUNTABLE` constant. + */ + const ACTION_MEDIA_UNMOUNTABLE: string; + + /** + * External media is present, but not mounted at its mount point. + */ + const ACTION_MEDIA_UNMOUNTED: string; + + /** + * An outgoing call is about to be placed. + */ + const ACTION_NEW_OUTGOING_CALL: string; + + /** + * A new application package has been installed on the device. + */ + const ACTION_PACKAGE_ADDED: string; + + /** + * An existing application package has been changed. + */ + const ACTION_PACKAGE_CHANGED: string; + + /** + * The user has cleared the data of a package. + */ + const ACTION_PACKAGE_DATA_CLEARED: string; + + /** + * Trigger the download and eventual installation of a package. + */ + const ACTION_PACKAGE_INSTALL: string; + + /** + * An existing application package has been removed from the device. + */ + const ACTION_PACKAGE_REMOVED: string; + + /** + * A new version of an application package has been installed, replacing an existing version that was previously installed. + */ + const ACTION_PACKAGE_REPLACED: string; + + /** + * The user has restarted a package, and all of its processes have been killed. + */ + const ACTION_PACKAGE_RESTARTED: string; + + /** + * Pick an item from the directory indicated by the Intent's `data` property. + */ + const ACTION_PICK: string; + + /** + * Pick an activity given an intent. + */ + const ACTION_PICK_ACTIVITY: string; + + /** + * External power has been connected to the device. + */ + const ACTION_POWER_CONNECTED: string; + + /** + * External power has been disconnected from the device. + */ + const ACTION_POWER_DISCONNECTED: string; + + /** + * Show power usage information to the user. + */ + const ACTION_POWER_USAGE_SUMMARY: string; + + /** + * Content provider published new events or items. + */ + const ACTION_PROVIDER_CHANGED: string; + + /** + * Device rebooted. + */ + const ACTION_REBOOT: string; + + /** + * Run the data. + */ + const ACTION_RUN: string; + + /** + * Sent when the device goes to sleep and becomes non-interactive. + */ + const ACTION_SCREEN_OFF: string; + + /** + * Sent when the device wakes up and becomes interactive. + */ + const ACTION_SCREEN_ON: string; + + /** + * Perform a search. + */ + const ACTION_SEARCH: string; + + /** + * Start action associated with long pressing on the search key. + */ + const ACTION_SEARCH_LONG_PRESS: string; + + /** + * Deliver data to another activity. + */ + const ACTION_SEND: string; + + /** + * Deliver data to the recipient specified by the Intent's `data` property. + */ + const ACTION_SENDTO: string; + + /** + * Deliver multiple data to another activity. + */ + const ACTION_SEND_MULTIPLE: string; + + /** + * Show settings for choosing the system wallpaper. + */ + const ACTION_SET_WALLPAPER: string; + + /** + * Device is shutting down. + */ + const ACTION_SHUTDOWN: string; + + /** + * Perform data synchronization. + */ + const ACTION_SYNC: string; + + /** + * Start the platform-defined tutorial. + */ + const ACTION_SYSTEM_TUTORIAL: string; + + /** + * The time was set. + */ + const ACTION_TIME_CHANGED: string; + + /** + * The current time changed. Sent every minute. + */ + const ACTION_TIME_TICK: string; + + /** + * A user ID was removed from the system. + */ + const ACTION_UID_REMOVED: string; + + /** + * The device has entered USB Mass Storage mode. + */ + const ACTION_UMS_CONNECTED: string; + + /** + * The device has exited USB Mass Storage mode. + */ + const ACTION_UMS_DISCONNECTED: string; + + /** + * Sent when the user is present after device wakes up. + */ + const ACTION_USER_PRESENT: string; + + /** + * Display data to the user. + */ + const ACTION_VIEW: string; + + /** + * Start voice command. + */ + const ACTION_VOICE_COMMAND: string; + + /** + * The current system wallpaper has changed. + */ + const ACTION_WALLPAPER_CHANGED: string; + + /** + * Perform a web search. + */ + const ACTION_WEB_SEARCH: string; + + /** + * Set if the activity should be considered as an alternative action to the data the user is currently viewing. + */ + const CATEGORY_ALTERNATIVE: string; + + /** + * Activity can browse the Internet. + */ + const CATEGORY_BROWSABLE: string; + + /** + * Activity should be used as the default action to perform on a piece of data. + */ + const CATEGORY_DEFAULT: string; + + /** + * Activity is in the development preference panel. + */ + const CATEGORY_DEVELOPMENT_PREFERENCE: string; + + /** + * Activity can run inside a parent activity. + */ + const CATEGORY_EMBED: string; + + /** + * To be used as test code for framework instrumentation tests. + */ + const CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST: string; + + /** + * Home activity, the first activity that is displayed when the device boots. + */ + const CATEGORY_HOME: string; + + /** + * Provides information about the package it is in. + */ + const CATEGORY_INFO: string; + + /** + * Activity is in the device's launcher. + */ + const CATEGORY_LAUNCHER: string; + + /** + * This activity may be exercised by the monkey or other automated test tools. + */ + const CATEGORY_MONKEY: string; + + /** + * Activity can open raw `file://` or `scheme://` URIs. + */ + const CATEGORY_OPENABLE: string; + + /** + * This activity is a preference panel. + */ + const CATEGORY_PREFERENCE: string; + + /** + * To be used as a sample code example (not part of the normal user experience). + */ + const CATEGORY_SAMPLE_CODE: string; + + /** + * Activity should be considered as an alternative selection action to the data the user + * has currently selected. + */ + const CATEGORY_SELECTED_ALTERNATIVE: string; + + /** + * Activity to be used in a tab activity. + */ + const CATEGORY_TAB: string; + + /** + * To be used as a test (not part of the normal user experience). + */ + const CATEGORY_TEST: string; + + /** + * To be used as a unit test (run through the Test Harness). + */ + const CATEGORY_UNIT_TEST: string; + + /** + * Integer indicating how many pending alarms are being delivered with the intent. + */ + const EXTRA_ALARM_COUNT: string; + + /** + * String array containing e-mail addresses for blind carbon copying. + */ + const EXTRA_BCC: string; + + /** + * String array containing e-mail addresses for carbon copying. + */ + const EXTRA_CC: string; + + /** + * Boolean indicating full uninstall (true) or partial uninstall (false). + */ + const EXTRA_DATA_REMOVED: string; + + /** + * Boolean indicating to restart the application or not. + */ + const EXTRA_DONT_KILL_APP: string; + + /** + * String array containing e-mail addresses. + */ + const EXTRA_EMAIL: string; + + /** + * An Intent describing the choices you would like shown. + */ + const EXTRA_INTENT: string; + + /** + * A KeyEvent object containing the event that triggered the creation of the Intent it is in. + */ + const EXTRA_KEY_EVENT: string; + + /** + * String holding the phone number to call or number that was called. + */ + const EXTRA_PHONE_NUMBER: string; + + /** + * Boolean indicating if the package is being replaced. + */ + const EXTRA_REPLACING: string; + + /** + * Bitmap icon. + */ + const EXTRA_SHORTCUT_ICON: string; + + /** + * Resource of the shortcut. + */ + const EXTRA_SHORTCUT_ICON_RESOURCE: string; + + /** + * Intent of a shortcut. + */ + const EXTRA_SHORTCUT_INTENT: string; + + /** + * Name of the shortcut. + */ + const EXTRA_SHORTCUT_NAME: string; + + /** + * URI containing the stream data. + */ + const EXTRA_STREAM: string; + + /** + * Subject line of a message. + */ + const EXTRA_SUBJECT: string; + + /** + * Initial data to place in a newly created record. + */ + const EXTRA_TEMPLATE: string; + + /** + * Corresponds to the Android `Intent.EXTRA_TEXT` constant. + */ + const EXTRA_TEXT: string; + + /** + * Corresponds to the Android `Intent.EXTRA_TITLE` constant. + */ + const EXTRA_TITLE: string; + + /** + * UID of the assigned packaged. + */ + const EXTRA_UID: string; + + /** + * Not used. + */ + const FILL_IN_ACTION: number; + + /** + * Not used. + */ + const FILL_IN_CATEGORIES: number; + + /** + * Not used. + */ + const FILL_IN_COMPONENT: number; + + /** + * Not used. + */ + const FILL_IN_DATA: number; + + /** + * Not used. + */ + const FILL_IN_PACKAGE: number; + + /** + * If activity is already running, bring it to the foreground. + */ + const FLAG_ACTIVITY_BROUGHT_TO_FRONT: number; + + /** + * If the activity is present, removes any activities on top of it to make it the foreground activity. + */ + const FLAG_ACTIVITY_CLEAR_TOP: number; + + /** + * Corresponds to the Android `Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` constant. + */ + const FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET: number; + + /** + * Exclude the activity from recently launched activities. + */ + const FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS: number; + + /** + * Return result to the original calling activity. + */ + const FLAG_ACTIVITY_FORWARD_RESULT: number; + + /** + * Activity was launched from history. + */ + const FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY: number; + + /** + * Start the activity as a new task even if it exists. + */ + const FLAG_ACTIVITY_MULTIPLE_TASK: number; + + /** + * Activity will be the start of a new task (collection of activities). + */ + const FLAG_ACTIVITY_NEW_TASK: number; + + /** + * Prevent transition animation. + */ + const FLAG_ACTIVITY_NO_ANIMATION: number; + + /** + * Do not keep the activity in the history stack. + */ + const FLAG_ACTIVITY_NO_HISTORY: number; + + /** + * Disables the [onUserLeaveHint()](http://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()) callback. + */ + const FLAG_ACTIVITY_NO_USER_ACTION: number; + + /** + * Corresponds to the Android `Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP` constant. + */ + const FLAG_ACTIVITY_PREVIOUS_IS_TOP: number; + + /** + * If the activity already exists, place it at the top of the history stack. + */ + const FLAG_ACTIVITY_REORDER_TO_FRONT: number; + + /** + * If the task already exists, resets the task to its initial state. + */ + const FLAG_ACTIVITY_RESET_TASK_IF_NEEDED: number; + + /** + * Do not launch the activity if it is already running. + */ + const FLAG_ACTIVITY_SINGLE_TOP: number; + + /** + * Enable a log message to print out the resolution of the intent. + */ + const FLAG_DEBUG_LOG_RESOLUTION: number; + + /** + * Indicates the intent is coming from a background operation. + */ + const FLAG_FROM_BACKGROUND: number; + + /** + * Grant read permission on the URI in the Intent's data or clipboard. + */ + const FLAG_GRANT_READ_URI_PERMISSION: number; + + /** + * Grants write permission on the URI in the Intent's data or clipboard. + */ + const FLAG_GRANT_WRITE_URI_PERMISSION: number; + + /** + * When sending a broadcast, only registered receivers will be called. + */ + const FLAG_RECEIVER_REGISTERED_ONLY: number; + + /** + * Cancel the current pending intent before creating a new one. + */ + const FLAG_CANCEL_CURRENT: number; + + /** + * If the current intent does not exist, do not create it. + */ + const FLAG_NO_CREATE: number; + + /** + * The pending intent can only be used once. + */ + const FLAG_ONE_SHOT: number; + + /** + * If the current pending intent already exists, only update the current intent's extra data. + */ + const FLAG_UPDATE_CURRENT: number; + + /** + * Notification category indicating an alarm or timer. + */ + const CATEGORY_ALARM: string; + + /** + * Notification category indicating an incoming call (voice or video) or similar synchronous + * communication request. + */ + const CATEGORY_CALL: string; + + /** + * Notification category indicating an asynchronous bulk message (email). + */ + const CATEGORY_EMAIL: string; + + /** + * Notification category indicating an error in background operation or authentication status. + */ + const CATEGORY_ERROR: string; + + /** + * Notification category indicating a calendar event. + */ + const CATEGORY_EVENT: string; + + /** + * Notification category indicating an incoming direct message (SMS, instant message, etc.). + */ + const CATEGORY_MESSAGE: string; + + /** + * Notification category indicating the progress of a long-running background operation. + */ + const CATEGORY_PROGRESS: string; + + /** + * Notification category indicating a promotion or advertisement. + */ + const CATEGORY_PROMO: string; + + /** + * Notification category indicating a specific, timely recommendation for a single thing. + */ + const CATEGORY_RECOMMENDATION: string; + + /** + * Notification category for a running background service. + */ + const CATEGORY_SERVICE: string; + + /** + * Notification category for a social network or sharing update. + */ + const CATEGORY_SOCIAL: string; + + /** + * Notification category indicating ongoing information about device or contextual status. + */ + const CATEGORY_STATUS: string; + + /** + * Notification category indicating media transport control for playback. + */ + const CATEGORY_TRANSPORT: string; + + /** + * Use all default settings for a notification; see + * [Notification.defaults](Titanium.Android.Notification.defaults). + */ + const DEFAULT_ALL: number; + + /** + * Use the default light settings for a notification; see + * [Notification.defaults](Titanium.Android.Notification.defaults). + */ + const DEFAULT_LIGHTS: number; + + /** + * Use the default sound settings for a notification; see + * [Notification.defaults](Titanium.Android.Notification.defaults). + */ + const DEFAULT_SOUND: number; + + /** + * Use the default vibration settings for a notification; see + * [Notification.defaults](Titanium.Android.Notification.defaults). + */ + const DEFAULT_VIBRATE: number; + + /** + * Cancel the notification when it is clicked by the user. + */ + const FLAG_AUTO_CANCEL: number; + + /** + * Repeat audio until the notification is cancelled or the notification window + * is opened. + */ + const FLAG_INSISTENT: number; + + /** + * Do not cancel the notification when the user clicks the Clear All button. + */ + const FLAG_NO_CLEAR: number; + + /** + * Specifies that a notification is in reference to something that is ongoing, like a phone call. + */ + const FLAG_ONGOING_EVENT: number; + + /** + * Play an alert (sound, lights, and/or vibration) once each time the notification is sent, even if it has not been canceled before that. + */ + const FLAG_ONLY_ALERT_ONCE: number; + + /** + * Use LED lights to alert the user to the notification. + */ + const FLAG_SHOW_LIGHTS: number; + + /** + * Use for urgent or time-critical notifications, for example, turn-by-turn directions or + * emergency alerts. + */ + const PRIORITY_MAX: number; + + /** + * Use for high priority notifications like real-time chat messages. + */ + const PRIORITY_HIGH: number; + + /** + * Default priority if it does no fit into another priority category. + */ + const PRIORITY_DEFAULT: number; + + /** + * Use for low priority notifications like software updates. + */ + const PRIORITY_LOW: number; + + /** + * Use for expired events. + */ + const PRIORITY_MIN: number; + + /** + * Shows basic information about the notification. + */ + const VISIBILITY_PRIVATE: number; + + /** + * Shows the notification's full content on the lockscreen. This is the system default if visibility is left unspecified. + */ + const VISIBILITY_PUBLIC: number; + + /** + * Shows the most minimal information of the notification on the lockscreen. + */ + const VISIBILITY_SECRET: number; + + /** + * QuickSettings tile is unavailble. + */ + const TILE_STATE_UNAVAILABLE: number; + + /** + * QuickSettings tile is inactive. + */ + const TILE_STATE_INACTIVE: number; + + /** + * QuickSettings tile is active. + */ + const TILE_STATE_ACTIVE: number; + + /** + * Ensures that the CPU is running; the screen and keyboard backlight will be allowed to go off. + */ + const WAKE_LOCK_PARTIAL: number; + + /** + * Ensures that the screen and keyboard backlight are on at full brightness. + */ + const WAKE_LOCK_FULL: number; + + /** + * Ensures that the screen is on (but may be dimmed); the keyboard backlight will be allowed to go off. + */ + const WAKE_LOCK_SCREEN_DIM: number; + + /** + * Ensures that the screen is on at full brightness; the keyboard backlight will be allowed to go off. + */ + const WAKE_LOCK_SCREEN_BRIGHT: number; + + /** + * Turn the screen on when the wake lock is acquired. + */ + const WAKE_LOCK_ACQUIRE_CAUSES_WAKEUP: number; + + /** + * When this wake lock is released, poke the user activity timer so the screen stays on for a little longer. + */ + const WAKE_LOCK_ON_AFTER_RELEASE: number; + + /** + * Not used. + */ + const PENDING_INTENT_FOR_ACTIVITY: number; + + /** + * Not used. + */ + const PENDING_INTENT_FOR_BROADCAST: number; + + /** + * Not used. + */ + const PENDING_INTENT_FOR_SERVICE: number; + + /** + * Not used. + */ + const PENDING_INTENT_MAX_VALUE: number; + + /** + * Used with [setResult](Titanium.Android.Activity.setResult) to specify that + * an activity was canceled. + */ + const RESULT_CANCELED: number; + + /** + * Used with [setResult](Titanium.Android.Activity.setResult) to specify a + * user-defined result. + */ + const RESULT_FIRST_USER: number; + + /** + * Used with [setResult](Titanium.Android.Activity.setResult) to specify that + * an activity succeeded. + */ + const RESULT_OK: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify the activity should run in the same orientation as the activity behind it + * in the activity stack. + */ + const SCREEN_ORIENTATION_BEHIND: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify a landscape screen orientation. + */ + const SCREEN_ORIENTATION_LANDSCAPE: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify that the sensor should be ignored and the display should not rotate. + */ + const SCREEN_ORIENTATION_NOSENSOR: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify a portrait screen orientation. + */ + const SCREEN_ORIENTATION_PORTRAIT: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify that orientation should be determined by the orientation sensor. + */ + const SCREEN_ORIENTATION_SENSOR: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify that the system should use its default rules for determining the best + * orientation. + */ + const SCREEN_ORIENTATION_UNSPECIFIED: number; + + /** + * Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to + * specify that the system should use the user's preferred orientation. + */ + const SCREEN_ORIENTATION_USER: number; + + /** + * Always show this item as an action button in the action bar. + */ + const SHOW_AS_ACTION_ALWAYS: number; + + /** + * The action view can collapse to a normal menu item. + */ + const SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW: number; + + /** + * Show this item as an action button if the system decides there is room for it. + */ + const SHOW_AS_ACTION_IF_ROOM: number; + + /** + * Never display this item as an action button in the action bar. + */ + const SHOW_AS_ACTION_NEVER: number; + + /** + * When this item is in the action bar, always show it with a text label. + */ + const SHOW_AS_ACTION_WITH_TEXT: number; + + /** + * Standard Action Bar navigation mode + */ + const NAVIGATION_MODE_STANDARD: number; + + /** + * Action Bar tab navigation mode + */ + const NAVIGATION_MODE_TABS: number; + + /** + * A Service start mode indicating that if the host application is stopped by Android, the service should not be restarted automatically. + */ + const START_NOT_STICKY: number; + + /** + * A Service start mode indicating that if the host application is stopped by Android, the service should be restarted automatically and the original Intent re-sent. + */ + const START_REDELIVER_INTENT: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to + * request that the alarm stream type for notifications be used. + */ + const STREAM_ALARM: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * default stream type for notifications be used. + */ + const STREAM_DEFAULT: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to + * request that the music stream type for notifications be used. + */ + const STREAM_MUSIC: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * notification stream type for notifications be used. + */ + const STREAM_NOTIFICATION: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * ring stream type for notifications be used. + */ + const STREAM_RING: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * system stream type for notifications be used. + */ + const STREAM_SYSTEM: number; + + /** + * Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the + * voice call stream type for notifications be used. + */ + const STREAM_VOICE_CALL: number; + + /** + * The URI scheme used for intent URIs. + */ + const URI_INTENT_SCHEME: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_DEFAULT: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_HIGH: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_LOW: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_MAX: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_MIN: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_NONE: number; + + /** + * Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level. + */ + const IMPORTANCE_UNSPECIFIED: number; + + /** + * Activity of the active context. + */ + const currentActivity: Titanium.Android.Activity; + + /** + * Service in the active context. + */ + const currentService: Titanium.Android.Service; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates an activity chooser intent, used to allow the user to select a target activity + * for an intent. + */ + function createIntentChooser(intent: Titanium.Android.Intent, title: string): Titanium.Android.Intent; + + /** + * Creates a [PendingIntent](Titanium.Android.PendingIntent) to be used inside a + * [Notification](Titanium.Android.Notification). + */ + function createPendingIntent(parameters?: any): Titanium.Android.PendingIntent; + + /** + * Create a so you can start/stop it and listen for events from it. + */ + function createService(intent: Titanium.Android.Intent): Titanium.Android.Service; + + /** + * Create an `Intent` to be used to start a service. + */ + function createServiceIntent(options: ServiceIntentOptions): Titanium.Android.Intent; + + /** + * Creates a [DrawerLayout](Titanium.UI.Android.DrawerLayout). + */ + function createDrawerLayout(parameters?: any): Titanium.UI.Android.DrawerLayout; + + /** + * Returns `true` if the app has permission access. + */ + function hasPermission(permission: string): boolean; + + /** + * Returns `true` if the app has permission access. + */ + function hasPermission(permission: ReadonlyArray): boolean; + + /** + * Request for permission access. + */ + function requestPermissions(permissions: string, callback?: (param0: RequestPermissionAccessResult) => any): void; + + /** + * Request for permission access. + */ + function requestPermissions(permissions: ReadonlyArray, callback?: (param0: RequestPermissionAccessResult) => any): void; + + /** + * Check on state of Service. + */ + function isServiceRunning(intent: Titanium.Android.Intent): boolean; + + /** + * Registers broadcast receiver for the given actions + */ + function registerBroadcastReceiver(broadcastReceiver: Titanium.Android.BroadcastReceiver, actions: ReadonlyArray): void; + + /** + * Unregisters a broadcast receiver + */ + function unregisterBroadcastReceiver(broadcastReceiver: Titanium.Android.BroadcastReceiver): void; + + /** + * Starts a simple service. + */ + function startService(intent: Titanium.Android.Intent): void; + + /** + * Stop a simple service that was started with `startService`. + */ + function stopService(intent: Titanium.Android.Intent): void; + + /** + * Create an `Intent` to be used in a broadcast. + */ + function createBroadcastIntent(parameters?: any): Titanium.Android.Intent; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Creates and returns an instance of . + */ + function createBigPictureStyle(parameters?: any): Titanium.Android.BigPictureStyle; + + /** + * Creates and returns an instance of . + */ + function createBigTextStyle(parameters?: any): Titanium.Android.BigTextStyle; + + /** + * Creates and returns an instance of . + */ + function createBroadcastReceiver(parameters?: any): Titanium.Android.BroadcastReceiver; + + /** + * Creates and returns an instance of . + */ + function createIntent(parameters?: any): Titanium.Android.Intent; + + /** + * Creates and returns an instance of . + */ + function createNotification(parameters?: any): Titanium.Android.Notification; + + /** + * Creates and returns an instance of . + */ + function createNotificationChannel(parameters?: any): Titanium.Android.NotificationChannel; + + /** + * Creates and returns an instance of . + */ + function createQuickSettingsService(parameters?: any): Titanium.Android.QuickSettingsService; + + /** + * Creates and returns an instance of . + */ + function createRemoteViews(parameters?: any): Titanium.Android.RemoteViews; + + /** + * An action bar is a window feature that identifies the application and user location, + * and provides user actions and navigation modes. + */ + interface ActionBar extends Titanium.Proxy { + /** + * The background image for the action bar, specified as a local file path or URL. + */ + backgroundImage: string; + + /** + * Displays an "up" affordance on the "home" area of the action bar. + */ + displayHomeAsUp: boolean; + + /** + * Enable or disable the "home" button in the corner of the action bar. + */ + homeButtonEnabled: boolean; + + /** + * Sets the application icon displayed in the "home" area of the action bar, specified as a local file path or URL. + */ + icon: string; + + /** + * Sets the application logo displayed in the "home" area of the action bar, specified as a local file path or URL. + */ + logo: string; + + /** + * Controls the navigation mode. + */ + navigationMode: number; + + /** + * Callback function called when the home icon is clicked. + */ + onHomeIconItemSelected: () => any; + + /** + * Sets the subtitle of the action bar. + */ + subtitle: string; + + /** + * Sets the title of the action bar. + */ + title: string; + + /** + * Sets a view to be used for a custom navigation mode. + */ + customView: Titanium.UI.View; + + /** + * Hides the action bar if it is currently showing. + */ + hide(): void; + + /** + * Shows or hides the action bar home icon + */ + setDisplayShowHomeEnabled(show: boolean): void; + + /** + * Shows or hides the action bar title/subtitle + */ + setDisplayShowTitleEnabled(show: boolean): void; + + /** + * Shows the action bar if it is currently hidden. + */ + show(): void; + + /** + * Sets the value of the property. + */ + setBackgroundImage(backgroundImage: string): void; + + /** + * Sets the value of the property. + */ + setDisplayHomeAsUp(displayHomeAsUp: boolean): void; + + /** + * Sets the value of the property. + */ + setHomeButtonEnabled(homeButtonEnabled: boolean): void; + + /** + * Sets the value of the property. + */ + setIcon(icon: string): void; + + /** + * Sets the value of the property. + */ + setLogo(logo: string): void; + + /** + * Gets the value of the property. + */ + getNavigationMode(): number; + + /** + * Sets the value of the property. + */ + setNavigationMode(navigationMode: number): void; + + /** + * Sets the value of the property. + */ + setOnHomeIconItemSelected(onHomeIconItemSelected: () => any): void; + + /** + * Gets the value of the property. + */ + getSubtitle(): string; + + /** + * Sets the value of the property. + */ + setSubtitle(subtitle: string): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getCustomView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setCustomView(customView: any): void; + } - export enum FileStream { + + /** + * The Titanium binding of an Android Activity. + */ + interface Activity extends Titanium.Proxy { + /** + * The action bar for this activity. + */ + readonly actionBar: Titanium.Android.ActionBar; + + /** + * The `Intent` that was used to start this Activity. + */ + readonly intent: Titanium.Android.Intent; + + /** + * Callback function called when the Android activity is created. + */ + onCreate: (param0: any) => any; + + /** + * Callback function called to initially create an Android options menu + * for this Activity when the user presses the **Menu** button. + */ + onCreateOptionsMenu: (param0: any) => any; + + /** + * Callback function called when the Android activity is destroyed. + */ + onDestroy: (param0: any) => any; + + /** + * Callback function called when the Android activity is paused. + */ + onPause: (param0: any) => any; + + /** + * Callback function called to prepare an options menu for display when the user presses + * the **Menu** button. + */ + onPrepareOptionsMenu: (param0: any) => any; + + /** + * Callback function called when the Android activity is restarted. + */ + onRestart: (param0: any) => any; + + /** + * Callback function called when the Android activity is resumed. + */ + onResume: (param0: any) => any; + + /** + * Callback function called when the Android activity is started. + */ + onStart: (param0: any) => any; + + /** + * Callback function called when the Android activity is stopped. + */ + onStop: (param0: any) => any; + + /** + * Specifies a specific orientation for this activity. + */ + requestedOrientation: number; + + /** + * Toolbar instance that serves as ActionBar + */ + supportToolbar: Titanium.UI.Toolbar; + + /** + * Closes this activity. + */ + finish(): void; + + /** + * Gets an Android or Application string using the specified Resource ID and optional format arguments. + */ + getString(resourceId: number, format: any): string; + + /** + * Declares that the option menu has changed and should be recreated. + */ + invalidateOptionsMenu(): void; + + /** + * Sets the requested Activity orientation. + */ + setRequestedOrientation(orientation: number): void; + + /** + * Sets the result of this activity using an `Intent`. + */ + setResult(resultCode: number, intent?: Titanium.Android.Intent): void; + + /** + * Sets a toolbar instance to be used as an ActionBar. + */ + setSupportActionBar(toolbar: Titanium.UI.Toolbar): void; + + /** + * Starts a new activity, using the passed in `Intent` as the description. + */ + startActivity(intent: Titanium.Android.Intent): void; + + /** + * The same as `startActivity`, but also accepts a callback function for handling the result of the started Activity. + */ + startActivityForResult(intent: Titanium.Android.Intent, callback: (param0: ActivityResult) => any): void; + + /** + * Programmatically opens the options menu. + */ + openOptionsMenu(): void; + + /** + * Broadcast the passed in `Intent` to all `BroadcastReceiver`s. + */ + sendBroadcast(intent: Titanium.Android.Intent): void; + + /** + * Broadcast the passed in `Intent` to all `BroadcastReceiver`s with an optional permission. + */ + sendBroadcastWithPermission(intent: Titanium.Android.Intent, receiverPermission?: string): void; + + /** + * Gets the value of the property. + */ + getActionBar(): Titanium.Android.ActionBar; + + /** + * Gets the value of the property. + */ + getIntent(): Titanium.Android.Intent; + + /** + * Gets the value of the property. + */ + getOnCreate(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnCreate(onCreate: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnCreateOptionsMenu(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnCreateOptionsMenu(onCreateOptionsMenu: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnDestroy(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnDestroy(onDestroy: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnPause(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnPause(onPause: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnPrepareOptionsMenu(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnPrepareOptionsMenu(onPrepareOptionsMenu: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnRestart(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnRestart(onRestart: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnResume(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnResume(onResume: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnStart(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnStart(onStart: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnStop(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnStop(onStop: (param0: any) => any): void; + + /** + * Sets the value of the property. + */ + setRequestedOrientation(requestedOrientation: number): void; + + /** + * Gets the value of the property. + */ + getSupportToolbar(): Titanium.UI.Toolbar; + + /** + * Sets the value of the property. + */ + setSupportToolbar(supportToolbar: Titanium.UI.Toolbar): void; + + } + + /** + * Helper object for generating large-format notifications that include a large image attachment. + */ + interface BigPictureStyle extends Titanium.Proxy { + /** + * Override the when the big notification is shown. + */ + bigLargeIcon: number | string; + + /** + * Provide the bitmap to be used as the payload for the BigPicture notification. + */ + bigPicture: number | string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Overrides in the big form of the notification. This defaults to the value passed to . + */ + bigContentTitle: string; + + /** + * Number of times to retry decoding the bitmap at bigPicture URL. + */ + decodeRetries: number; + + /** + * Set the first line of text after the detail section in the big form of the notification. + */ + summaryText: string; + + /** + * Gets the value of the property. + */ + getBigLargeIcon(): number | string; + + /** + * Sets the value of the property. + */ + setBigLargeIcon(bigLargeIcon: number): void; + + /** + * Sets the value of the property. + */ + setBigLargeIcon(bigLargeIcon: string): void; + + /** + * Gets the value of the property. + */ + getBigPicture(): number | string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Sets the value of the property. + */ + setBigPicture(bigPicture: number): void; + + /** + * Sets the value of the property. + */ + setBigPicture(bigPicture: string): void; + + /** + * Sets the value of the property. + */ + setBigPicture(bigPicture: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setBigPicture(bigPicture: Titanium.Filesystem.File): void; + + /** + * Gets the value of the property. + */ + getBigContentTitle(): string; + + /** + * Sets the value of the property. + */ + setBigContentTitle(bigContentTitle: string): void; + + /** + * Gets the value of the property. + */ + getDecodeRetries(): number; + + /** + * Sets the value of the property. + */ + setDecodeRetries(decodeRetries: number): void; + + /** + * Gets the value of the property. + */ + getSummaryText(): string; + + /** + * Sets the value of the property. + */ + setSummaryText(summaryText: string): void; + + } + + /** + * Helper object for generating large-format notifications that include a lot of text. + */ + interface BigTextStyle extends Titanium.Proxy { + /** + * Sets the longer text to be displayed in the big form of the notification in place of the content text. + */ + bigText: string; + + /** + * Overrides in the big form of the notification. This defaults to the value passed to . + */ + bigContentTitle: string; + + /** + * Set the first line of text after the detail section in the big form of the notification. + */ + summaryText: string; + + /** + * Gets the value of the property. + */ + getBigText(): string; + + /** + * Sets the value of the property. + */ + setBigText(bigText: string): void; + + /** + * Gets the value of the property. + */ + getBigContentTitle(): string; + + /** + * Sets the value of the property. + */ + setBigContentTitle(bigContentTitle: string): void; + + /** + * Gets the value of the property. + */ + getSummaryText(): string; + + /** + * Sets the value of the property. + */ + setSummaryText(summaryText: string): void; + + } + + /** + * Monitor and handle Android system broadcasts. + */ + interface BroadcastReceiver extends Titanium.Proxy { + /** + * The function called when a broadcast is received. + */ + onReceived: (param0: any) => any; + + /** + * URL of the JavaScript file to handle the broadcast. + */ + url: string; + + /** + * Gets the value of the property. + */ + getOnReceived(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnReceived(onReceived: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * Message objects passed between Android application components. + */ + interface Intent extends Titanium.Proxy { + /** + * The action associated with this intent. + */ + action: string; + + /** + * The Java class name of the activity associated with this intent + * ([packageName](Titanium.Android.Intent.packageName) must also be set). + */ + className: string; + + /** + * The Intent's Data URI. + */ + readonly data: string; + + /** + * Intent flags. + */ + flags: number; + + /** + * The fully-qualified Java package name of the activity. + */ + packageName: string; + + /** + * The MIME type for this Intent. + */ + readonly type: string; + + /** + * The URL to a Titanium JavaScript Activity. + */ + url: string; + + /** + * Adds a category to this Intent. + */ + addCategory(name: string): void; + + /** + * Adds to the existing flags on the `Intent`. + */ + addFlags(flags: number): void; + + /** + * Get a property from this `Intent`. + */ + getBlobExtra(name: string): Titanium.Blob; + + /** + * Get a boolean property from this Intent. + */ + getBooleanExtra(name: string): boolean; + + /** + * Get the Data URI from this `Intent`. + */ + getData(): string; + + /** + * Get a double property from this `Intent`. + */ + getDoubleExtra(name: string): number; + + /** + * Get an integer property from this `Intent`. + */ + getIntExtra(name: string): number; + + /** + * Get a long property from this `Intent`. + */ + getLongExtra(name: string): number; + + /** + * Get a string property from this `Intent`. + */ + getStringExtra(name: string): string; + + /** + * Returns `true` if this `Intent` has the specified property. + */ + hasExtra(name: string): boolean; + + /** + * Puts an extra property on this `Intent`. + */ + putExtra(name: string, value: any): void; + + /** + * Put a URI property on this `Intent` (useful for ). + */ + putExtraUri(name: string, value: any): void; + + /** + * Gets the value of the property. + */ + getAction(): string; + + /** + * Sets the value of the property. + */ + setAction(action: string): void; + + /** + * Gets the value of the property. + */ + getClassName(): string; + + /** + * Sets the value of the property. + */ + setClassName(className: string): void; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Gets the value of the property. + */ + getFlags(): number; + + /** + * Sets the value of the property. + */ + setFlags(flags: number): void; + + /** + * Gets the value of the property. + */ + getPackageName(): string; + + /** + * Sets the value of the property. + */ + setPackageName(packageName: string): void; + + /** + * Gets the value of the property. + */ + getType(): string; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * The Titanium binding of an Android Options Menu. + */ + interface Menu extends Titanium.Proxy { + /** + * Array of menu items in this menu. + */ + readonly items: Titanium.Android.MenuItem[]; + + /** + * Creates a from the passed creation options. + */ + add(options: any): Titanium.Android.MenuItem; + + /** + * Clears all items from this menu. + */ + clear(): void; + + /** + * Closes the menu, if visible. + */ + close(): void; + + /** + * Locates a [MenuItem](Titanium.Android.MenuItem) in this menu, by item ID or reference. + */ + findItem(item: number): Titanium.Android.MenuItem; + + /** + * Locates a [MenuItem](Titanium.Android.MenuItem) in this menu, by item ID or reference. + */ + findItem(item: Titanium.Android.MenuItem): Titanium.Android.MenuItem; + + /** + * Returns the [MenuItem](Titanium.Android.MenuItem) at a specific index. + */ + getItem(index: number): Titanium.Android.MenuItem; + + /** + * Returns `true` if this menu has visible items. + */ + hasVisibleItems(): boolean; + + /** + * Removes all menu items with the specified + * [groupId](Titanium.Android.MenuItem.groupId). + */ + removeGroup(groupId: number): void; + + /** + * Removes a specific [MenuItem](Titanium.Android.MenuItem) identified by its + * [itemId](Titanium.Android.MenuItem.itemId). + */ + removeItem(itemId: number): void; + + /** + * Enables or disables a group of menu items identified by a + * [groupId](Titanium.Android.MenuItem.groupId). + */ + setGroupEnabled(groupId: number, enabled: boolean): void; + + /** + * Shows or hides a group of menu items identified by a + * [groupId](Titanium.Android.MenuItem.groupId). + */ + setGroupVisible(groupId: number, visible: boolean): void; + + /** + * Number of items in this menu. + */ + size(): number; + + /** + * Gets the value of the property. + */ + getItems(): Titanium.Android.MenuItem[]; + + } + + /** + * The Titanium binding of an Android menu item. + */ + interface MenuItem extends Titanium.Proxy { + /** + * Custom view that replaces the default menu item button. + */ + actionView: Titanium.UI.View; + + /** + * True if this menu item's action view has been expanded. + */ + readonly actionViewExpanded: boolean; + + /** + * Determines if the item can be checked. + */ + checkable: boolean; + + /** + * Determines if the item is checked. + */ + checked: boolean; + + /** + * Determines if the item is enabled. + */ + enabled: boolean; + + /** + * Group ID for this item. + */ + readonly groupId: number; + + /** + * Icon to display for the this menu item. + */ + icon: number | string; + + /** + * Item ID for this item. + */ + readonly itemId: number; + + /** + * Integer used for controlling the category and sort order for menu items. + */ + readonly order: number; + + /** + * A set of flags that controls how this item appears in the action bar. + */ + showAsAction: number; + + /** + * Title of the item. + */ + title: string; + + /** + * Shortened version of the item's title. + */ + titleCondensed: string; + + /** + * Determines whether the menu item is visible. + */ + visible: boolean; + + /** + * Collapse the action view associated with this menu item. + */ + collapseActionView(): void; + + /** + * Expand the action view associated with this menu item. + */ + expandActionView(): void; + + /** + * Returns the [actionViewExpanded](Titanium.Android.MenuItem.actionViewExpanded) state of the menu item. + */ + isActionViewExpanded(): boolean; + + /** + * Returns the [checkable](Titanium.Android.MenuItem.checkable) state of the menu item. + */ + isCheckable(): boolean; + + /** + * Returns the [checked](Titanium.Android.MenuItem.checked) state of the menu item. + */ + isChecked(): boolean; + + /** + * Returns the [enabled](Titanium.Android.MenuItem.enabled) state of the menu item. + */ + isEnabled(): boolean; + + /** + * Returns the [visible](Titanium.Android.MenuItem.visible) state of the menu item. + */ + isVisible(): boolean; + + /** + * Sets the [checkable](Titanium.Android.MenuItem.checkable) state of the menu item. + */ + setCheckable(checkable: boolean): void; + + /** + * Sets the [checked](Titanium.Android.MenuItem.checked) state of the menu item. + */ + setChecked(enabled: boolean): void; + + /** + * Sets the [enabled](Titanium.Android.MenuItem.enabled) state of the menu item. + */ + setEnabled(enabled: boolean): void; + + /** + * Sets the [visible](Titanium.Android.MenuItem.visible) state of the menu item. + */ + setVisible(visible: boolean): void; + + /** + * Gets the value of the property. + */ + getActionView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setActionView(actionView: any): void; + + /** + * Gets the value of the property. + */ + getGroupId(): number; + + /** + * Sets the value of the property. + */ + setIcon(icon: number): void; + + /** + * Sets the value of the property. + */ + setIcon(icon: string): void; + + /** + * Gets the value of the property. + */ + getItemId(): number; + + /** + * Gets the value of the property. + */ + getOrder(): number; + + /** + * Sets the value of the property. + */ + setShowAsAction(showAsAction: number): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleCondensed(): string; + + /** + * Sets the value of the property. + */ + setTitleCondensed(titleCondensed: string): void; + + } + + /** + * UI notifications that can be sent while the application is in the background. + */ + interface Notification extends Titanium.Proxy { + /** + * The audio stream type to use when playing the sound. + */ + audioStreamType: number; + + /** + * Sets the notification's category. + */ + category: string; + + /** + * The `PendingIntent` to execute when the expanded status entry is clicked. + */ + contentIntent: Titanium.Android.PendingIntent; + + /** + * Description text of the notification. + */ + contentText: string; + + /** + * Title of the notification. + */ + contentTitle: string; + + /** + * Custom layout to display in the notification. + */ + contentView: Titanium.Android.RemoteViews; + + /** + * Specifies which values should be taken from the defaults. + */ + defaults: number; + + /** + * The `PendingIntent` to execute when the status entry is deleted by the user with the "Clear All Notifications" button. + */ + deleteIntent: Titanium.Android.PendingIntent; + + /** + * Set of flags for the notification. + */ + flags: number; + + /** + * The group key that the notification will belong to. + */ + groupKey: string; + + /** + * Specifies if this is a group summary notification. + */ + groupSummary: boolean; + + /** + * Notification icon, specified as an Android resource ID, or a local URL to a density-specific image. + */ + icon: number | string; + + /** + * Add a large icon to the notification (and the ticker on some devices) specified as an Android resource ID, or a local URL to a density-specific image. + */ + largeIcon: number | string; + + /** + * Accent color used behind icon. + */ + color: string; + + /** + * The color for the LED to blink. + */ + ledARGB: number; + + /** + * The number of milliseconds for the LED to be off while it's flashing. + */ + ledOffMS: number; + + /** + * The number of milliseconds for the LED to be on while it's flashing. + */ + ledOnMS: number; + + /** + * The number of events that this notification represents. + */ + number: number; + + /** + * Sets the priority of the notification. + */ + priority: number; + + /** + * A URL to the sound to play. + */ + sound: string; + + /** + * Style object that can apply a rich notification style. + */ + style: Titanium.Android.BigTextStyle | Titanium.Android.BigPictureStyle; + + /** + * Text to scroll across the screen when this item is added to the status bar. + */ + tickerText: string; + + /** + * Allows user to conceal private information of the notification on the lockscreen. + */ + visibility: number; + + /** + * Will wake up the device for the given time (in milliseconds) when the notification is shown. + * The application needs to also set the `android.permission.WAKE_LOCK` permission + * in the Android manifest section of the `tiapp.xml` file. + * + * + * + * + * + * + * + */ + wakeLock: wakeLockOptions; + + /** + * The timestamp for the notification (defaults to the current time). + */ + when: Date | number; + + /** + * Sets the latest event info using the built-in notification view for this notification. + */ + setLatestEventInfo(contentTitle: string, contentText: string, contentIntent: Titanium.Android.PendingIntent): void; + + /** + * Set the progress this notification represents. + */ + setProgress(max: number, progress: number, indeterminate: boolean): void; + + /** + * Add an action button to the notification + */ + addAction(icon: number, title: string, intent: Titanium.Android.PendingIntent): void; + + /** + * Add an action button to the notification + */ + addAction(icon: string, title: string, intent: Titanium.Android.PendingIntent): void; + + /** + * Gets the value of the property. + */ + getAudioStreamType(): number; + + /** + * Sets the value of the property. + */ + setAudioStreamType(audioStreamType: number): void; + + /** + * Gets the value of the property. + */ + getCategory(): string; + + /** + * Sets the value of the property. + */ + setCategory(category: string): void; + + /** + * Gets the value of the property. + */ + getContentIntent(): Titanium.Android.PendingIntent; + + /** + * Sets the value of the property. + */ + setContentIntent(contentIntent: Titanium.Android.PendingIntent): void; + + /** + * Gets the value of the property. + */ + getContentText(): string; + + /** + * Sets the value of the property. + */ + setContentText(contentText: string): void; + + /** + * Gets the value of the property. + */ + getContentTitle(): string; + + /** + * Sets the value of the property. + */ + setContentTitle(contentTitle: string): void; + + /** + * Sets the value of the property. + */ + setContentView(contentView: Titanium.Android.RemoteViews): void; + + /** + * Gets the value of the property. + */ + getDefaults(): number; + + /** + * Sets the value of the property. + */ + setDefaults(defaults: number): void; + + /** + * Gets the value of the property. + */ + getDeleteIntent(): Titanium.Android.PendingIntent; + + /** + * Sets the value of the property. + */ + setDeleteIntent(deleteIntent: Titanium.Android.PendingIntent): void; + + /** + * Gets the value of the property. + */ + getFlags(): number; + + /** + * Sets the value of the property. + */ + setFlags(flags: number): void; + + /** + * Gets the value of the property. + */ + getGroupKey(): string; + + /** + * Sets the value of the property. + */ + setGroupKey(groupKey: string): void; + + /** + * Gets the value of the property. + */ + getGroupSummary(): boolean; + + /** + * Sets the value of the property. + */ + setGroupSummary(groupSummary: boolean): void; + + /** + * Gets the value of the property. + */ + getIcon(): number | string; + + /** + * Sets the value of the property. + */ + setIcon(icon: number): void; + + /** + * Sets the value of the property. + */ + setIcon(icon: string): void; + + /** + * Gets the value of the property. + */ + getLargeIcon(): number | string; + + /** + * Sets the value of the property. + */ + setLargeIcon(largeIcon: number): void; + + /** + * Sets the value of the property. + */ + setLargeIcon(largeIcon: string): void; + + /** + * Gets the value of the property. + */ + getColor(): string; + + /** + * Sets the value of the property. + */ + setColor(color: string): void; + + /** + * Gets the value of the property. + */ + getLedARGB(): number; + + /** + * Sets the value of the property. + */ + setLedARGB(ledARGB: number): void; + + /** + * Gets the value of the property. + */ + getLedOffMS(): number; + + /** + * Sets the value of the property. + */ + setLedOffMS(ledOffMS: number): void; + + /** + * Gets the value of the property. + */ + getLedOnMS(): number; + + /** + * Sets the value of the property. + */ + setLedOnMS(ledOnMS: number): void; + + /** + * Gets the value of the property. + */ + getNumber(): number; + + /** + * Sets the value of the property. + */ + setNumber(number: number): void; + + /** + * Gets the value of the property. + */ + getPriority(): number; + + /** + * Sets the value of the property. + */ + setPriority(priority: number): void; + + /** + * Gets the value of the property. + */ + getSound(): string; + + /** + * Sets the value of the property. + */ + setSound(sound: string): void; + + /** + * Gets the value of the property. + */ + getStyle(): Titanium.Android.BigTextStyle | Titanium.Android.BigPictureStyle; + + /** + * Sets the value of the property. + */ + setStyle(style: Titanium.Android.BigTextStyle): void; + + /** + * Sets the value of the property. + */ + setStyle(style: Titanium.Android.BigPictureStyle): void; + + /** + * Gets the value of the property. + */ + getTickerText(): string; + + /** + * Sets the value of the property. + */ + setTickerText(tickerText: string): void; + + /** + * Gets the value of the property. + */ + getVisibility(): number; + + /** + * Sets the value of the property. + */ + setVisibility(visibility: number): void; + + /** + * Gets the value of the property. + */ + getWakeLock(): wakeLockOptions; + + /** + * Sets the value of the property. + */ + setWakeLock(wakeLock: wakeLockOptions): void; + + /** + * Gets the value of the property. + */ + getWhen(): Date | number; + + /** + * Sets the value of the property. + */ + setWhen(when: Date): void; + + /** + * Sets the value of the property. + */ + setWhen(when: number): void; + + } + + /** + * Module for notification channels. + */ + interface NotificationChannel extends Titanium.Proxy { + /** + * Whether or not notifications posted to this channel can interrupt the user. + */ + bypassDnd: boolean; + + /** + * User visible description of this channel. + */ + description: string; + + /** + * Whether notifications posted to this channel should display notification lights + */ + enableLights: boolean; + + /** + * Whether notification posted to this channel should vibrate. + */ + enableVibration: boolean; + + /** + * Group id this channel belongs to. + */ + groupId: string; + + /** + * The audio stream type to use when playing the sound. + */ + importance: number; + + /** + * The channel id specified for the notification channel. + */ + id: string; + + /** + * The notification light color for notifications posted to this channel. + */ + lightColor: number; + + /** + * Whether or not notifications posted to this channel are shown on the lockscreen in full or redacted form. + */ + lockscreenVisibility: number; + + /** + * Whether notifications posted to this channel can appear as application icon badges in a Launcher. + */ + showBadge: boolean; + + /** + * The vibration pattern for notifications posted to this channel. + */ + vibratePattern: number[]; + + /** + * Gets the value of the property. + */ + getBypassDnd(): boolean; + + /** + * Sets the value of the property. + */ + setBypassDnd(bypassDnd: boolean): void; + + /** + * Gets the value of the property. + */ + getDescription(): string; + + /** + * Sets the value of the property. + */ + setDescription(description: string): void; + + /** + * Gets the value of the property. + */ + getEnableLights(): boolean; + + /** + * Sets the value of the property. + */ + setEnableLights(enableLights: boolean): void; + + /** + * Gets the value of the property. + */ + getEnableVibration(): boolean; + + /** + * Sets the value of the property. + */ + setEnableVibration(enableVibration: boolean): void; + + /** + * Gets the value of the property. + */ + getGroupId(): string; + + /** + * Sets the value of the property. + */ + setGroupId(groupId: string): void; + + /** + * Gets the value of the property. + */ + getImportance(): number; + + /** + * Sets the value of the property. + */ + setImportance(importance: number): void; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Sets the value of the property. + */ + setId(id: string): void; + + /** + * Gets the value of the property. + */ + getLightColor(): number; + + /** + * Sets the value of the property. + */ + setLightColor(lightColor: number): void; + + /** + * Gets the value of the property. + */ + getLockscreenVisibility(): number; + + /** + * Sets the value of the property. + */ + setLockscreenVisibility(lockscreenVisibility: number): void; + + /** + * Gets the value of the property. + */ + getShowBadge(): boolean; + + /** + * Sets the value of the property. + */ + setShowBadge(showBadge: boolean): void; + + /** + * Gets the value of the property. + */ + getVibratePattern(): number[]; + + /** + * Sets the value of the property. + */ + setVibratePattern(vibratePattern: ReadonlyArray): void; + + } + + /** + * The Titanium binding of an Android `PendingIntent`. + */ + interface PendingIntent extends Titanium.Proxy { + /** + * Flags used for creating the Pending Intent. + */ + flags: number; + + /** + * The intent data to pass to the [Activity](Titanium.Android.Activity) launched by this `PendingIntent`. + */ + intent: Titanium.Android.Intent; + + /** + * If this property is true, flag will be + * appended to `flags` automatically. Default value is true. + */ + updateCurrentIntent: boolean; + + /** + * Gets the value of the property. + */ + getFlags(): number; + + /** + * Sets the value of the property. + */ + setFlags(flags: number): void; + + /** + * Gets the value of the property. + */ + getIntent(): Titanium.Android.Intent; + + /** + * Sets the value of the property. + */ + setIntent(intent: Titanium.Android.Intent): void; + + /** + * Gets the value of the property. + */ + getUpdateCurrentIntent(): boolean; + + /** + * Sets the value of the property. + */ + setUpdateCurrentIntent(updateCurrentIntent: boolean): void; + + } + + /** + * Android service for creating custom quick settings tiles and handling user's interaction with them. + */ + interface QuickSettingsService extends Titanium.Proxy { + /** + * The intent used to start or bind to the Service. + */ + readonly intent: Titanium.Android.Intent; + + /** + * A service can be started more than once -- this number (based on an incrementing integer) + * indicates which "start number" in the sequence the current service instance is. + */ + readonly serviceInstanceId: number; + + /** + * Starts the Service. + */ + start(): void; + + /** + * Stops this running instance of the Service. + */ + stop(): void; + + /** + * Applies current tile's properties. + */ + updateTile(): void; + + /** + * Changes the Tile's icon. + */ + setIcon(icon: string): void; + + /** + * Changes the Tile's icon. + */ + setIcon(icon: Titanium.Blob): void; + + /** + * Changes the Tile's icon. + */ + setIcon(icon: Titanium.Filesystem.File): void; + + /** + * Sets the state of the Tile. + */ + setState(state: number): void; + + /** + * Changes the Tile's label. + */ + setLabel(label: string): void; + + /** + * Returns the Tile's current icon. + */ + getIcon(): string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Returns the Tile's current state. + */ + getState(): number; + + /** + * Returns 'true' if the device is in secure state, 'false' otherwise. + */ + isSecure(): boolean; + + /** + * Opens an Alert dialog. + */ + showDialog(options: showParams): void; + + /** + * Colapses the quick settings menu and starts an activity for the passed Intent. + */ + startActivityAndCollapse(intent: Titanium.Android.Intent): void; + + /** + * Prompts the user to unlock the device and runs the JS code. + */ + unlockAndRun(jsCode: string): void; + + /** + * Gets the value of the property. + */ + getIntent(): Titanium.Android.Intent; + + /** + * Gets the value of the property. + */ + getServiceInstanceId(): number; + + } + + /** + * The Titanium binding of [Android RemoteViews](http://developer.android.com/reference/android/widget/RemoteViews.html). + */ + interface RemoteViews extends Titanium.Proxy { + /** + * Android layout resource ID for the view to display. Required. + */ + layoutId: number; + + /** + * Package name that the resource ID lives in. Optional. + */ + packageName: string; + + /** + * Calls a method taking a single `boolean` argument on a view in the remote view + * hierarchy. See Android's documentation for + * [setBoolean](http://developer.android.com/reference/android/widget/RemoteViews.html#setBoolean(int, java.lang.String, boolean)). + */ + setBoolean(viewId: number, methodName: string, value: boolean): void; + + /** + * Sets the base time, format string, and started flag for a chronometer + * in the remote view hierarchy. + */ + setChronometer(viewId: number, base: Date, format: string, started: boolean): void; + + /** + * Calls a method taking a single `double` argument on a view in the remote view + * hierarchy. + */ + setDouble(viewId: number, methodName: string, value: number): void; + + /** + * Sets the image for an image view in the remote view hierarchy using an Android drawable resource. + */ + setImageViewResource(viewId: number, srcId: number): void; + + /** + * Sets the image for an image view in the remote view hierarchy using a URI. + */ + setImageViewUri(viewId: number, uri: string): void; + + /** + * Calls a method taking a single `int` argument on a view in the remote view hierarchy. + */ + setInt(viewId: number, methodName: string, value: number): void; + + /** + * Launches a when the specified view is clicked. + */ + setOnClickPendingIntent(viewId: number, pendingIntent: Titanium.Android.PendingIntent): void; + + /** + * Sets the progress, max value, and indeterminate flag of a progress bar in the + * remote view hierarchy. + */ + setProgressBar(viewId: number, max: number, progress: number, indeterminate: boolean): void; + + /** + * Calls a method taking a single String argument on a view in the remote view + * hierarchy. + */ + setString(viewId: number, methodName: string, value: string): void; + + /** + * Sets the text color of a view in the remote view hierarchy. + */ + setTextColor(viewId: number, color: number): void; + + /** + * Sets the text of a text view in the remote view hierarchy. + */ + setTextViewText(viewId: number, text: string): void; + + /** + * Calls a method taking one URI on a view in the remote view hierarchy. + */ + setUri(viewId: number, methodName: string, value: string): void; + + /** + * Sets the visibility of a view in the remote view hierarchy. + */ + setViewVisibility(viewId: number, visibility: number): void; + + /** + * Gets the value of the property. + */ + getLayoutId(): number; + + /** + * Sets the value of the property. + */ + setLayoutId(layoutId: number): void; + + /** + * Gets the value of the property. + */ + getPackageName(): string; + + /** + * Sets the value of the property. + */ + setPackageName(packageName: string): void; + + } + + /** + * Android application component that executes in the background. + */ + interface Service extends Titanium.Proxy { + /** + * The intent used to start or bind to the Service. + */ + readonly intent: Titanium.Android.Intent; + + /** + * A service can be started more than once -- this number (based on an incrementing integer) + * indicates which "start number" in the sequence the current service instance is. + */ + readonly serviceInstanceId: number; + + /** + * Starts the Service. + */ + start(): void; + + /** + * Stops this running instance of the Service. + */ + stop(): void; + + /** + * Gets the value of the property. + */ + getIntent(): Titanium.Android.Intent; + + /** + * Gets the value of the property. + */ + getServiceInstanceId(): number; + + } + + + /** + * The Android.Calendar module provides proxies and methods for accessing the native Android + * calendar functionality. + */ + namespace Calendar { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Reminder alert delivery method. + */ + const METHOD_ALERT: number; + + /** + * Reminder default delivery method. + */ + const METHOD_DEFAULT: number; + + /** + * Reminder email delivery method. + */ + const METHOD_EMAIL: number; + + /** + * Reminder SMS delivery method. + */ + const METHOD_SMS: number; + + /** + * Alert dismissed state. + */ + const STATE_DISMISSED: number; + + /** + * Alert fired state. + */ + const STATE_FIRED: number; + + /** + * Alert scheduled status. + */ + const STATE_SCHEDULED: number; + + /** + * Event canceled status. + */ + const STATUS_CANCELED: number; + + /** + * Event confirmed status. + */ + const STATUS_CONFIRMED: number; + + /** + * Event tentative status. + */ + const STATUS_TENTATIVE: number; + + /** + * Event confidential visibility. + */ + const VISIBILITY_CONFIDENTIAL: number; + + /** + * Event default visibility. + */ + const VISIBILITY_DEFAULT: number; + + /** + * Event private visibility. + */ + const VISIBILITY_PRIVATE: number; + + /** + * Event public visibility. + */ + const VISIBILITY_PUBLIC: number; + + /** + * All alerts in selected calendars. + */ + const allAlerts: Titanium.Android.Calendar.Alert[]; + + /** + * All calendars known to the native calendar app. + */ + const allCalendars: Titanium.Android.Calendar.Calendar[]; + + /** + * All calendars selected within the native calendar app, which may be a subset of `allCalendars`. + */ + const selectableCalendars: Titanium.Android.Calendar.Calendar[]; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the calendar with the specified identifier. + */ + function getCalendarById(id: number): Titanium.Android.Calendar.Calendar; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAllAlerts(): Titanium.Android.Calendar.Alert[]; + + /** + * Gets the value of the property. + */ + function getAllCalendars(): Titanium.Android.Calendar.Calendar[]; + + /** + * Gets the value of the property. + */ + function getSelectableCalendars(): Titanium.Android.Calendar.Calendar[]; + + /** + * An object that represents a single alert for an event in an Android calendar. + */ + interface Alert extends Titanium.Proxy { + /** + * Date/time at which this alert alarm is set to trigger. + */ + readonly alarmTime: Date; + + /** + * Start date/time for the corresponding event. + */ + readonly begin: Date; + + /** + * End date/time for the corresponding event. + */ + readonly end: Date; + + /** + * Identifier of the event for which this alert is set. + */ + readonly eventId: number; + + /** + * Identifier of this alert. + */ + readonly id: string; + + /** + * Reminder notice period in minutes, that determines how long prior to the event this alert + * should trigger. + */ + readonly minutes: number; + + /** + * The current state of the alert. + */ + readonly state: number; + + /** + * Gets the value of the property. + */ + getAlarmTime(): Date; + + /** + * Gets the value of the property. + */ + getBegin(): Date; + + /** + * Gets the value of the property. + */ + getEnd(): Date; + + /** + * Gets the value of the property. + */ + getEventId(): number; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getMinutes(): number; + + /** + * Gets the value of the property. + */ + getState(): number; + + } + + /** + * An object that represents a single calendar on Android. + */ + interface Calendar extends Titanium.Proxy { + /** + * Indicates whether this calendar is hidden. + */ + readonly hidden: boolean; + + /** + * Identifier of this calendar. + */ + readonly id: string; + + /** + * Display name of this calendar. + */ + readonly name: string; + + /** + * Indicates whether the calendar is selected. + */ + readonly selected: boolean; + + /** + * Creates an event in this calendar. + */ + createEvent(properties: any): Titanium.Android.Calendar.Event; + + /** + * Gets the event with the specified identifier. + */ + getEventById(id: number): Titanium.Android.Calendar.Event; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: Date, date2: Date): Titanium.Android.Calendar.Event[]; + + /** + * Gets events that occur on a specified date. + */ + getEventsInDate(year: number, month: number, day: number): Titanium.Android.Calendar.Event[]; + + /** + * Gets events that occur during a specified month. + */ + getEventsInMonth(year: number, month: number): Titanium.Android.Calendar.Event[]; + + /** + * Gets all events that occur during a specified year. + */ + getEventsInYear(year: number): Titanium.Android.Calendar.Event[]; + + /** + * Gets the value of the property. + */ + getHidden(): boolean; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getSelected(): boolean; + + } + + /** + * An object that represents a single event in an Android calendar. + */ + interface Event extends Titanium.Proxy { + /** + * Existing alerts for this event. + */ + readonly alerts: Titanium.Android.Calendar.Alert[]; + + /** + * Indicates whether this event is all day. + */ + readonly allDay: boolean; + + /** + * Start date/time of this event. + */ + readonly begin: Date; + + /** + * Description of this event. + */ + readonly description: string; + + /** + * End date/time of this event. + */ + readonly end: Date; + + /** + * Extended properties of this event. + */ + readonly extendedProperties: any; + + /** + * Indicates whether an alarm is scheduled for this event. + */ + readonly hasAlarm: boolean; + + /** + * Indicates whether [extendedProperties](Titanium.Android.Calendar.Event.extendedProperties) + * exists for this event. + */ + readonly hasExtendedProperties: boolean; + + /** + * Identifier of this event. + */ + readonly id: string; + + /** + * Location of this event. + */ + readonly location: string; + + /** + * Existing reminders for this event. + */ + readonly reminders: Titanium.Android.Calendar.Reminder[]; + + /** + * Status of this event. + */ + readonly status: number; + + /** + * Title of this event. + */ + readonly title: string; + + /** + * Visibility of this event. + */ + readonly visibility: number; + + /** + * Creates an alert for this event. + */ + createAlert(data: any): Titanium.Android.Calendar.Alert; + + /** + * Creates a reminder for this event. + */ + createReminder(data: any): Titanium.Android.Calendar.Reminder; + + /** + * Gets the value of the specified extended property. + */ + getExtendedProperty(name: string): string; + + /** + * Sets the value of the specified extended property. + */ + setExtendedProperty(name: string, value: string): void; + + /** + * Gets the value of the property. + */ + getAlerts(): Titanium.Android.Calendar.Alert[]; + + /** + * Gets the value of the property. + */ + getAllDay(): boolean; + + /** + * Gets the value of the property. + */ + getBegin(): Date; + + /** + * Gets the value of the property. + */ + getDescription(): string; + + /** + * Gets the value of the property. + */ + getEnd(): Date; + + /** + * Gets the value of the property. + */ + getExtendedProperties(): any; + + /** + * Gets the value of the property. + */ + getHasAlarm(): boolean; + + /** + * Gets the value of the property. + */ + getHasExtendedProperties(): boolean; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getLocation(): string; + + /** + * Gets the value of the property. + */ + getReminders(): Titanium.Android.Calendar.Reminder[]; + + /** + * Gets the value of the property. + */ + getStatus(): number; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Gets the value of the property. + */ + getVisibility(): number; + + } + + /** + * An object that represents a single reminder for an event in an Android calendar. + */ + interface Reminder extends Titanium.Proxy { + /** + * Identifier of this reminder. + */ + readonly id: string; + + /** + * Method by which this reminder will be delivered. + */ + readonly method: number; + + /** + * Reminder notice period in minutes, that determines how long prior to the event this reminder + * should trigger. + */ + readonly minutes: number; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getMethod(): number; + + /** + * Gets the value of the property. + */ + getMinutes(): number; + + } + + } + + /** + * Module for managing notifications. + */ + namespace NotificationManager { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Use instead. + */ + const DEFAULT_ALL: number; + + /** + * Use instead. + */ + const DEFAULT_LIGHTS: number; + + /** + * Use instead. + */ + const DEFAULT_SOUND: number; + + /** + * Use instead. + */ + const DEFAULT_VIBRATE: number; + + /** + * Use instead. + */ + const FLAG_AUTO_CANCEL: number; + + /** + * Use instead. + */ + const FLAG_INSISTENT: number; + + /** + * Use instead. + */ + const FLAG_NO_CLEAR: number; + + /** + * Use instead. + */ + const FLAG_ONGOING_EVENT: number; + + /** + * Use instead. + */ + const FLAG_ONLY_ALERT_ONCE: number; + + /** + * Use instead. + */ + const FLAG_SHOW_LIGHTS: number; + + /** + * Use instead. + */ + const STREAM_DEFAULT: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Cancels a previously displayed notification. + */ + function cancel(id: number): void; + + /** + * Cancels all previously displayed notifications. + */ + function cancelAll(): void; + + /** + * Adds a persistent notification to the status bar. + */ + function notify(id: number, notification: Titanium.Android.Notification): void; + + /** + * Create a notification channel. + */ + function createNotificationChannel(parameters: any): Titanium.Android.NotificationChannel; + + /** + * Returns whether showing notifications is enabled for the application. + */ + function areNotificationsEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * The Titanium binding of the Android system-wide resources class. + */ + namespace R { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Animation resources. See + * [R.anim](http://developer.android.com/reference/android/R.anim.html) + * in the Android Developer Reference. + */ + const anim: any; + + /** + * Array resources. See [R.array](http://developer.android.com/reference/android/R.array.html) + * in the Android Developer Reference. + */ + const array: any; + + /** + * Attribute resources. See + * [R.attr](http://developer.android.com/reference/android/R.attr.html) + * in the Android Developer Reference. + */ + const attr: any; + + /** + * Color resources. See + * [R.color](http://developer.android.com/reference/android/R.color.html) + * in the Android Developer Reference. + */ + const color: any; + + /** + * Dimension resources. See + * [http://developer.android.com/reference/android/R.dimen.html](http://developer.android.com/reference/android/R.dimen.html) + * in the Android Developer Reference. + */ + const dimen: any; + + /** + * Drawable resources. See + * [R.drawable](http://developer.android.com/reference/android/R.drawable.html) + * in the Android Developer Reference. + * Accessing drawables using Ti.Android.R.drawable is deprecated and not a recommended practice since the system provided + * drawables can be removed across Android versions. Prefer to copy the images to application res folder. + */ + const drawable: any; + + /** + * ID resources. See + * [R.id](http://developer.android.com/reference/android/R.id.html) + * in the Android Developer Reference. + */ + const id: any; + + /** + * Integer resources. See + * [R.integer](http://developer.android.com/reference/android/R.integer.html) + * in the Android Developer Reference. + */ + const integer: any; + + /** + * Layout resources. See + * [R.layout](http://developer.android.com/reference/android/R.layout.html) + * in the Android Developer Reference. + */ + const layout: any; + + /** + * String resources. See + * [R.string](http://developer.android.com/reference/android/R.string.html) + * in the Android Developer Reference. + */ + const string: any; + + /** + * Style resources. See + * [R.style](http://developer.android.com/reference/android/R.style.html) + * in the Android Developer Reference. + */ + const style: any; + + /** + * Styleable reosurces. See + * [R.styleable](http://developer.android.com/reference/android/R.styleable.html) + * in the Android Developer Reference. + */ + const styleable: any; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; } } - export module Network { - export var INADDR_ANY : string; - export var NETWORK_LAN : number; - export var NETWORK_MOBILE : number; - export var NETWORK_NONE : number; - export var NETWORK_UNKNOWN : number; - export var NETWORK_WIFI : number; - export var NOTIFICATION_TYPE_ALERT : number; - export var NOTIFICATION_TYPE_BADGE : number; - export var NOTIFICATION_TYPE_NEWSSTAND : number; - export var NOTIFICATION_TYPE_SOUND : number; - export var PROGRESS_UNKNOWN : number; - export var READ_MODE : number; - export var READ_WRITE_MODE : number; - export var SOCKET_CLOSED : number; - export var SOCKET_CONNECTED : number; - export var SOCKET_ERROR : number; - export var SOCKET_INITIALIZED : number; - export var SOCKET_LISTENING : number; - export var TLS_VERSION_1_0 : number; - export var TLS_VERSION_1_1 : number; - export var TLS_VERSION_1_2 : number; - export var WRITE_MODE : number; - export var allHTTPCookies : Array; - export var apiName : string; - export var bubbleParent : boolean; - export var httpURLFormatter : (...args : any[]) => any; - export var networkType : number; - export var networkTypeName : string; - export var online : boolean; - export var remoteDeviceUUID : string; - export var remoteNotificationTypes : Array; - export var remoteNotificationsEnabled : boolean; - export function addConnectivityListener (callback: (...args : any[]) => any) : void; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function addHTTPCookie (cookie: Ti.Network.Cookie) : void; - export function addSystemCookie (cookie: Ti.Network.Cookie) : void; - export function applyProperties (props: Dictionary) : void; - export function createBonjourBrowser (serviceType: string, domain: string, parameters?: Dictionary) : Ti.Network.BonjourBrowser; - export function createBonjourService (name: string, type: string, domain: string, parameters?: Dictionary) : Ti.Network.BonjourService; - export function createCookie (parameters?: Dictionary) : Ti.Network.Cookie; - export function createHTTPClient (parameters?: Dictionary) : Ti.Network.HTTPClient; - export function createTCPSocket (hostName: string, port: number, mode: number, parameters: Dictionary) : Ti.Network.TCPSocket; - export function decodeURIComponent (value: string) : string; - export function encodeURIComponent (value: string) : string; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAllHTTPCookies () : Array; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function getHTTPCookies (domain: string, path: string, name: string) : Array; - export function getHTTPCookiesForDomain (domain: string) : Array; - export function getHttpURLFormatter () : (...args : any[]) => any; - export function getNetworkType () : number; - export function getNetworkTypeName () : string; - export function getOnline () : boolean; - export function getRemoteDeviceUUID () : string; - export function getRemoteNotificationTypes () : Array; - export function getRemoteNotificationsEnabled () : boolean; - export function getSystemCookies (domain: string, path: string, name: string) : Array; - export function registerForPushNotifications (config: PushNotificationConfig) : void; - export function removeAllHTTPCookies () : void; - export function removeAllSystemCookies () : void; - export function removeConnectivityListener (callback: (...args : any[]) => any) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function removeHTTPCookie (domain: string, path: string, name: string) : void; - export function removeHTTPCookiesForDomain (domain: string) : void; - export function removeSystemCookie (domain: string, path: string, name: string) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setHttpURLFormatter (httpURLFormatter: (...args : any[]) => any) : void; - export function unregisterForPushNotifications () : void; - export interface TCPSocket extends Ti.Proxy { - hostName : string; - isValid : boolean; - mode : number; - port : number; - stripTerminator : boolean; - close () : void; - connect () : void; - getHostName () : string; - getIsValid () : boolean; - getMode () : number; - getPort () : number; - getStripTerminator () : boolean; - listen () : void; - setHostName (hostName: string) : void; - setIsValid (isValid: boolean) : void; - setMode (mode: number) : void; - setPort (port: number) : void; - setStripTerminator (stripTerminator: boolean) : void; - write (data: any, sendTo: number) : void; - write (data: string, sendTo: number) : void; - } - export module Socket { - export var CLOSED : number; - export var CONNECTED : number; - export var ERROR : number; - export var INITIALIZED : number; - export var LISTENING : number; - export var apiName : string; - export var bubbleParent : boolean; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function createTCP (params?: Dictionary) : Ti.Network.Socket.TCP; - export function createUDP (params?: Dictionary) : Ti.Network.Socket.UDP; - export function fireEvent (name: string, event: Dictionary) : void; - export function getApiName () : string; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export interface UDP extends Ti.IOStream { - data : (...args : any[]) => any; - error : (...args : any[]) => any; - port : number; - started : (...args : any[]) => any; - getData () : (...args : any[]) => any; - getError () : (...args : any[]) => any; - getPort () : number; - getStarted () : (...args : any[]) => any; - sendBytes (port: number, host: string, data: Array) : void; - sendString (port: number, host: string, data: string) : void; - setData (data: (...args : any[]) => any) : void; - setError (error: (...args : any[]) => any) : void; - setPort (port: number) : void; - setStarted (started: (...args : any[]) => any) : void; - start (port: number) : void; - stop () : void; + + /** + * The top-level App module is mainly used for accessing information about the + * application at runtime, and for sending or listening for system events. + */ + namespace App { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Convenience constant for system event "accessibilityannouncement". + */ + const EVENT_ACCESSIBILITY_ANNOUNCEMENT: string; + + /** + * Convenience constant for system event "accessibilitychanged". + */ + const EVENT_ACCESSIBILITY_CHANGED: string; + + /** + * Indicates whether Accessibility is enabled by the system. + */ + const accessibilityEnabled: boolean; + + /** + * Indicates whether Analytics is enabled, determined by `tiapp.xml`. + */ + const analytics: boolean; + + /** + * Application copyright statement, determined by `tiapp.xml`. + */ + const copyright: string; + + /** + * Build type that reflects how the application was packaged. + * Returns one of the following values: + * * `development` (Simulator) + * * `test` (Device) + * * `production` (App Store / Adhoc) + */ + const deployType: string; + + /** + * Application description, determined by `tiapp.xml`. + */ + const description: string; + + /** + * Application globally-unique ID, determined by `tiapp.xml`. + */ + const guid: string; + + /** + * Shows the application's splash screen on app resume. + */ + let forceSplashAsSnapshot: boolean; + + /** + * Application ID, from `tiapp.xml`. + */ + const id: string; + + /** + * The install ID for this application. + */ + const installId: string; + + /** + * Determines whether the screen is locked when the device is idle. + */ + let idleTimerDisabled: boolean; + + /** + * Application name, determined by `tiapp.xml`. + */ + const name: string; + + /** + * Determines whether proximity detection is enabled. + */ + let proximityDetection: boolean; + + /** + * Indicates the state of the device's proximity sensor, according to the + * event. + */ + const proximityState: boolean; + + /** + * Prevents network activity indicator from being displayed. + */ + let disableNetworkActivityIndicator: boolean; + + /** + * Application publisher, from `tiapp.xml`. + */ + const publisher: string; + + /** + * Unique session identifier for the current continuous run of the application. + */ + const sessionId: string; + + /** + * Application URL, from `tiapp.xml`. + */ + const url: string; + + /** + * Application version, from `tiapp.xml`. + */ + const version: string; + + /** + * Indicates whether or not the soft keyboard is visible. + */ + const keyboardVisible: boolean; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Fire a system-level event such as . + */ + function fireSystemEvent(eventName: string, param?: any): void; + + /** + * Returns the arguments passed to the application on startup. + */ + function getArguments(): launchOptions; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAccessibilityEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getAnalytics(): boolean; + + /** + * Gets the value of the property. + */ + function getCopyright(): string; + + /** + * Gets the value of the property. + */ + function getDeployType(): string; + + /** + * Gets the value of the property. + */ + function getDescription(): string; + + /** + * Gets the value of the property. + */ + function getGuid(): string; + + /** + * Gets the value of the property. + */ + function getForceSplashAsSnapshot(): boolean; + + /** + * Sets the value of the property. + */ + function setForceSplashAsSnapshot(forceSplashAsSnapshot: boolean): void; + + /** + * Gets the value of the property. + */ + function getId(): string; + + /** + * Gets the value of the property. + */ + function getInstallId(): string; + + /** + * Gets the value of the property. + */ + function getIdleTimerDisabled(): boolean; + + /** + * Sets the value of the property. + */ + function setIdleTimerDisabled(idleTimerDisabled: boolean): void; + + /** + * Gets the value of the property. + */ + function getName(): string; + + /** + * Gets the value of the property. + */ + function getProximityDetection(): boolean; + + /** + * Sets the value of the property. + */ + function setProximityDetection(proximityDetection: boolean): void; + + /** + * Gets the value of the property. + */ + function getProximityState(): boolean; + + /** + * Gets the value of the property. + */ + function getDisableNetworkActivityIndicator(): boolean; + + /** + * Sets the value of the property. + */ + function setDisableNetworkActivityIndicator(disableNetworkActivityIndicator: boolean): void; + + /** + * Gets the value of the property. + */ + function getPublisher(): string; + + /** + * Gets the value of the property. + */ + function getSessionId(): string; + + /** + * Gets the value of the property. + */ + function getUrl(): string; + + /** + * Gets the value of the property. + */ + function getVersion(): string; + + /** + * Gets the value of the property. + */ + function getKeyboardVisible(): boolean; + + + /** + * A module used to access Android application resources. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * The `R` namespace for application resources. + */ + const R: Titanium.App.Android.R; + + /** + * The version number of the application. + */ + const appVersionCode: number; + + /** + * The version name of the application. + */ + const appVersionName: string; + + /** + * Return the intent that was used to launch the application. + */ + const launchIntent: Titanium.Android.Intent; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAppVersionCode(): number; + + /** + * Gets the value of the property. + */ + function getAppVersionName(): string; + + /** + * Gets the value of the property. + */ + function getLaunchIntent(): Titanium.Android.Intent; + + /** + * The Titanium binding of the native Android `R` class, giving access to application resources. + */ + interface R extends Titanium.Proxy { } - export interface TCP extends Ti.IOStream { - accepted : (...args : any[]) => any; - connected : (...args : any[]) => any; - error : (...args : any[]) => any; - host : string; - listenQueueSize : number; - port : number; - state : number; - timeout : number; - accept (options: AcceptDict) : void; - connect () : void; - getAccepted () : (...args : any[]) => any; - getConnected () : (...args : any[]) => any; - getError () : (...args : any[]) => any; - getHost () : string; - getListenQueueSize () : number; - getPort () : number; - getState () : number; - getTimeout () : number; - listen () : void; - setAccepted (accepted: (...args : any[]) => any) : void; - setConnected (connected: (...args : any[]) => any) : void; - setError (error: (...args : any[]) => any) : void; - setHost (host: string) : void; - setListenQueueSize (listenQueueSize: number) : void; - setPort (port: number) : void; - setTimeout (timeout: number) : void; + + } + + /** + * The App Properties module is used for storing application-related data in property/value pairs + * that persist beyond application sessions and device power cycles. + */ + namespace Properties { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns the value of a property as a boolean data type. + */ + function getBool(property: string, defaultValue?: boolean): boolean; + + /** + * Returns the value of a property as a double (double-precision, floating point) data type. + */ + function getDouble(property: string, defaultValue?: number): number; + + /** + * Returns the value of a property as an integer data type. + */ + function getInt(property: string, defaultValue?: number): number; + + /** + * Returns the value of a property as an array data type. + */ + function getList(property: string, defaultValue?: ReadonlyArray): any[]; + + /** + * Returns the value of a property as an object. + */ + function getObject(property: string, defaultValue?: any): any; + + /** + * Returns the value of a property as a string data type. + */ + function getString(property: string, defaultValue?: string): string; + + /** + * Indicates whether a property exists. + */ + function hasProperty(property: string): boolean; + + /** + * Returns an array of property names. + */ + function listProperties(): any[]; + + /** + * Removes a property if it exists, or does nothing otherwise. + */ + function removeProperty(property: string): void; + + /** + * Removes all properties that have been set by the user on runtime, or does nothing otherwise. + */ + function removeAllProperties(): void; + + /** + * Sets the value of a property as a boolean data type. The property will be created if it + * does not exist. + */ + function setBool(property: string, value: boolean): void; + + /** + * Sets the value of a property as a double (double-precision, floating point) data type. The + * property will be created if it does not exist. + */ + function setDouble(property: string, value: number): void; + + /** + * Sets the value of a property as an integer data type. The property will be created if it + * does not exist. + */ + function setInt(property: string, value: number): void; + + /** + * Sets the value of a property as an array data type. The property will be created if it + * does not exist. + */ + function setList(property: string, value: ReadonlyArray): void; + + /** + * Sets the value of a property as an object data type. The property will be created if it + * does not exist. + */ + function setObject(property: string, value: any): void; + + /** + * Sets the value of a property as a string data type. The property will be created if it + * does not exist. + */ + function setString(property: string, value: string): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * The top-level App iOS module, available only to iOS devices, that includes the facilities to + * create and manage local notifications and background services. + */ + namespace iOS { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Convenience constant for system event "accessibilitylayoutchanged". + */ + const EVENT_ACCESSIBILITY_LAYOUT_CHANGED: string; + + /** + * Convenience constant for system event "accessibilityscreenchanged". + */ + const EVENT_ACCESSIBILITY_SCREEN_CHANGED: string; + + /** + * Use with [setMinimumBackgroundFetchInterval](Titanium.App.iOS.setMinimumBackgroundFetchInterval) method. + * Specifies the smallest fetch interval supported by the system. + */ + const BACKGROUNDFETCHINTERVAL_MIN: number; + + /** + * Use with [setMinimumBackgroundFetchInterval](Titanium.App.iOS.setMinimumBackgroundFetchInterval) method. + * Used to specify a fetch interval large enough to prevent fetch operations from occurring. + */ + const BACKGROUNDFETCHINTERVAL_NEVER: number; + + /** + * The application may not present any UI upon a notification being received. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_NONE: number; + + /** + * The application may badge its icon upon a notification being received. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_BADGE: number; + + /** + * The application may play a sound upon a notification being received. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_SOUND: number; + + /** + * The application may display an alert upon a notification being received. + * Use with the [types](UserNotificationSettings.types) property. + */ + const USER_NOTIFICATION_TYPE_ALERT: number; + + /** + * The action will execute in background. Use with the + * [activationMode](Titanium.App.iOS.UserNotificationAction.activationMode) property. + */ + const USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND: number; + + /** + * The action will launch the application and execute in the foreground. + * Use with the [activationMode](Titanium.App.iOS.UserNotificationAction.activationMode) property. + */ + const USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND: number; + + /** + * Default action behavior with no additional action support. + */ + const USER_NOTIFICATION_BEHAVIOR_DEFAULT: number; + + /** + * Provides a textfield with the notification for the user to enter a text response. + */ + const USER_NOTIFICATION_BEHAVIOR_TEXTINPUT: number; + + /** + * Uniform type identifier for all text types. + */ + const UTTYPE_TEXT: string; + + /** + * Uniform type identifier for a plain text type, equivalent to MIME type text/plain. + */ + const UTTYPE_PLAIN_TEXT: string; + + /** + * Uniform type identifier for Unicode-8 plain text type. + */ + const UTTYPE_UTF8_PLAIN_TEXT: string; + + /** + * Uniform type identifier for Unicode-16 with byte-order mark (BOM), or if BOM is not present, + * an external representation byte order (big-endian). + */ + const UTTYPE_UTF16_EXTERNAL_PLAIN_TEXT: string; + + /** + * Uniform type identifier for Unicode-16, native byte order, with an optional byte-order mark (BOM). + */ + const UTTYPE_UTF16_PLAIN_TEXT: string; + + /** + * Uniform type identifier for Rich Text. + */ + const UTTYPE_RTF: string; + + /** + * Uniform type identifier for HTML. + */ + const UTTYPE_HTML: string; + + /** + * Uniform type identifier for XML. + */ + const UTTYPE_XML: string; + + /** + * Uniform type identifier for PDF data. + */ + const UTTYPE_PDF: string; + + /** + * Uniform type identifier for Rich Text Format Directory, that is, Rich Text with content embedding, on-disk format. + */ + const UTTYPE_RTFD: string; + + /** + * Uniform type identifier for Rich Text with content embedding, pasteboard format. + */ + const UTTYPE_FLAT_RTFD: string; + + /** + * Uniform type identifier for MLTE (Textension) format for mixed text and multimedia data. + */ + const UTTYPE_TXN_TEXT_AND_MULTIMEDIA_DATA: string; + + /** + * Uniform type identifier for WebKit webarchive format. + */ + const UTTYPE_WEB_ARCHIVE: string; + + /** + * Uniform type identifier for all image types. + */ + const UTTYPE_IMAGE: string; + + /** + * Uniform type identifier for JPEG images. + */ + const UTTYPE_JPEG: string; + + /** + * Uniform type identifier for JPEG 2000 images. + */ + const UTTYPE_JPEG2000: string; + + /** + * Uniform type identifier for TIFF images. + */ + const UTTYPE_TIFF: string; + + /** + * Uniform type identifier for PICT images. + */ + const UTTYPE_PICT: string; + + /** + * Uniform type identifier for GIF images. + */ + const UTTYPE_GIF: string; + + /** + * Uniform type identifier for PNG images. + */ + const UTTYPE_PNG: string; + + /** + * Uniform type identifier for QuickTime images. + */ + const UTTYPE_QUICKTIME_IMAGE: string; + + /** + * Uniform type identifier for Mac OS icon images. + */ + const UTTYPE_APPLE_ICNS: string; + + /** + * Uniform type identifier for Windows bitmap images. + */ + const UTTYPE_BMP: string; + + /** + * Uniform type identifier for Windows icon images. + */ + const UTTYPE_ICO: string; + + /** + * Uniform type identifier for all audiovisual content. + */ + const UTTYPE_MOVIE: string; + + /** + * Uniform type identifier for all video content without audio. + */ + const UTTYPE_VIDEO: string; + + /** + * Uniform type identifier for all audio content. + */ + const UTTYPE_AUDIO: string; + + /** + * Uniform type identifier for QuickTime movies. + */ + const UTTYPE_QUICKTIME_MOVIE: string; + + /** + * Uniform type identifier for MPEG-1 and MPEG-2 content. + */ + const UTTYPE_MPEG: string; + + /** + * Uniform type identifier for MPEG-4 content. + */ + const UTTYPE_MPEG4: string; + + /** + * Uniform type identifier for MP3 audio. + */ + const UTTYPE_MP3: string; + + /** + * Uniform type identifier for MPEG-4 audio. + */ + const UTTYPE_MPEG4_AUDIO: string; + + /** + * Uniform type identifier for protected MPEG-4 audio (iTunes music store format). + */ + const UTTYPE_APPLE_PROTECTED_MPEG4_AUDIO: string; + + /** + * Notification types and user notification categories the application is registered to use + * (available on iOS 8 and later). + */ + const currentUserNotificationSettings: UserNotificationSettings; + + /** + * Provides an Array of the NSUserActivityTypes keys defined within your Titanium project. + * (available on iOS 8 and later). + */ + const supportedUserActivityTypes: string[]; + + /** + * Returns a URL to open the app's settings. + */ + const applicationOpenSettingsURL: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of Titanium.App.iOS.UserDefaults. + */ + function createUserDefaults(parameters: any): Titanium.App.iOS.UserDefaults; + + /** + * Cancels all scheduled local notifications. + */ + function cancelAllLocalNotifications(): void; + + /** + * Cancels a local notification. + */ + function cancelLocalNotification(id: number): void; + + /** + * Cancels a local notification. + */ + function cancelLocalNotification(id: string): void; + + /** + * Registers a service to run when the application is placed in the background. + */ + function registerBackgroundService(params: any): Titanium.App.iOS.BackgroundService; + + /** + * Registers the application to use the requested notification types and categories + * (for devices running iOS 8 or later). + */ + function registerUserNotificationSettings(params: UserNotificationSettings): void; + + /** + * Schedule a local notification. + */ + function scheduleLocalNotification(params: NotificationParams): Titanium.App.iOS.LocalNotification; + + /** + * Specifies the minimum amount of time that must elapse between background fetch operations. + * Available only on iOS 7 and later. + */ + function setMinimumBackgroundFetchInterval(fetchInterval: number): void; + + /** + * Marks the end of the app execution after initiating the download operation. Available only on iOS 7 and later. + */ + function endBackgroundHandler(handlerID: string): void; + + /** + * Marks the end of an `openParentApplication:reply` execution by a WatchKit extension. + */ + function sendWatchExtensionReply(handlerId: string, userInfo: any): void; + + /** + * Creates and returns an instance of . + */ + function createSearchQuery(parameters?: any): Titanium.App.iOS.SearchQuery; + + /** + * Creates and returns an instance of . + */ + function createSearchableIndex(parameters?: any): Titanium.App.iOS.SearchableIndex; + + /** + * Creates and returns an instance of . + */ + function createSearchableItem(parameters?: any): Titanium.App.iOS.SearchableItem; + + /** + * Creates and returns an instance of . + */ + function createSearchableItemAttributeSet(parameters?: any): Titanium.App.iOS.SearchableItemAttributeSet; + + /** + * Creates and returns an instance of . + */ + function createUserActivity(parameters?: any): Titanium.App.iOS.UserActivity; + + /** + * Creates and returns an instance of . + */ + function createUserNotificationAction(parameters?: any): Titanium.App.iOS.UserNotificationAction; + + /** + * Creates and returns an instance of . + */ + function createUserNotificationCategory(parameters?: any): Titanium.App.iOS.UserNotificationCategory; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getCurrentUserNotificationSettings(): UserNotificationSettings; + + /** + * Gets the value of the property. + */ + function getSupportedUserActivityTypes(): string[]; + + /** + * Gets the value of the property. + */ + function getApplicationOpenSettingsURL(): string; + + /** + * A service that runs when the application is placed in the background. + */ + interface BackgroundService extends Titanium.Proxy { + /** + * A local URL to a JavaScript file containing the code to run in the background. + */ + url: string; + + /** + * Stops the service from running during the current background session to conserve resources. + */ + stop(): void; + + /** + * Unregisters the background service. + */ + unregister(): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + } - } - export interface BonjourService extends Ti.Proxy { - domain : string; - isLocal : boolean; - name : string; - socket : any; - type : string; - getDomain () : string; - getIsLocal () : boolean; - getName () : string; - getSocket () : any; - getType () : string; - publish (socket: any) : void; - resolve (timeout: number) : void; - setDomain (domain: string) : void; - setIsLocal (isLocal: boolean) : void; - setName (name: string) : void; - setSocket (socket: any) : void; - setType (type: string) : void; - stop () : void; - } - export interface HTTPClient extends Ti.Proxy { - DONE : number; - HEADERS_RECEIVED : number; - LOADING : number; - OPENED : number; - UNSENT : number; - allResponseHeaders : string; - autoEncodeUrl : boolean; - autoRedirect : boolean; - cache : boolean; - connected : boolean; - connectionType : string; - domain : string; - enableKeepAlive : boolean; - file : string; - location : string; - ondatastream : (...args : any[]) => any; - onerror : (...args : any[]) => any; - onload : (...args : any[]) => any; - onreadystatechange : (...args : any[]) => any; - onsendstream : (...args : any[]) => any; - password : string; - readyState : number; - responseData : Ti.Blob; - responseText : string; - responseXML : Ti.XML.Document; - securityManager : SecurityManagerProtocol; - status : number; - statusText : string; - timeout : number; - tlsVersion : number; - username : string; - validatesSecureCertificate : boolean; - withCredentials : boolean; - abort () : void; - addAuthFactory (scheme: string, factory: any) : void; - addKeyManager (X509KeyManager: any) : void; - addTrustManager (X509TrustManager: any) : void; - clearCookies (host: string) : void; - getAllResponseHeaders () : string; - getAutoEncodeUrl () : boolean; - getAutoRedirect () : boolean; - getCache () : boolean; - getConnected () : boolean; - getConnectionType () : string; - getDomain () : string; - getEnableKeepAlive () : boolean; - getFile () : string; - getLocation () : string; - getOndatastream () : (...args : any[]) => any; - getOnerror () : (...args : any[]) => any; - getOnload () : (...args : any[]) => any; - getOnreadystatechange () : (...args : any[]) => any; - getOnsendstream () : (...args : any[]) => any; - getPassword () : string; - getReadyState () : number; - getResponseData () : Ti.Blob; - getResponseHeader (name: string) : string; - getResponseText () : string; - getResponseXML () : Ti.XML.Document; - getSecurityManager () : SecurityManagerProtocol; - getStatus () : number; - getStatusText () : string; - getTimeout () : number; - getTlsVersion () : number; - getUsername () : string; - getValidatesSecureCertificate () : boolean; - getWithCredentials () : boolean; - open (method: string, url: string, async?: boolean) : void; - send (data?: any) : void; - send (data?: string) : void; - send (data?: Ti.Filesystem.File) : void; - send (data?: Ti.Blob) : void; - setAutoEncodeUrl (autoEncodeUrl: boolean) : void; - setAutoRedirect (autoRedirect: boolean) : void; - setCache (cache: boolean) : void; - setDomain (domain: string) : void; - setEnableKeepAlive (enableKeepAlive: boolean) : void; - setFile (file: string) : void; - setOndatastream (ondatastream: (...args : any[]) => any) : void; - setOnerror (onerror: (...args : any[]) => any) : void; - setOnload (onload: (...args : any[]) => any) : void; - setOnreadystatechange (onreadystatechange: (...args : any[]) => any) : void; - setOnsendstream (onsendstream: (...args : any[]) => any) : void; - setPassword (password: string) : void; - setRequestHeader (name: string, value: string) : void; - setTimeout (timeout: number) : void; - setTlsVersion (tlsVersion: number) : void; - setUsername (username: string) : void; - setValidatesSecureCertificate (validatesSecureCertificate: boolean) : void; - setWithCredentials (withCredentials: boolean) : void; - } - export interface BonjourBrowser extends Ti.Proxy { - domain : string; - isSearching : boolean; - serviceType : string; - getDomain () : string; - getIsSearching () : boolean; - getServiceType () : string; - search () : void; - setDomain (domain: string) : void; - setIsSearching (isSearching: boolean) : void; - setServiceType (serviceType: string) : void; - stopSearch () : void; - } - export interface Cookie extends Ti.Proxy { - comment : string; - domain : string; - expiryDate : string; - httponly : boolean; - name : string; - originalUrl : string; - path : string; - secure : boolean; - value : string; - version : number; - getComment () : string; - getDomain () : string; - getExpiryDate () : string; - getHttponly () : boolean; - getName () : string; - getOriginalUrl () : string; - getPath () : string; - getSecure () : boolean; - getValue () : string; - getVersion () : number; - isValid () : boolean; - setComment (comment: string) : void; - setDomain (domain: string) : void; - setExpiryDate (expiryDate: string) : void; - setHttponly (httponly: boolean) : void; - setOriginalUrl (originalUrl: string) : void; - setPath (path: string) : void; - setSecure (secure: boolean) : void; - setValue (value: string) : void; - setVersion (version: number) : void; + + /** + * A local notification to alert the user of new or pending application information. + */ + interface LocalNotification extends Titanium.Proxy { + /** + * Cancels the pending notification. + */ + cancel(): void; + + } + + /** + * A search query object manages the criteria to apply when searching app content that you have previously + * indexed by using the Core Spotlight APIs. + */ + interface SearchQuery extends Titanium.Proxy { + /** + * A formatted string that defines the matching criteria to apply to indexed items. + */ + queryString: string; + + /** + * An array of strings that represent the attributes of indexed items. + */ + attributes: string[]; + + /** + * Asynchronously queries the index for items that match the query object's specifications. + */ + start(): void; + + /** + * Cancels a query operation. + */ + cancel(): void; + + /** + * A Boolean value that indicates if the query has been cancelled (`true`) or not (`false`). + */ + isCancelled(): boolean; + + } + + /** + * The SearchableIndex module is used to add or remove Ti.App.iOS.SearchableItem objects from the device search index. + */ + interface SearchableIndex extends Titanium.Proxy { + /** + * Indicates whether indexing is supported by the device. + */ + isSupported(): boolean; + + /** + * Adds an array of Titanium.App.iOS.SearchableItem objects to the default search index. + */ + addToDefaultSearchableIndex(Array: ReadonlyArray, callback: (param0: any) => any): void; + + /** + * Removes all search items added by the application. + */ + deleteAllSearchableItems(callback: (param0: any) => any): void; + + /** + * Removes search items based on an array of domain identifiers. + */ + deleteAllSearchableItemByDomainIdenifiers(Array: ReadonlyArray, callback: (param0: any) => any): void; + + /** + * Removes search items based on an array of identifiers. + */ + deleteSearchableItemsByIdentifiers(Array: ReadonlyArray, callback: (param0: any) => any): void; + + } + + /** + * Used to create a unique object containing all of the search information that will appear in the device search index. + */ + interface SearchableItem extends Titanium.Proxy { + /** + * Set of metadata properties to display for the item. + */ + attributeSet: Titanium.App.iOS.SearchableItemAttributeSet; + + /** + * Identifier that represents the "domain" or owner of this item. + */ + domainIdentifier: string; + + /** + * Searchable items have an expiration date or time to live. By default it is set to one month. + */ + expirationDate: string; + + /** + * Unique identifier to your application group. + */ + uniqueIdentifier: string; + + /** + * Gets the value of the property. + */ + getDomainIdentifier(): string; + + /** + * Sets the value of the property. + */ + setDomainIdentifier(domainIdentifier: string): void; + + /** + * Gets the value of the property. + */ + getExpirationDate(): string; + + /** + * Sets the value of the property. + */ + setExpirationDate(expirationDate: string): void; + + /** + * Gets the value of the property. + */ + getUniqueIdentifier(): string; + + /** + * Sets the value of the property. + */ + setUniqueIdentifier(uniqueIdentifier: string): void; + + } + + /** + * The SearchableItemAttributeSet module defines metadata properties for SearchItem and UserActivity objects. + */ + interface SearchableItemAttributeSet extends Titanium.Proxy { + /** + * Content type of the attribute set. + */ + itemContentType: string; + + /** + * A localized string to be displayed in the UI for this item. + */ + displayName: string; + + /** + * An array of localized strings of alternate display names for this item. + */ + alternateNames: string[]; + + /** + * The complete path to the item. + */ + path: string; + + /** + * File URL representing the content to be indexed. + */ + contentURL: string; + + /** + * File URL pointing to a thumbnail image for this item. + */ + thumbnailURL: string; + + /** + * Image data for thumbnail for this item. + */ + thumbnailData: string | Titanium.Blob; + + /** + * For activities this is the unique identifier for the item this activity is related to. + */ + relatedUniqueIdentifier: string; + + /** + * The date that the last metadata attribute was changed. + */ + metadataModificationDate: string; + + /** + * UTI Type pedigree for an item. + */ + contentType: string; + + /** + * Array of strings related to the content tree of the item. + */ + contentTypeTree: string[]; + + /** + * Represents keywords associated with this particular item. Example keywords might be Birthday etc. + */ + keywords: string[]; + + /** + * The title of the particular item. + */ + title: string; + + /** + * Subject of the the item. + */ + subject: string; + + /** + * Theme of the the item. + */ + theme: string; + + /** + * An account of the content of the resource. + */ + contentDescription: string; + + /** + * Used to reference to the resource within a given context. + */ + identifier: string; + + /** + * A class of entity for whom the resource is intended or useful. + */ + audiences: string[]; + + /** + * Size of the document in MB. + */ + fileSize: number; + + /** + * Number of pages in the item. + */ + pageCount: number; + + /** + * Width in points (72 points per inch) of the document page. + */ + pageWidth: number; + + /** + * Height in points (72 points per inch) of the document page. + */ + pageHeight: number; + + /** + * Security (encryption) method used in the file. + */ + securityMethod: string; + + /** + * Application used to create the document content (e.g. "Word","Framemaker", etc.). + */ + creator: string; + + /** + * Software used to convert the original content into a PDF stream. + */ + encodingApplications: string[]; + + /** + * Kind that the item represents. + */ + kind: string; + + /** + * Array of font names used in the item. + */ + fontNames: string[]; + + /** + * The sample rate of the audio data contained in the file. + */ + audioSampleRate: number; + + /** + * The number of channels in the audio data contained in the file. + */ + audioChannelCount: number; + + /** + * The tempo of the music contained in the audio file in Beats Per Minute. + */ + tempo: number; + + /** + * The musical key of the song/composition contained in an audio file. + */ + keySignature: string; + + /** + * The time signature of the musical composition contained in the audio/MIDI file. + */ + timeSignature: string; + + /** + * The name of the application that encoded the data contained in the audio file. + */ + audioEncodingApplication: string; + + /** + * The composer of the song/composition contained in the audio file. + */ + composer: string; + + /** + * The lyricist/text writer for song/composition contained in the audio file. + */ + lyricist: string; + + /** + * The title for a collection of media. + */ + album: string; + + /** + * The artist for the media. + */ + artist: string; + + /** + * The track number of a song/composition when it is part of an album. + */ + audioTrackNumber: number; + + /** + * The recording date of the song/composition. + */ + recordingDate: string; + + /** + * The musical genre of the song/composition contained in the audio file. + */ + musicalGenre: string; + + /** + * Used to indicates whether the MIDI sequence contained in the file is setup for use with a General MIDI device. + */ + generalMIDISequence: number; + + /** + * Metadata attribute that stores the category of instrument. + */ + musicalInstrumentCategory: string; + + /** + * Metadata attribute that stores the name of instrument. + */ + musicalInstrumentName: string; + + /** + * Used to indicate that using the phone number is appropriate. + */ + supportsPhoneCall: number; + + /** + * Used to determine if navigation is supported. + */ + supportsNavigation: number; + + /** + * Title displayed in the search container + */ + containerTitle: string; + + /** + * Display of the search container + */ + containerDisplayName: string; + + /** + * Identifier for the search container + */ + containerIdentifier: string; + + /** + * Order the search container is displayed. + */ + containerOrder: number; + + /** + * The list of editor/editors that have worked on this item. + */ + editors: string[]; + + /** + * The list of people who are visible in an image or movie or written about in a document. + */ + participants: string[]; + + /** + * The list of projects that this item is part of. + */ + projects: string[]; + + /** + * The date that the file was last downloaded / received. + */ + downloadedDate: string; + + /** + * The date that the item was last used. + */ + lastUsedDate: string; + + /** + * The date that the contents of the item were created. + */ + contentCreationDate: string; + + /** + * The date that the contents of the item were last modified. + */ + contentModificationDate: string; + + /** + * The date that the item was moved into the current location. + */ + addedDate: string; + + /** + * Used to indicate where the item was obtained from. + */ + contentSources: string[]; + + /** + * Comment related to a file. + */ + comment: string; + + /** + * Copyright of the content. + */ + copyright: string; + + /** + * Duration in seconds of the content of the item (if appropriate). + */ + duration: number; + + /** + * A list of contacts that are somehow associated with this document beyond what is captured as Author. + */ + contactKeywords: string[]; + + /** + * The codecs used to encode/decode the media. + */ + codecs: string[]; + + /** + * Used to indicate company/Organization that created the document. + */ + organizations: string[]; + + /** + * Media types present in the content. + */ + mediaTypes: string[]; + + /** + * A version specifier for this item. + */ + version: string; + + /** + * Used to indicate the role of the document creator. + */ + role: string; + + /** + * Whether the content is prepared for streaming. Set to `0` for not streamable and `1` for streamable. + */ + streamable: number; + + /** + * The total bit rate (audio and video combined) of the media. + */ + totalBitRate: number; + + /** + * The video bit rate. + */ + videoBitRate: number; + + /** + * The audio bit rate. + */ + audioBitRate: number; + + /** + * The delivery type of the item. Set to `0` for fast start and `1` for RTSP. + */ + deliveryType: number; + + /** + * Used to designate the languages of the intellectual content of the resource. + */ + languages: string[]; + + /** + * Used to provide a link to information about rights held in and over resource. + */ + rights: string[]; + + /** + * Used to designate the entity responsible for making the resource available. + */ + publishers: string[]; + + /** + * Used to designate the entity responsible for making contributions to the content of the resource. + */ + contributors: string[]; + + /** + * Used to designate the extent or scope of the content of the resource. + */ + coverage: string[]; + + /** + * User rating of this item out of 5 stars. + */ + rating: number; + + /** + * A description of the rating, for example, the number of reviewers. + */ + ratingDescription: string; + + /** + * User play count of this item. + */ + playCount: number; + + /** + * Information about the item. + */ + information: string; + + /** + * Director of the item, for example, the movie director. + */ + director: string; + + /** + * Producer of the content. + */ + producer: string; + + /** + * Genre of the item, for example, movie genre. + */ + genre: string; + + /** + * Performers in the movie. + */ + performers: string[]; + + /** + * Original format of the movie. + */ + originalFormat: string; + + /** + * Original source of the movie. + */ + originalSource: string; + + /** + * Whether or not the item is local. Set to `1` if true and `0` otherwise. + */ + local: number; + + /** + * Whether or not the item has explicit content. Set to `1` for explicit or `0` for clean. + */ + contentRating: number; + + /** + * URL of the item. + */ + url: string; + + /** + * The fully formatted address of the item (obtained from MapKit). + */ + fullyFormattedAddress: string; + + /** + * The sub-location (e.g., street number) for the item according to guidelines established by the provider. + */ + subThoroughfare: string; + + /** + * The location (e.g., street name) for the item according to guidelines established by the provider. + */ + thoroughfare: string; + + /** + * The postal code for the item according to guidelines established by the provider. + */ + postalCode: string; + + /** + * Gets the value of the property. + */ + getDisplayName(): string; + + /** + * Sets the value of the property. + */ + setDisplayName(displayName: string): void; + + /** + * Gets the value of the property. + */ + getAlternateNames(): string[]; + + /** + * Sets the value of the property. + */ + setAlternateNames(alternateNames: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getPath(): string; + + /** + * Sets the value of the property. + */ + setPath(path: string): void; + + /** + * Gets the value of the property. + */ + getContentURL(): string; + + /** + * Sets the value of the property. + */ + setContentURL(contentURL: string): void; + + /** + * Gets the value of the property. + */ + getThumbnailURL(): string; + + /** + * Sets the value of the property. + */ + setThumbnailURL(thumbnailURL: string): void; + + /** + * Gets the value of the property. + */ + getThumbnailData(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setThumbnailData(thumbnailData: string): void; + + /** + * Sets the value of the property. + */ + setThumbnailData(thumbnailData: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getRelatedUniqueIdentifier(): string; + + /** + * Sets the value of the property. + */ + setRelatedUniqueIdentifier(relatedUniqueIdentifier: string): void; + + /** + * Gets the value of the property. + */ + getMetadataModificationDate(): string; + + /** + * Sets the value of the property. + */ + setMetadataModificationDate(metadataModificationDate: string): void; + + /** + * Gets the value of the property. + */ + getContentType(): string; + + /** + * Sets the value of the property. + */ + setContentType(contentType: string): void; + + /** + * Gets the value of the property. + */ + getContentTypeTree(): string[]; + + /** + * Sets the value of the property. + */ + setContentTypeTree(contentTypeTree: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getKeywords(): string[]; + + /** + * Sets the value of the property. + */ + setKeywords(keywords: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getSubject(): string; + + /** + * Sets the value of the property. + */ + setSubject(subject: string): void; + + /** + * Gets the value of the property. + */ + getTheme(): string; + + /** + * Sets the value of the property. + */ + setTheme(theme: string): void; + + /** + * Gets the value of the property. + */ + getContentDescription(): string; + + /** + * Sets the value of the property. + */ + setContentDescription(contentDescription: string): void; + + /** + * Gets the value of the property. + */ + getIdentifier(): string; + + /** + * Sets the value of the property. + */ + setIdentifier(identifier: string): void; + + /** + * Gets the value of the property. + */ + getAudiences(): string[]; + + /** + * Sets the value of the property. + */ + setAudiences(audiences: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getFileSize(): number; + + /** + * Sets the value of the property. + */ + setFileSize(fileSize: number): void; + + /** + * Gets the value of the property. + */ + getPageCount(): number; + + /** + * Sets the value of the property. + */ + setPageCount(pageCount: number): void; + + /** + * Gets the value of the property. + */ + getPageWidth(): number; + + /** + * Sets the value of the property. + */ + setPageWidth(pageWidth: number): void; + + /** + * Gets the value of the property. + */ + getPageHeight(): number; + + /** + * Sets the value of the property. + */ + setPageHeight(pageHeight: number): void; + + /** + * Gets the value of the property. + */ + getSecurityMethod(): string; + + /** + * Sets the value of the property. + */ + setSecurityMethod(securityMethod: string): void; + + /** + * Gets the value of the property. + */ + getCreator(): string; + + /** + * Sets the value of the property. + */ + setCreator(creator: string): void; + + /** + * Gets the value of the property. + */ + getEncodingApplications(): string[]; + + /** + * Sets the value of the property. + */ + setEncodingApplications(encodingApplications: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getKind(): string; + + /** + * Sets the value of the property. + */ + setKind(kind: string): void; + + /** + * Gets the value of the property. + */ + getFontNames(): string[]; + + /** + * Sets the value of the property. + */ + setFontNames(fontNames: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getAudioSampleRate(): number; + + /** + * Sets the value of the property. + */ + setAudioSampleRate(audioSampleRate: number): void; + + /** + * Gets the value of the property. + */ + getAudioChannelCount(): number; + + /** + * Sets the value of the property. + */ + setAudioChannelCount(audioChannelCount: number): void; + + /** + * Gets the value of the property. + */ + getTempo(): number; + + /** + * Sets the value of the property. + */ + setTempo(tempo: number): void; + + /** + * Gets the value of the property. + */ + getKeySignature(): string; + + /** + * Sets the value of the property. + */ + setKeySignature(keySignature: string): void; + + /** + * Gets the value of the property. + */ + getTimeSignature(): string; + + /** + * Sets the value of the property. + */ + setTimeSignature(timeSignature: string): void; + + /** + * Gets the value of the property. + */ + getAudioEncodingApplication(): string; + + /** + * Sets the value of the property. + */ + setAudioEncodingApplication(audioEncodingApplication: string): void; + + /** + * Gets the value of the property. + */ + getComposer(): string; + + /** + * Sets the value of the property. + */ + setComposer(composer: string): void; + + /** + * Gets the value of the property. + */ + getLyricist(): string; + + /** + * Sets the value of the property. + */ + setLyricist(lyricist: string): void; + + /** + * Gets the value of the property. + */ + getAlbum(): string; + + /** + * Sets the value of the property. + */ + setAlbum(album: string): void; + + /** + * Gets the value of the property. + */ + getArtist(): string; + + /** + * Sets the value of the property. + */ + setArtist(artist: string): void; + + /** + * Gets the value of the property. + */ + getAudioTrackNumber(): number; + + /** + * Sets the value of the property. + */ + setAudioTrackNumber(audioTrackNumber: number): void; + + /** + * Gets the value of the property. + */ + getRecordingDate(): string; + + /** + * Sets the value of the property. + */ + setRecordingDate(recordingDate: string): void; + + /** + * Gets the value of the property. + */ + getMusicalGenre(): string; + + /** + * Sets the value of the property. + */ + setMusicalGenre(musicalGenre: string): void; + + /** + * Gets the value of the property. + */ + getGeneralMIDISequence(): number; + + /** + * Sets the value of the property. + */ + setGeneralMIDISequence(generalMIDISequence: number): void; + + /** + * Gets the value of the property. + */ + getMusicalInstrumentCategory(): string; + + /** + * Sets the value of the property. + */ + setMusicalInstrumentCategory(musicalInstrumentCategory: string): void; + + /** + * Gets the value of the property. + */ + getMusicalInstrumentName(): string; + + /** + * Sets the value of the property. + */ + setMusicalInstrumentName(musicalInstrumentName: string): void; + + /** + * Gets the value of the property. + */ + getSupportsPhoneCall(): number; + + /** + * Sets the value of the property. + */ + setSupportsPhoneCall(supportsPhoneCall: number): void; + + /** + * Gets the value of the property. + */ + getSupportsNavigation(): number; + + /** + * Sets the value of the property. + */ + setSupportsNavigation(supportsNavigation: number): void; + + /** + * Gets the value of the property. + */ + getContainerTitle(): string; + + /** + * Sets the value of the property. + */ + setContainerTitle(containerTitle: string): void; + + /** + * Gets the value of the property. + */ + getContainerDisplayName(): string; + + /** + * Sets the value of the property. + */ + setContainerDisplayName(containerDisplayName: string): void; + + /** + * Gets the value of the property. + */ + getContainerIdentifier(): string; + + /** + * Sets the value of the property. + */ + setContainerIdentifier(containerIdentifier: string): void; + + /** + * Gets the value of the property. + */ + getContainerOrder(): number; + + /** + * Sets the value of the property. + */ + setContainerOrder(containerOrder: number): void; + + /** + * Gets the value of the property. + */ + getEditors(): string[]; + + /** + * Sets the value of the property. + */ + setEditors(editors: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getParticipants(): string[]; + + /** + * Sets the value of the property. + */ + setParticipants(participants: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getProjects(): string[]; + + /** + * Sets the value of the property. + */ + setProjects(projects: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getDownloadedDate(): string; + + /** + * Sets the value of the property. + */ + setDownloadedDate(downloadedDate: string): void; + + /** + * Gets the value of the property. + */ + getLastUsedDate(): string; + + /** + * Sets the value of the property. + */ + setLastUsedDate(lastUsedDate: string): void; + + /** + * Gets the value of the property. + */ + getContentCreationDate(): string; + + /** + * Sets the value of the property. + */ + setContentCreationDate(contentCreationDate: string): void; + + /** + * Gets the value of the property. + */ + getContentModificationDate(): string; + + /** + * Sets the value of the property. + */ + setContentModificationDate(contentModificationDate: string): void; + + /** + * Gets the value of the property. + */ + getAddedDate(): string; + + /** + * Sets the value of the property. + */ + setAddedDate(addedDate: string): void; + + /** + * Gets the value of the property. + */ + getContentSources(): string[]; + + /** + * Sets the value of the property. + */ + setContentSources(contentSources: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getComment(): string; + + /** + * Sets the value of the property. + */ + setComment(comment: string): void; + + /** + * Gets the value of the property. + */ + getCopyright(): string; + + /** + * Sets the value of the property. + */ + setCopyright(copyright: string): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getContactKeywords(): string[]; + + /** + * Sets the value of the property. + */ + setContactKeywords(contactKeywords: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCodecs(): string[]; + + /** + * Sets the value of the property. + */ + setCodecs(codecs: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOrganizations(): string[]; + + /** + * Sets the value of the property. + */ + setOrganizations(organizations: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getMediaTypes(): string[]; + + /** + * Sets the value of the property. + */ + setMediaTypes(mediaTypes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getVersion(): string; + + /** + * Sets the value of the property. + */ + setVersion(version: string): void; + + /** + * Gets the value of the property. + */ + getRole(): string; + + /** + * Sets the value of the property. + */ + setRole(role: string): void; + + /** + * Gets the value of the property. + */ + getStreamable(): number; + + /** + * Sets the value of the property. + */ + setStreamable(streamable: number): void; + + /** + * Gets the value of the property. + */ + getTotalBitRate(): number; + + /** + * Sets the value of the property. + */ + setTotalBitRate(totalBitRate: number): void; + + /** + * Gets the value of the property. + */ + getVideoBitRate(): number; + + /** + * Sets the value of the property. + */ + setVideoBitRate(videoBitRate: number): void; + + /** + * Gets the value of the property. + */ + getAudioBitRate(): number; + + /** + * Sets the value of the property. + */ + setAudioBitRate(audioBitRate: number): void; + + /** + * Gets the value of the property. + */ + getDeliveryType(): number; + + /** + * Sets the value of the property. + */ + setDeliveryType(deliveryType: number): void; + + /** + * Gets the value of the property. + */ + getLanguages(): string[]; + + /** + * Sets the value of the property. + */ + setLanguages(languages: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getRights(): string[]; + + /** + * Sets the value of the property. + */ + setRights(rights: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getPublishers(): string[]; + + /** + * Sets the value of the property. + */ + setPublishers(publishers: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getContributors(): string[]; + + /** + * Sets the value of the property. + */ + setContributors(contributors: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getCoverage(): string[]; + + /** + * Sets the value of the property. + */ + setCoverage(coverage: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getRating(): number; + + /** + * Sets the value of the property. + */ + setRating(rating: number): void; + + /** + * Gets the value of the property. + */ + getRatingDescription(): string; + + /** + * Sets the value of the property. + */ + setRatingDescription(ratingDescription: string): void; + + /** + * Gets the value of the property. + */ + getPlayCount(): number; + + /** + * Sets the value of the property. + */ + setPlayCount(playCount: number): void; + + /** + * Gets the value of the property. + */ + getInformation(): string; + + /** + * Sets the value of the property. + */ + setInformation(information: string): void; + + /** + * Gets the value of the property. + */ + getDirector(): string; + + /** + * Sets the value of the property. + */ + setDirector(director: string): void; + + /** + * Gets the value of the property. + */ + getProducer(): string; + + /** + * Sets the value of the property. + */ + setProducer(producer: string): void; + + /** + * Gets the value of the property. + */ + getGenre(): string; + + /** + * Sets the value of the property. + */ + setGenre(genre: string): void; + + /** + * Gets the value of the property. + */ + getPerformers(): string[]; + + /** + * Sets the value of the property. + */ + setPerformers(performers: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getOriginalFormat(): string; + + /** + * Sets the value of the property. + */ + setOriginalFormat(originalFormat: string): void; + + /** + * Gets the value of the property. + */ + getOriginalSource(): string; + + /** + * Sets the value of the property. + */ + setOriginalSource(originalSource: string): void; + + /** + * Gets the value of the property. + */ + getLocal(): number; + + /** + * Sets the value of the property. + */ + setLocal(local: number): void; + + /** + * Gets the value of the property. + */ + getContentRating(): number; + + /** + * Sets the value of the property. + */ + setContentRating(contentRating: number): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getFullyFormattedAddress(): string; + + /** + * Sets the value of the property. + */ + setFullyFormattedAddress(fullyFormattedAddress: string): void; + + /** + * Gets the value of the property. + */ + getSubThoroughfare(): string; + + /** + * Sets the value of the property. + */ + setSubThoroughfare(subThoroughfare: string): void; + + /** + * Gets the value of the property. + */ + getThoroughfare(): string; + + /** + * Sets the value of the property. + */ + setThoroughfare(thoroughfare: string): void; + + /** + * Gets the value of the property. + */ + getPostalCode(): string; + + /** + * Sets the value of the property. + */ + setPostalCode(postalCode: string): void; + + } + + /** + * The UserActivity module is used to enable device Handoff and to create User Activities. + */ + interface UserActivity extends Titanium.Proxy { + /** + * Name of the activity type. + */ + activityType: string; + + /** + * Set to `true` if the user activity can be publicly accessed by all iOS users. + */ + eligibleForPublicIndexing: boolean; + + /** + * Set to true if the user activity should be added to the on-device index. + */ + eligibleForSearch: boolean; + + /** + * Set to true if this user activity should be eligible to be handed off to another device + */ + eligibleForHandoff: boolean; + + /** + * Absolute date after which the activity is no longer eligible to be indexed or handed off. + */ + expirationDate: string; + + /** + * An array of string keywords representing words or phrases that might help the user to find the activity in the application history. + */ + keywords: string[]; + + /** + * Set to true everytime you have updated the user activity and need the changes to be saved before handing it off to another device. + */ + needsSave: boolean; + + /** + * An array of String keys from the userInfo property which represent the minimal information about the user activity that should be stored for later restoration. + */ + requiredUserInfoKeys: string[]; + + /** + * Determines if user activities are supported (`true`) or not (`false`) by the device. + */ + supported: boolean; + + /** + * An optional, user-visible title for this activity such as a document name or web page title. + */ + title: string; + + /** + * The userInfo dictionary contains application-specific state needed to continue an activity on another device. + */ + userInfo: any; + + /** + * When no suitable application is installed on a resuming device and the `webpageURL` property is set, + * the user activity will instead be continued in a web browser by loading the specified URL. + */ + webpageURL: string; + + /** + * Adds a Titanium.App.iOS.SearchableItemAttributeSet to the user activity. + */ + addContentAttributeSet(contentAttributeSet: Titanium.App.iOS.SearchableItemAttributeSet): void; + + /** + * Marks the activity as currently in use by the user. + */ + becomeCurrent(): void; + + /** + * Invalidates an activity when it is no longer eligible for continuation. + */ + invalidate(): void; + + /** + * Marks the activity as currently **not** in use and ineligible to be continued. + */ + resignCurrent(): void; + + /** + * Determines if user activities are supported (`true`) or not (`false`) by the device. + */ + isSupported(): boolean; + + /** + * Gets the value of the property. + */ + getActivityType(): string; + + /** + * Sets the value of the property. + */ + setActivityType(activityType: string): void; + + /** + * Gets the value of the property. + */ + getEligibleForPublicIndexing(): boolean; + + /** + * Sets the value of the property. + */ + setEligibleForPublicIndexing(eligibleForPublicIndexing: boolean): void; + + /** + * Gets the value of the property. + */ + getEligibleForSearch(): boolean; + + /** + * Sets the value of the property. + */ + setEligibleForSearch(eligibleForSearch: boolean): void; + + /** + * Gets the value of the property. + */ + getEligibleForHandoff(): boolean; + + /** + * Sets the value of the property. + */ + setEligibleForHandoff(eligibleForHandoff: boolean): void; + + /** + * Gets the value of the property. + */ + getExpirationDate(): string; + + /** + * Sets the value of the property. + */ + setExpirationDate(expirationDate: string): void; + + /** + * Gets the value of the property. + */ + getKeywords(): string[]; + + /** + * Sets the value of the property. + */ + setKeywords(keywords: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getNeedsSave(): boolean; + + /** + * Sets the value of the property. + */ + setNeedsSave(needsSave: boolean): void; + + /** + * Gets the value of the property. + */ + getRequiredUserInfoKeys(): string[]; + + /** + * Sets the value of the property. + */ + setRequiredUserInfoKeys(requiredUserInfoKeys: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getSupported(): boolean; + + /** + * Sets the value of the property. + */ + setSupported(supported: boolean): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getUserInfo(): any; + + /** + * Sets the value of the property. + */ + setUserInfo(userInfo: any): void; + + /** + * Gets the value of the property. + */ + getWebpageURL(): string; + + /** + * Sets the value of the property. + */ + setWebpageURL(webpageURL: string): void; + + } + + /** + * The UserDefaults module is used for storing application-related data in property/value pairs + * that persist beyond application sessions and device power cycles. UserDefaults allows the suiteName + * of the UserDefaults to be specified at creation time. + */ + interface UserDefaults extends Titanium.Proxy { + /** + * Sets the name of the suite to be used to access UserDefaults. + */ + suiteName: string; + + /** + * Returns the value of a property as a boolean data type. + */ + getBool(property: string, defaultValue?: boolean): boolean; + + /** + * Returns the value of a property as a double (double-precision, floating point) data type. + */ + getDouble(property: string, defaultValue?: number): number; + + /** + * Returns the value of a property as an integer data type. + */ + getInt(property: string, defaultValue?: number): number; + + /** + * Returns the value of a property as an array data type. + */ + getList(property: string, defaultValue?: ReadonlyArray): any[]; + + /** + * Returns the value of a property as an object. + */ + getObject(property: string, defaultValue?: any): any; + + /** + * Returns the value of a property as a string data type. + */ + getString(property: string, defaultValue?: string): string; + + /** + * Indicates whether a property exists. + */ + hasProperty(property: string): boolean; + + /** + * Returns an array of property names. + */ + listProperties(): any[]; + + /** + * Removes a property if it exists, or does nothing otherwise. + */ + removeProperty(property: string): void; + + /** + * Removes all properties that have been set by the user on runtime, or does nothing otherwise. + */ + removeAllProperties(): void; + + /** + * Sets the value of a property as a boolean data type. The property will be created if it + * does not exist. + */ + setBool(property: string, value: boolean): void; + + /** + * Sets the value of a property as a double (double-precision, floating point) data type. The + * property will be created if it does not exist. + */ + setDouble(property: string, value: number): void; + + /** + * Sets the value of a property as an integer data type. The property will be created if it + * does not exist. + */ + setInt(property: string, value: number): void; + + /** + * Sets the value of a property as an array data type. The property will be created if it + * does not exist. + */ + setList(property: string, value: ReadonlyArray): void; + + /** + * Sets the value of a property as an object data type. The property will be created if it + * does not exist. + */ + setObject(property: string, value: any): void; + + /** + * Sets the value of a property as a string data type. The property will be created if it + * does not exist. + */ + setString(property: string, value: string): void; + + /** + * Gets the value of the property. + */ + getSuiteName(): string; + + /** + * Sets the value of the property. + */ + setSuiteName(suiteName: string): void; + + } + + /** + * An action the user selects in response to an interactive notification. + */ + interface UserNotificationAction extends Titanium.Proxy { + /** + * Selects how to activate the application. + */ + activationMode: number; + + /** + * Custom behavior the user notification supports. + */ + behavior: number; + + /** + * Set to true if the action requires the device to be unlocked. On the Apple Watch actions never require authentication. + */ + authenticationRequired: boolean; + + /** + * Set to true if the action causes destructive behavior to the user's data or the application. + */ + destructive: boolean; + + /** + * Identifier for this action. Used to identify the action the user pressed. + */ + identifier: string; + + /** + * Title of the button displayed in the notification. + */ + title: string; + + /** + * Gets the value of the property. + */ + getActivationMode(): number; + + /** + * Sets the value of the property. + */ + setActivationMode(activationMode: number): void; + + /** + * Gets the value of the property. + */ + getBehavior(): number; + + /** + * Sets the value of the property. + */ + setBehavior(behavior: number): void; + + } + + /** + * A set of notification actions to associate with a notification. + */ + interface UserNotificationCategory extends Titanium.Proxy { + /** + * Array of notification actions to associate with the group. + */ + actionsForDefaultContext: Titanium.App.iOS.UserNotificationAction[]; + + /** + * Array of notification actions to display for non-dialog-style notification. + */ + actionsForMinimalContext: Titanium.App.iOS.UserNotificationAction[]; + + /** + * Identifier for this category. + */ + identifier: string; + + } + } } - export interface Yahoo { - yql (yql: string, callback: (...args : any[]) => any) : void; + + /** + * The Calendar module provides an API for accessing the native calendar functionality. + */ + namespace Calendar { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Reminder alert delivery method. + */ + const METHOD_ALERT: number; + + /** + * Reminder default delivery method. + */ + const METHOD_DEFAULT: number; + + /** + * Reminder email delivery method. + */ + const METHOD_EMAIL: number; + + /** + * Reminder SMS delivery method. + */ + const METHOD_SMS: number; + + /** + * Alert dismissed state. + */ + const STATE_DISMISSED: number; + + /** + * Alert fired state. + */ + const STATE_FIRED: number; + + /** + * Alert scheduled status. + */ + const STATE_SCHEDULED: number; + + /** + * Event has no status. + */ + const STATUS_NONE: number; + + /** + * Event canceled status. + */ + const STATUS_CANCELLED: number; + + /** + * Event canceled status. + */ + const STATUS_CANCELED: number; + + /** + * Event confirmed status. + */ + const STATUS_CONFIRMED: number; + + /** + * Event tentative status. + */ + const STATUS_TENTATIVE: number; + + /** + * Availability settings are not supported by the event's calendar. + */ + const AVAILABILITY_NOTSUPPORTED: number; + + /** + * Event has a busy availability setting. + */ + const AVAILABILITY_BUSY: number; + + /** + * Event has a free availability setting. + */ + const AVAILABILITY_FREE: number; + + /** + * Event has a tentative availability setting. + */ + const AVAILABILITY_TENTATIVE: number; + + /** + * Event has a tentative availability setting. + */ + const AVAILABILITY_UNAVAILABLE: number; + + /** + * A [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value + * indicating that the application is authorized to use events in the Calendar. + */ + const AUTHORIZATION_AUTHORIZED: number; + + /** + * A [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value + * indicating that the application is not authorized to use events in the Calendar. + */ + const AUTHORIZATION_DENIED: number; + + /** + * A [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value + * indicating that the application is not authorized to use events in the Calendar. + * the user cannot change this application's status. + */ + const AUTHORIZATION_RESTRICTED: number; + + /** + * A [eventsAuthorization](Titanium.Calendar.eventsAuthorization) value + * indicating that the authorization state is unknown. + */ + const AUTHORIZATION_UNKNOWN: number; + + /** + * A [save](Titanium.Calendar.Event.save)/[remove](Titanium.Calendar.Event.remove) event value, + * indicating modifications to this event instance should affect only this instance. + */ + const SPAN_THISEVENT: number; + + /** + * A [save](Titanium.Calendar.Event.save)/[remove](Titanium.Calendar.Event.remove) event value, + * indicating modifications to this event instance should also affect future instances of this event. + */ + const SPAN_FUTUREEVENTS: number; + + /** + * Indicates a daily recurrence rule for a events reccurance frequency. + */ + const RECURRENCEFREQUENCY_DAILY: number; + + /** + * Indicates a weekly recurrence rule for a events reccurance frequency. + */ + const RECURRENCEFREQUENCY_WEEKLY: number; + + /** + * Indicates a monthly recurrence rule for a events reccurance frequency. + */ + const RECURRENCEFREQUENCY_MONTHLY: number; + + /** + * Indicates a yearly recurrence rule for a events reccurance frequency. + */ + const RECURRENCEFREQUENCY_YEARLY: number; + + /** + * Event confidential visibility. + */ + const VISIBILITY_CONFIDENTIAL: number; + + /** + * Event default visibility. + */ + const VISIBILITY_DEFAULT: number; + + /** + * Event private visibility. + */ + const VISIBILITY_PRIVATE: number; + + /** + * Event public visibility. + */ + const VISIBILITY_PUBLIC: number; + + /** + * Attendee status is unknown. + */ + const ATTENDEE_STATUS_UNKNOWN: number; + + /** + * Attendee status is pending. + */ + const ATTENDEE_STATUS_PENDING: number; + + /** + * Attendee status is accepted. + */ + const ATTENDEE_STATUS_ACCEPTED: number; + + /** + * Attendee status is declined. + */ + const ATTENDEE_STATUS_DECLINED: number; + + /** + * Attendee status is tentative. + */ + const ATTENDEE_STATUS_TENTATIVE: number; + + /** + * Attendee status is invited. + */ + const ATTENDEE_STATUS_INVITED: number; + + /** + * There is no Attendee status. + */ + const ATTENDEE_STATUS_NONE: number; + + /** + * Attendee status is delegated. + */ + const ATTENDEE_STATUS_DELEGATED: number; + + /** + * Attendee status is in process. + */ + const ATTENDEE_STATUS_IN_PROCESS: number; + + /** + * Relationship is attendee. + */ + const RELATIONSHIP_ATTENDEE: number; + + /** + * There is no relationship. + */ + const RELATIONSHIP_NONE: number; + + /** + * Attendee is organizer. + */ + const RELATIONSHIP_ORGANIZER: number; + + /** + * Attendee is performer. + */ + const RELATIONSHIP_PERFORMER: number; + + /** + * Attendee is speaker. + */ + const RELATIONSHIP_SPEAKER: number; + + /** + * Relationship is unknown. + */ + const RELATIONSHIP_UNKNOWN: number; + + /** + * Attendee role is unknown. + */ + const ATTENDEE_ROLE_UNKNOWN: number; + + /** + * Attendee role is optional. + */ + const ATTENDEE_ROLE_OPTIONAL: number; + + /** + * Attendee role is required. + */ + const ATTENDEE_ROLE_REQUIRED: number; + + /** + * Attendee role is chair. + */ + const ATTENDEE_ROLE_CHAIR: number; + + /** + * Attendee is not a participant. + */ + const ATTENDEE_ROLE_NON_PARTICIPANT: number; + + /** + * Attendee type is unknown. + */ + const ATTENDEE_TYPE_UNKNOWN: number; + + /** + * Attendee type is person. + */ + const ATTENDEE_TYPE_PERSON: number; + + /** + * Attendee type is room. + */ + const ATTENDEE_TYPE_ROOM: number; + + /** + * Attendee type is resource. + */ + const ATTENDEE_TYPE_RESOURCE: number; + + /** + * There is not attendee type. + */ + const ATTENDEE_TYPE_NONE: number; + + /** + * Attendee type is required. + */ + const ATTENDEE_TYPE_REQUIRED: number; + + /** + * Attendee type is group. + */ + const ATTENDEE_TYPE_GROUP: number; + + /** + * A local calendar source. + */ + const SOURCE_TYPE_LOCAL: number; + + /** + * A microsoft exchange calendar source. + */ + const SOURCE_TYPE_EXCHANGE: number; + + /** + * A calDev calendar source. + */ + const SOURCE_TYPE_CALDAV: number; + + /** + * A mobileMe calendar source. + */ + const SOURCE_TYPE_MOBILEME: number; + + /** + * A subscribed calendar source. + */ + const SOURCE_TYPE_SUBSCRIBED: number; + + /** + * A birthday calendar source. + */ + const SOURCE_TYPE_BIRTHDAYS: number; + + /** + * Returns an authorization constant indicating if the application has access to the events in the EventKit. + */ + const eventsAuthorization: number; + + /** + * Returns an authorization constant indicating if the application has access to the events in the EventKit. + */ + const calendarAuthorization: number; + + /** + * All alerts in selected calendars. + */ + const allAlerts: Titanium.Calendar.Alert[]; + + /** + * All calendars known to the native calendar app. + */ + const allCalendars: Titanium.Calendar.Calendar[]; + + /** + * All calendars known to the native calendar app that can add, edit, and + * delete items in the calendar. + */ + const allEditableCalendars: Titanium.Calendar.Calendar[]; + + /** + * All calendars selected within the native calendar app, which may be a subset of `allCalendars`. + */ + const selectableCalendars: Titanium.Calendar.Calendar[]; + + /** + * Calendar that events are added to by default, as specified by user settings. + */ + const defaultCalendar: Titanium.Calendar.Calendar; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the calendar with the specified identifier. + */ + function getCalendarById(id: string): Titanium.Calendar.Calendar; + + /** + * Returns `true` if the app has calendar access. + */ + function hasCalendarPermissions(): boolean; + + /** + * Requests for calendar access. + */ + function requestCalendarPermissions(callback: (param0: EventsAuthorizationResponse) => any): void; + + /** + * If authorization is unknown, will bring up a dialog requesting permission. + */ + function requestEventsAuthorization(callback: (param0: EventsAuthorizationResponse) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getEventsAuthorization(): number; + + /** + * Gets the value of the property. + */ + function getCalendarAuthorization(): number; + + /** + * Gets the value of the property. + */ + function getAllAlerts(): Titanium.Calendar.Alert[]; + + /** + * Gets the value of the property. + */ + function getAllCalendars(): Titanium.Calendar.Calendar[]; + + /** + * Gets the value of the property. + */ + function getAllEditableCalendars(): Titanium.Calendar.Calendar[]; + + /** + * Gets the value of the property. + */ + function getSelectableCalendars(): Titanium.Calendar.Calendar[]; + + /** + * Gets the value of the property. + */ + function getDefaultCalendar(): Titanium.Calendar.Calendar; + + /** + * An object that represents a single alert for an event in an calendar. + */ + interface Alert extends Titanium.Proxy { + /** + * The absolute date for the alarm. + */ + absoluteDate: Date; + + /** + * The offset from the start of an event, at which the alarm fires. + */ + relativeOffset: number; + + /** + * Date/time at which this alert alarm is set to trigger. + */ + readonly alarmTime: Date; + + /** + * Start date/time for the corresponding event. + */ + readonly begin: Date; + + /** + * End date/time for the corresponding event. + */ + readonly end: Date; + + /** + * Identifier of the event for which this alert is set. + */ + readonly eventId: number; + + /** + * Identifier of this alert. + */ + readonly id: string; + + /** + * Reminder notice period in minutes, that determines how long prior to the event this alert + * should trigger. + */ + readonly minutes: number; + + /** + * The current state of the alert. + */ + readonly state: number; + + /** + * Gets the value of the property. + */ + getAbsoluteDate(): Date; + + /** + * Sets the value of the property. + */ + setAbsoluteDate(absoluteDate: Date): void; + + /** + * Gets the value of the property. + */ + getRelativeOffset(): number; + + /** + * Sets the value of the property. + */ + setRelativeOffset(relativeOffset: number): void; + + /** + * Gets the value of the property. + */ + getAlarmTime(): Date; + + /** + * Gets the value of the property. + */ + getBegin(): Date; + + /** + * Gets the value of the property. + */ + getEnd(): Date; + + /** + * Gets the value of the property. + */ + getEventId(): number; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getMinutes(): number; + + /** + * Gets the value of the property. + */ + getState(): number; + + } + + /** + * An object that represents a single attendee of an event. + */ + interface Attendee extends Titanium.Proxy { + /** + * Indicates whether this attendee is the event organizer. + */ + isOrganizer: boolean; + + /** + * The attendee name. + */ + name: string; + + /** + * The attendee email. + */ + email: string; + + /** + * The role of the attendee. + */ + role: number; + + /** + * The type of the attendee. + */ + type: number; + + /** + * The status of the attendee. + */ + status: number; + + /** + * Gets the value of the property. + */ + getIsOrganizer(): boolean; + + /** + * Sets the value of the property. + */ + setIsOrganizer(isOrganizer: boolean): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getEmail(): string; + + /** + * Sets the value of the property. + */ + setEmail(email: string): void; + + /** + * Gets the value of the property. + */ + getRole(): number; + + /** + * Sets the value of the property. + */ + setRole(role: number): void; + + /** + * Gets the value of the property. + */ + getType(): number; + + /** + * Sets the value of the property. + */ + setType(type: number): void; + + /** + * Gets the value of the property. + */ + getStatus(): number; + + /** + * Sets the value of the property. + */ + setStatus(status: number): void; + + } + + /** + * An object that represents a single calendar. + */ + interface Calendar extends Titanium.Proxy { + /** + * Indicates whether this calendar can be edited or deleted. + */ + readonly hidden: boolean; + + /** + * Identifier of this calendar. Available only in iOS 5.0 and above. + */ + readonly id: string; + + /** + * Display name of this calendar. + */ + readonly name: string; + + /** + * Indicates whether the calendar is selected. + */ + readonly selected: boolean; + + /** + * Displays the source title. + */ + readonly sourceTitle: string; + + /** + * Displays the source type. + */ + readonly sourceType: number; + + /** + * Displays the source identifier. + */ + readonly sourceIdentifier: string; + + /** + * Creates an event in this calendar. + */ + createEvent(properties: any): Titanium.Calendar.Event; + + /** + * Gets the event with the specified identifier. + */ + getEventById(id: number): Titanium.Calendar.Event; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: Date, date2: Date | string): Titanium.Calendar.Event[]; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: string, date2: Date | string): Titanium.Calendar.Event[]; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: Date | string, date2: Date): Titanium.Calendar.Event[]; + + /** + * Gets events that occur between two dates. + */ + getEventsBetweenDates(date1: Date | string, date2: string): Titanium.Calendar.Event[]; + + /** + * Gets events that occur on a specified date. + */ + getEventsInDate(year: number, month: number, day: number): Titanium.Calendar.Event[]; + + /** + * Gets events that occur during a specified month. + */ + getEventsInMonth(year: number, month: number): Titanium.Calendar.Event[]; + + /** + * Gets all events that occur during a specified year. + */ + getEventsInYear(year: number): Titanium.Calendar.Event[]; + + /** + * Gets the value of the property. + */ + getHidden(): boolean; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getSelected(): boolean; + + /** + * Gets the value of the property. + */ + getSourceTitle(): string; + + /** + * Gets the value of the property. + */ + getSourceType(): number; + + /** + * Gets the value of the property. + */ + getSourceIdentifier(): string; + + } + + /** + * An object that represents a single event in a calendar. + */ + interface Event extends Titanium.Proxy { + /** + * Alarms associated with the calendar item, as an array of objects. + */ + alerts: Titanium.Calendar.Alert[]; + + /** + * Indicates whether this event is all day. + */ + allDay: boolean; + + /** + * Start date/time of this event. + */ + begin: Date; + + /** + * Notes for this event. + */ + notes: string; + + /** + * Description of this event. + */ + readonly description: string; + + /** + * End date/time of this event. + */ + end: Date; + + /** + * Extended properties of this event. + */ + readonly extendedProperties: any; + + /** + * Indicates whether an alarm is scheduled for this event. + */ + readonly hasAlarm: boolean; + + /** + * Identifier of this event. + */ + readonly id: string; + + /** + * Location of this event. + */ + location: string; + + /** + * Existing reminders for this event. + */ + readonly reminders: Titanium.Calendar.Reminder[]; + + /** + * Status of this event. + */ + readonly status: number; + + /** + * Availability of this event. + */ + readonly availability: number; + + /** + * Boolean value that indicates whether an event is a detached instance of a + * repeating event. + */ + readonly isDetached: boolean; + + /** + * Title of this event. + */ + title: string; + + /** + * Recurrence rule associated with the event. (Available in iOS 4.0 through iOS 5.1.) + */ + recurrenceRule: Titanium.Calendar.RecurrenceRule; + + /** + * The recurrence rules for the calendar item. (Available in iOS 5.1 and above.) + */ + recurrenceRules: Titanium.Calendar.RecurrenceRule[]; + + /** + * Visibility of this event. + */ + readonly visibility: number; + + /** + * The list of event attendees. This list will be empty if the event has no attendees. + */ + readonly attendees: Titanium.Calendar.Attendee[]; + + /** + * Creates an alert for this event. + */ + createAlert(data: any): Titanium.Calendar.Alert; + + /** + * Creates a reminder for this event. + */ + createReminder(data: any): Titanium.Calendar.Reminder; + + /** + * Gets the value of the specified extended property. + */ + getExtendedProperty(name: string): string; + + /** + * Sets the value of the specified extended property. + */ + setExtendedProperty(name: string, value: string): void; + + /** + * Creates an recurrence pattern for a recurring event. + * All of the properties for the recurrence rule must be set during creation. + * The recurrence rule properties cannot be modified. + */ + createRecurrenceRule(data: any): Titanium.Calendar.RecurrenceRule; + + /** + * Saves changes to an event permanently. + */ + save(span: number): boolean; + + /** + * Removes an event from the event store. + */ + remove(span: number): boolean; + + /** + * Updates the event's data with the current information in the Calendar database. + */ + refresh(): boolean; + + /** + * Adds a recurrence rule to the recurrence rule array. + */ + addRecurrenceRule(rule: Titanium.Calendar.RecurrenceRule): void; + + /** + * Removes a recurrence rule to the recurrence rule array. + */ + removeRecurrenceRule(rule: Titanium.Calendar.RecurrenceRule): void; + + /** + * Gets the value of the property. + */ + getAlerts(): Titanium.Calendar.Alert[]; + + /** + * Sets the value of the property. + */ + setAlerts(alerts: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getAllDay(): boolean; + + /** + * Sets the value of the property. + */ + setAllDay(allDay: boolean): void; + + /** + * Gets the value of the property. + */ + getBegin(): Date; + + /** + * Sets the value of the property. + */ + setBegin(begin: Date): void; + + /** + * Gets the value of the property. + */ + getNotes(): string; + + /** + * Sets the value of the property. + */ + setNotes(notes: string): void; + + /** + * Gets the value of the property. + */ + getDescription(): string; + + /** + * Gets the value of the property. + */ + getEnd(): Date; + + /** + * Sets the value of the property. + */ + setEnd(end: Date): void; + + /** + * Gets the value of the property. + */ + getExtendedProperties(): any; + + /** + * Gets the value of the property. + */ + getHasAlarm(): boolean; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getLocation(): string; + + /** + * Sets the value of the property. + */ + setLocation(location: string): void; + + /** + * Gets the value of the property. + */ + getReminders(): Titanium.Calendar.Reminder[]; + + /** + * Gets the value of the property. + */ + getStatus(): number; + + /** + * Gets the value of the property. + */ + getAvailability(): number; + + /** + * Gets the value of the property. + */ + getIsDetached(): boolean; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getRecurrenceRule(): Titanium.Calendar.RecurrenceRule; + + /** + * Sets the value of the property. + */ + setRecurrenceRule(recurrenceRule: Titanium.Calendar.RecurrenceRule): void; + + /** + * Gets the value of the property. + */ + getRecurrenceRules(): Titanium.Calendar.RecurrenceRule[]; + + /** + * Sets the value of the property. + */ + setRecurrenceRules(recurrenceRules: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getVisibility(): number; + + /** + * Gets the value of the property. + */ + getAttendees(): Titanium.Calendar.Attendee[]; + + } + + /** + * An object that is used to describe the recurrence pattern for a recurring event. + */ + interface RecurrenceRule extends Titanium.Proxy { + /** + * Identifier for the recurrence rule's calendar. + */ + readonly calendarID: string; + + /** + * Frequency of the recurrence rule. + */ + readonly frequency: number; + + /** + * The interval between instances of this recurrence. For example, a weekly + * recurrence rule with an interval of 2 occurs every other week. Must be greater than 0. + */ + readonly interval: number; + + /** + * The days of the week that the event occurs, as an Dictionay of `daysOfWeek` and `Week`. + */ + readonly daysOfTheWeek: daysOfTheWeekDictionary; + + /** + * The days of the month that the event occurs, as an array of number objects. + * Values can be from 1 to 31 and from -1 to -31. This parameter is only valid for + * recurrence rules of type + * [RECURRENCEFREQUENCY_MONTHLY](Titanium.Calendar.RECURRENCEFREQUENCY_MONTHLY). + */ + readonly daysOfTheMonth: number[]; + + /** + * The months of the year that the event occurs, as an array of Number objects. + * Values can be from 1 to 12. This parameter is only valid for recurrence rules of + * type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY). + */ + readonly monthsOfTheYear: number[]; + + /** + * The weeks of the year that the event occurs, as an array of number objects. + * Values can be from 1 to 53 and from -1 to -53. This parameter is only valid for + * recurrence rules of type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY). + */ + readonly weeksOfTheYear: number[]; + + /** + * The days of the year that the event occurs, as an array of number objects. + * Values can be from 1 to 366 and from -1 to -366. This parameter is only valid for + * recurrence rules of type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY). + */ + readonly daysOfTheYear: number[]; + + /** + * An array of ordinal numbers that filters which recurrences to include in the + * recurrence rule's frequency. For example, a yearly recurrence rule that has a + * [daysOfTheWeek](Titanium.Calendar.RecurrenceRule.daysOfTheWeek) value that specifies + * Monday through Friday, and a `setPositions` array containing 2 and -1, occurs only + * on the second weekday and last weekday of every year. + */ + readonly setPositions: number[]; + + /** + * End of a recurrence rule. + */ + readonly end: recurrenceEndDictionary; + + /** + * Gets the value of the property. + */ + getCalendarID(): string; + + /** + * Gets the value of the property. + */ + getFrequency(): number; + + /** + * Gets the value of the property. + */ + getInterval(): number; + + /** + * Gets the value of the property. + */ + getDaysOfTheWeek(): daysOfTheWeekDictionary; + + /** + * Gets the value of the property. + */ + getDaysOfTheMonth(): number[]; + + /** + * Gets the value of the property. + */ + getMonthsOfTheYear(): number[]; + + /** + * Gets the value of the property. + */ + getWeeksOfTheYear(): number[]; + + /** + * Gets the value of the property. + */ + getDaysOfTheYear(): number[]; + + /** + * Gets the value of the property. + */ + getSetPositions(): number[]; + + /** + * Gets the value of the property. + */ + getEnd(): recurrenceEndDictionary; + + } + + /** + * An object that represents a single reminder for an event in a calendar. + */ + interface Reminder extends Titanium.Proxy { + /** + * Identifier of this reminder. + */ + readonly id: string; + + /** + * Method by which this reminder will be delivered. + */ + readonly method: number; + + /** + * Reminder notice period in minutes, that determines how long prior to the event this reminder + * should trigger. + */ + readonly minutes: number; + + /** + * Gets the value of the property. + */ + getId(): string; + + /** + * Gets the value of the property. + */ + getMethod(): number; + + /** + * Gets the value of the property. + */ + getMinutes(): number; + + } + } - export interface Gesture { - landscape : boolean; - orientation : number; - portrait : boolean; - getLandscape () : boolean; - getOrientation () : number; - getPortrait () : boolean; - isFaceDown () : boolean; - isFaceUp () : boolean; - isLandscape () : boolean; - isPortrait () : boolean; + + /** + * A module for translating between primitive types and raw byte streams. + */ + namespace Codec { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * ASCII character encoding.. + */ + const CHARSET_ASCII: string; + + /** + * ISO 8859-1 (Latin-1) character encoding. + */ + const CHARSET_ISO_LATIN_1: string; + + /** + * UTF-8 character encoding. + */ + const CHARSET_UTF8: string; + + /** + * UTF-16 character encoding with default byte order. + */ + const CHARSET_UTF16: string; + + /** + * UTF-16 character encoding with big endian byte order. + */ + const CHARSET_UTF16BE: string; + + /** + * UTF-16 character encoding with little endian byte order. + */ + const CHARSET_UTF16LE: string; + + /** + * 8-bit integer encoding type. + */ + const TYPE_BYTE: string; + + /** + * 16-bit integer encoding type. + */ + const TYPE_SHORT: string; + + /** + * 32-bit integer encoding type. + */ + const TYPE_INT: string; + + /** + * 32-bit single precision floating-point type. + */ + const TYPE_FLOAT: string; + + /** + * 64-bit integer encoding type. + */ + const TYPE_LONG: string; + + /** + * 64-bit double precision floating-point type. + */ + const TYPE_DOUBLE: string; + + /** + * Big endian (network) byte order -- that is, the most significant byte first. + */ + const BIG_ENDIAN: number; + + /** + * Little endian byte order -- that is, the least significant byte first. + */ + const LITTLE_ENDIAN: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Get the OS native byte order (either or + * ). + */ + function getNativeByteOrder(): number; + + /** + * Encodes a number and writes it to a buffer. + */ + function encodeNumber(options: EncodeNumberDict): number; + + /** + * Decodes a number from the `source` buffer using the specified data type. + */ + function decodeNumber(options: DecodeNumberDict): number; + + /** + * Encodes a string into a series of bytes in a buffer using the specified character set. + */ + function encodeString(options: any): number; + + /** + * Decodes the source buffer into a String using the supplied character set. + */ + function decodeString(options: DecodeStringDict): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + } - export interface Analytics { - lastEvent : string; - addEvent (type: string, name: string, data?: any) : void; - featureEvent (name: string, data?: any) : void; - getLastEvent () : string; - navEvent (from: string, to: string, name?: string, data?: any) : void; - settingsEvent (name: string, data?: any) : void; - timedEvent (name: string, start: Date, stop: Date, duration: number, data?: any) : void; - userEvent (name: string, data?: any) : void; + + /** + * The top-level Contacts module, used for accessing and modifying the system contacts address book. + */ + namespace Contacts { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Specifies that a contact is an organization. + */ + const CONTACTS_KIND_ORGANIZATION: number; + + /** + * Specifies that a contact is a person. + */ + const CONTACTS_KIND_PERSON: number; + + /** + * Specifies that group members will be sorted by first name. + */ + const CONTACTS_SORT_FIRST_NAME: number; + + /** + * Specifies that group members will be sorted by last name. + */ + const CONTACTS_SORT_LAST_NAME: number; + + /** + * A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value + * indicating that the application is authorized to use the address book. + */ + const AUTHORIZATION_AUTHORIZED: number; + + /** + * A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value + * indicating that the application is not authorized to use the address book. + */ + const AUTHORIZATION_DENIED: number; + + /** + * A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value + * indicating that the application is not authorized to use the address book *and* + * the user cannot change this application's status. + */ + const AUTHORIZATION_RESTRICTED: number; + + /** + * A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value + * indicating that the authorization state is unknown. + */ + const AUTHORIZATION_UNKNOWN: number; + + /** + * Returns an authorization constant indicating if the application has access to the address book. + */ + const contactsAuthorization: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of . + */ + function createGroup(parameters?: any): Titanium.Contacts.Group; + + /** + * Creates and returns an instance of , and commits all pending + * changes to the underlying contacts database. + */ + function createPerson(parameters?: any): Titanium.Contacts.Person; + + /** + * Gets all groups. + */ + function getAllGroups(): Titanium.Contacts.Group[]; + + /** + * Gets all people, unless a limit is specified. + */ + function getAllPeople(limit: number): Titanium.Contacts.Person[]; + + /** + * Gets the group with the specified identifier. Deprecated for >= iOS9. Use instead. + */ + function getGroupByID(id: number): Titanium.Contacts.Group; + + /** + * Gets the group with the specified identifier. + */ + function getGroupByIdentifier(id: string): Titanium.Contacts.Group; + + /** + * Gets people with a `firstName`, `middleName` or `lastName` field, or a combination + * of these fields, that match the specified name. + */ + function getPeopleWithName(name: string): Titanium.Contacts.Person[]; + + /** + * Gets the person with the specified identifier. Deprecated for >= iOS9. Use instead. + */ + function getPersonByID(id: number): Titanium.Contacts.Person; + + /** + * Gets the person with the specified identifier. + */ + function getPersonByIdentifier(id: number): Titanium.Contacts.Person; + + /** + * Removes a group from the address book. + */ + function removeGroup(group: Titanium.Contacts.Group): void; + + /** + * Removes a contact from the address book. + */ + function removePerson(person: Titanium.Contacts.Person): void; + + /** + * Reverts all changes made by the previous save to the address book. Deprecated for >= iOS9. + */ + function revert(): void; + + /** + * Commits all pending changes to the underlying contacts database. + */ + function save(contacts: ReadonlyArray): void; + + /** + * Displays a picker that allows a person to be selected. + */ + function showContacts(params: showContactsParams): void; + + /** + * Returns `true` if the app has contacts access. + */ + function hasContactsPermissions(): boolean; + + /** + * Requests for contacts access. + */ + function requestContactsPermissions(callback: (param0: ContactsAuthorizationResponse) => any): void; + + /** + * If authorization is unknown, will bring up a dialog requesting permission. + */ + function requestAuthorization(callback: (param0: ContactsAuthorizationResponse) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getContactsAuthorization(): number; + + /** + * An object which represents a group in the system contacts address book. + */ + interface Group extends Titanium.Proxy { + /** + * Name of this group. + */ + name: string; + + /** + * Record identifier of the group. Single value. Deprecated for >= iOS9. + */ + recordId: number; + + /** + * Identifier of the group. + */ + readonly identifier: string; + + /** + * Adds a person to this group. + */ + add(person: Titanium.Contacts.Person): void; + + /** + * Gets people that are members of this group. + */ + members(): Titanium.Contacts.Person[]; + + /** + * Removes a person from this group. For >= iOS9, it is not + * required to call after calling this method. + */ + remove(person: Titanium.Contacts.Person): void; + + /** + * Gets people that are members of this group, sorted in the specified order. + */ + sortedMembers(sortBy: number): Titanium.Contacts.Person[]; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getRecordId(): number; + + /** + * Sets the value of the property. + */ + setRecordId(recordId: number): void; + + /** + * Gets the value of the property. + */ + getIdentifier(): string; + + } + + /** + * An object that represents a contact record for a person or organization in the system contacts + * address book. + */ + interface Person extends Titanium.Proxy { + /** + * Addresses for the person. Multi-value. Read-only on Android. + */ + address: any; + + /** + * Date of birth of the person. Single value. + */ + birthday: string; + + /** + * Alternate birthday of the person. Single Dictionary. + */ + alternateBirthday: any; + + /** + * Date and time that the person record was created. Single value. Deprecated since iOS 9. + */ + readonly created: string; + + /** + * Dates associated with the person. Multi-value. + */ + date: any; + + /** + * Department of the person. Single value. + */ + department: string; + + /** + * Email addresses for the person. Multi-value. Read-only on Android. + */ + email: any; + + /** + * First name of the person. Single value. + */ + firstName: string; + + /** + * Phonetic first name of the person. Single value. + */ + firstPhonetic: string; + + /** + * Localized full name of the person. Single value. Read-only on Android. + */ + readonly fullName: string; + + /** + * Record identifier of the person. Single value. + */ + readonly id: number; + + /** + * Identifier of the person. + */ + readonly identifier: string; + + /** + * Image for the person. Single value. Read-only for >= iOS9 + */ + image: Titanium.Blob; + + /** + * Instant messenger information of the person. Multi-value. + */ + instantMessage: any; + + /** + * Social profile information of the person. Multi-value. + */ + socialProfile: any; + + /** + * Job title of the person. Single value. + */ + jobTitle: string; + + /** + * Determines the type of information the person record contains; either person or organization. + * Read-only on Android. + */ + kind: number; + + /** + * Last name of the person. Single value. + */ + lastName: string; + + /** + * Phonetic last name of the person. Single value. + */ + lastPhonetic: string; + + /** + * Middle name of the person. Single value. + */ + middleName: string; + + /** + * Phonetic middle name of the person. Single value. + */ + middlePhonetic: string; + + /** + * Date and time that the person record was last modified. Single value. Deprecated since iOS 9. + */ + readonly modified: string; + + /** + * Nickname of the person. Single value. + */ + nickname: string; + + /** + * Notes for the person. Single value. + */ + note: string; + + /** + * Organization to which the person belongs. Single value. + */ + organization: string; + + /** + * Phone numbers for the person. Multi-value. Read-only on Android. + */ + phone: any; + + /** + * Prefix for the person. Single value. + */ + readonly prefix: string; + + /** + * Record identifier of the person. Single value. Deprecated since iOS 9. + */ + recordId: number; + + /** + * Names of people to which the person is related. Multi-value. + */ + relatedNames: any; + + /** + * Suffix for the person. Single value. + */ + readonly suffix: string; + + /** + * URLs of webpages associated with the person. Multi-value. + */ + url: any; + + /** + * Gets the value of the property. + */ + getAddress(): any; + + /** + * Sets the value of the property. + */ + setAddress(address: any): void; + + /** + * Gets the value of the property. + */ + getBirthday(): string; + + /** + * Sets the value of the property. + */ + setBirthday(birthday: string): void; + + /** + * Gets the value of the property. + */ + getAlternateBirthday(): any; + + /** + * Sets the value of the property. + */ + setAlternateBirthday(alternateBirthday: any): void; + + /** + * Gets the value of the property. + */ + getCreated(): string; + + /** + * Gets the value of the property. + */ + getDate(): any; + + /** + * Sets the value of the property. + */ + setDate(date: any): void; + + /** + * Gets the value of the property. + */ + getDepartment(): string; + + /** + * Sets the value of the property. + */ + setDepartment(department: string): void; + + /** + * Gets the value of the property. + */ + getEmail(): any; + + /** + * Sets the value of the property. + */ + setEmail(email: any): void; + + /** + * Gets the value of the property. + */ + getFirstName(): string; + + /** + * Sets the value of the property. + */ + setFirstName(firstName: string): void; + + /** + * Gets the value of the property. + */ + getFirstPhonetic(): string; + + /** + * Sets the value of the property. + */ + setFirstPhonetic(firstPhonetic: string): void; + + /** + * Gets the value of the property. + */ + getFullName(): string; + + /** + * Gets the value of the property. + */ + getId(): number; + + /** + * Gets the value of the property. + */ + getIdentifier(): string; + + /** + * Gets the value of the property. + */ + getImage(): Titanium.Blob; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getInstantMessage(): any; + + /** + * Sets the value of the property. + */ + setInstantMessage(instantMessage: any): void; + + /** + * Gets the value of the property. + */ + getSocialProfile(): any; + + /** + * Sets the value of the property. + */ + setSocialProfile(socialProfile: any): void; + + /** + * Gets the value of the property. + */ + getJobTitle(): string; + + /** + * Sets the value of the property. + */ + setJobTitle(jobTitle: string): void; + + /** + * Gets the value of the property. + */ + getKind(): number; + + /** + * Sets the value of the property. + */ + setKind(kind: number): void; + + /** + * Gets the value of the property. + */ + getLastName(): string; + + /** + * Sets the value of the property. + */ + setLastName(lastName: string): void; + + /** + * Gets the value of the property. + */ + getLastPhonetic(): string; + + /** + * Sets the value of the property. + */ + setLastPhonetic(lastPhonetic: string): void; + + /** + * Gets the value of the property. + */ + getMiddleName(): string; + + /** + * Sets the value of the property. + */ + setMiddleName(middleName: string): void; + + /** + * Gets the value of the property. + */ + getMiddlePhonetic(): string; + + /** + * Sets the value of the property. + */ + setMiddlePhonetic(middlePhonetic: string): void; + + /** + * Gets the value of the property. + */ + getModified(): string; + + /** + * Gets the value of the property. + */ + getNickname(): string; + + /** + * Sets the value of the property. + */ + setNickname(nickname: string): void; + + /** + * Gets the value of the property. + */ + getNote(): string; + + /** + * Sets the value of the property. + */ + setNote(note: string): void; + + /** + * Gets the value of the property. + */ + getOrganization(): string; + + /** + * Sets the value of the property. + */ + setOrganization(organization: string): void; + + /** + * Gets the value of the property. + */ + getPhone(): any; + + /** + * Sets the value of the property. + */ + setPhone(phone: any): void; + + /** + * Gets the value of the property. + */ + getPrefix(): string; + + /** + * Gets the value of the property. + */ + getRecordId(): number; + + /** + * Sets the value of the property. + */ + setRecordId(recordId: number): void; + + /** + * Gets the value of the property. + */ + getRelatedNames(): any; + + /** + * Sets the value of the property. + */ + setRelatedNames(relatedNames: any): void; + + /** + * Gets the value of the property. + */ + getSuffix(): string; + + /** + * Gets the value of the property. + */ + getUrl(): any; + + /** + * Sets the value of the property. + */ + setUrl(url: any): void; + + } + } - export module Facebook { - export var BUTTON_STYLE_NORMAL : number; - export var BUTTON_STYLE_WIDE : number; - export var accessToken : string; - export var apiName : string; - export var appid : string; - export var bubbleParent : boolean; - export var expirationDate : Date; - export var forceDialogAuth : boolean; - export var loggedIn : boolean; - export var permissions : Array; - export var uid : string; - export function addEventListener (name: string, callback: (...args : any[]) => any) : void; - export function applyProperties (props: Dictionary) : void; - export function authorize () : void; - export function createLoginButton (parameters?: Dictionary) : Ti.Facebook.LoginButton; - export function dialog (action: string, params: any, callback: (...args : any[]) => any) : void; - export function fireEvent (name: string, event: Dictionary) : void; - export function getAccessToken () : string; - export function getApiName () : string; - export function getAppid () : string; - export function getBubbleParent () : boolean; - export function getExpirationDate () : Date; - export function getForceDialogAuth () : boolean; - export function getLoggedIn () : boolean; - export function getPermissions () : Array; - export function getUid () : string; - export function logout () : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function request (method: string, params: any, callback: (...args : any[]) => any) : void; - export function requestWithGraphPath (path: string, params: Dictionary, httpMethod: string, callback: (...args : any[]) => any) : void; - export function setAccessToken (accessToken: string) : void; - export function setAppid (appid: string) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setExpirationDate (expirationDate: Date) : void; - export function setForceDialogAuth (forceDialogAuth: boolean) : void; - export function setLoggedIn (loggedIn: boolean) : void; - export function setPermissions (permissions: Array) : void; - export function setUid (uid: string) : void; - export interface LoginButton extends Ti.UI.View { - style : string; - getStyle () : string; - setStyle (style: string) : void; + + /** + * The top-level `Database` module, used for creating and accessing the + * in-application SQLite database. + */ + namespace Database { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Constant for requesting a column's value returned in double form. + */ + const FIELD_TYPE_DOUBLE: number; + + /** + * Constant for requesting a column's value returned in float form. + */ + const FIELD_TYPE_FLOAT: number; + + /** + * Constant for requesting a column's value returned in integer form. + */ + const FIELD_TYPE_INT: number; + + /** + * Constant for requesting a column's value returned in string form. + */ + const FIELD_TYPE_STRING: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Installs an SQLite database to device's internal storage. + */ + function install(path: string, dbName: string): Titanium.Database.DB; + + /** + * Opens an SQLite database. + */ + function open(dbName: string): Titanium.Database.DB; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * The `Database` instance returned by or . + */ + interface DB extends Titanium.Proxy { + /** + * A `File` object representing the file where this database is stored. Must only be used for + * setting file properties. + */ + readonly file: Titanium.Filesystem.File; + + /** + * The identifier of the last populated row. + */ + lastInsertRowId: number; + + /** + * The name of the database. + */ + name: string; + + /** + * The number of rows affected by the last query. + */ + rowsAffected: number; + + /** + * Closes the database and releases resources from memory. Once closed, this instance is no + * longer valid and should not be used. On iOS, also closes all + * instances that exist. + */ + close(): void; + + /** + * Executes an SQL statement against the database and returns a `ResultSet`. + */ + execute(sql: string, vararg?: string): Titanium.Database.ResultSet; + + /** + * Executes an SQL statement against the database and returns a `ResultSet`. + */ + execute(sql: string, vararg?: ReadonlyArray): Titanium.Database.ResultSet; + + /** + * Executes an SQL statement against the database and returns a `ResultSet`. + */ + execute(sql: string, vararg?: any): Titanium.Database.ResultSet; + + /** + * Executes an SQL statement against the database and returns a `ResultSet`. + */ + execute(sql: string, vararg?: ReadonlyArray): Titanium.Database.ResultSet; + + /** + * Removes the database files for this instance from disk. WARNING: this is a destructive + * operation and cannot be reversed. All data in the database will be lost; use with caution. + */ + remove(): void; + + /** + * Gets the value of the property. + */ + getFile(): Titanium.Filesystem.File; + + /** + * Gets the value of the property. + */ + getLastInsertRowId(): number; + + /** + * Sets the value of the property. + */ + setLastInsertRowId(lastInsertRowId: number): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getRowsAffected(): number; + + /** + * Sets the value of the property. + */ + setRowsAffected(rowsAffected: number): void; + + } + + /** + * The ResultSet instance returned by . + */ + interface ResultSet extends Titanium.Proxy { + /** + * The number of columns in this result set. + */ + readonly fieldCount: number; + + /** + * The number of rows in this result set. + */ + readonly rowCount: number; + + /** + * Indicates whether the current row is valid. + */ + readonly validRow: boolean; + + /** + * Closes this result set and release resources. Once closed, the result set must no longer + * be used. + */ + close(): void; + + /** + * Retrieves the value for the specified field in the current row, + * and casts it to the specified type (String, Integer, Float or Double.) + */ + field(index: number, type?: number): string | number | Titanium.Blob; + + /** + * Retrieves the value for the specified field in the current row, + * and casts it to the specified type (String, Integer, Float or Double.) + */ + fieldByName(name: string, type?: number): string | number | Titanium.Blob; + + /** + * Returns the field name for the specified field index. + */ + fieldName(index: number): string; + + /** + * Returns the field name for the specified field index. + */ + getFieldName(index: number): string; + + /** + * Returns whether the current row is valid. + */ + isValidRow(): boolean; + + /** + * Advances to the next row in the result set and returns `true` if one exists, + * or `false` otherwise. + */ + next(): boolean; + + /** + * Gets the value of the property. + */ + getFieldCount(): number; + + /** + * Gets the value of the property. + */ + getRowCount(): number; + + /** + * Gets the value of the property. + */ + getValidRow(): boolean; + + } + + } + + /** + * The top level filesystem module, used to access files and directories on the device. + */ + namespace Filesystem { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Constant for append mode for file operations. + */ + const MODE_APPEND: number; + + /** + * Constant for read mode for file operations. + */ + const MODE_READ: number; + + /** + * Constant for write mode for file operations. + */ + const MODE_WRITE: number; + + /** + * Constant used to set protection key to NSFileProtectionNone in file attributes. + */ + const IOS_FILE_PROTECTION_NONE: string; + + /** + * Constant used to set protection key to NSFileProtectionComplete in file attributes. + */ + const IOS_FILE_PROTECTION_COMPLETE: string; + + /** + * Constant used to set protection key to NSFileProtectionCompleteUnlessOpen in file attributes. + */ + const IOS_FILE_PROTECTION_COMPLETE_UNLESS_OPEN: string; + + /** + * Constant used to set protection key to NSFileProtectionCompleteUntilFirstUserAuthentication in file attributes. + */ + const IOS_FILE_PROTECTION_COMPLETE_UNTIL_FIRST_USER_AUTHENTICATION: string; + + /** + * Path to the application's internal cache directory. + */ + const applicationCacheDirectory: string; + + /** + * Path to the application's data directory. + */ + const applicationDataDirectory: string; + + /** + * Path to the iOS application directory. + */ + const applicationDirectory: string; + + /** + * Path to the application support directory. + */ + const applicationSupportDirectory: string; + + /** + * Path to a directory on removable storage, such as SD card. + */ + const externalStorageDirectory: string; + + /** + * Platform-specific line ending constant. + */ + const lineEnding: string; + + /** + * Path to the application's resource directory. + */ + const resourcesDirectory: string; + + /** + * Path to the application's raw resource directory. + */ + const resRawDirectory: string; + + /** + * Platform-specific path separator constant. + */ + const separator: string; + + /** + * Path for the application's temporary directory. + */ + const tempDirectory: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates a temporary directory and returns a [File](Titanium.Filesystem.File) object representing the new directory. + */ + function createTempDirectory(): Titanium.Filesystem.File; + + /** + * Creates a temporary file and returns a [File](Titanium.Filesystem.File) object representing the new file. + */ + function createTempFile(): Titanium.Filesystem.File; + + /** + * Returns a `File` object representing the file identified by the path arguments. + */ + function getFile(...paths: string[]): Titanium.Filesystem.File; + + /** + * Returns a `Blob` object representing the asset catalog image identified by the path arguments. + */ + function getAsset(path: string): Titanium.Blob; + + /** + * Returns `true` if the device supports external storage *and* the external storage device is mounted. + */ + function isExternalStoragePresent(): boolean; + + /** + * Returns `true` if the app has storage permissions. + */ + function hasStoragePermissions(): boolean; + + /** + * Requests for storage permissions + */ + function requestStoragePermissions(callback: (param0: RequestStorageAccessResult) => any): void; + + /** + * Opens file using the interface. + */ + function openStream(mode: number, path: string): Titanium.Filesystem.FileStream; + + /** + * Returns the path to the container directory associated with the specified security application group ID. + */ + function directoryForSuite(suiteName: string): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getApplicationCacheDirectory(): string; + + /** + * Gets the value of the property. + */ + function getApplicationDataDirectory(): string; + + /** + * Gets the value of the property. + */ + function getApplicationDirectory(): string; + + /** + * Gets the value of the property. + */ + function getApplicationSupportDirectory(): string; + + /** + * Gets the value of the property. + */ + function getExternalStorageDirectory(): string; + + /** + * Gets the value of the property. + */ + function getLineEnding(): string; + + /** + * Gets the value of the property. + */ + function getResourcesDirectory(): string; + + /** + * Gets the value of the property. + */ + function getResRawDirectory(): string; + + /** + * Gets the value of the property. + */ + function getSeparator(): string; + + /** + * Gets the value of the property. + */ + function getTempDirectory(): string; + + /** + * Object representing a path to a file or directory in the device's persistent storage. + */ + interface File extends Titanium.Proxy { + /** + * `true` if the file is executable. + */ + readonly executable: boolean; + + /** + * Set to `true` if the file is hidden. + */ + hidden: boolean; + + /** + * Name of the file. + */ + readonly name: string; + + /** + * Native path associated with this file object, as a file URL. + */ + readonly nativePath: string; + + /** + * A `File` object representing the parent directory of the file identified by this object. + */ + readonly parent: Titanium.Filesystem.File; + + /** + * `true` if the file identified by this object is read-only. + */ + readonly readonly: boolean; + + /** + * Size, in bytes, of the file identified by this object. + */ + readonly size: number; + + /** + * Value indicating whether or not to back up to a cloud service. + */ + remoteBackup: boolean; + + /** + * `true` if the file identified by this object is a symbolic link. + */ + readonly symbolicLink: boolean; + + /** + * `true` if the file identified by this object is writable. + */ + readonly writable: boolean; + + /** + * `true` if the file identified by this object is writable. + */ + readonly writeable: boolean; + + /** + * Appends data to the file identified by this file object. + */ + append(data: string): boolean; + + /** + * Appends data to the file identified by this file object. + */ + append(data: Titanium.Blob): boolean; + + /** + * Appends data to the file identified by this file object. + */ + append(data: Titanium.Filesystem.File): boolean; + + /** + * Copies the file identified by this file object to a new path. + */ + copy(destinationPath: string): boolean; + + /** + * Creates a directory at the path identified by this file object. + */ + createDirectory(): boolean; + + /** + * Creates a file at the path identified by this file object. + */ + createFile(): boolean; + + /** + * Returns the creation timestamp for the file identified by this file object. + */ + createTimestamp(): number; + + /** + * Deletes the directory identified by this file object. + */ + deleteDirectory(recursive?: boolean): boolean; + + /** + * Deletes the file identified by this file object. + */ + deleteFile(): boolean; + + /** + * Returns `true` if the file or directory identified by this file object exists on the device. + */ + exists(): boolean; + + /** + * Returns the extension for the file identified by this file object. + */ + extension(): string; + + /** + * Returns a listing of the directory identified by this file object, or `null` + * if this object doesn't identify a directory. + */ + getDirectoryListing(): string[]; + + /** + * Returns the path of the parent directory holding the file identified by this + * file object, as a String (deprecated) **or** as a `File` object. + */ + getParent(): string | Titanium.Filesystem.File; + + /** + * Returns the protection key value of this file object. + * Returns `null` if there's an error. + */ + getProtectionKey(): string; + + /** + * Returns `true` if this file object represents a directory. + */ + isDirectory(): boolean; + + /** + * Returns `true` if this file object represents an ordinary file. + */ + isFile(): boolean; + + /** + * Returns the last modification time for this file. + */ + modificationTimestamp(): number; + + /** + * Moves the file identified by this file object to another path. + */ + move(newpath: string): boolean; + + /** + * Opens the file identified by this file object for random access. + */ + open(mode: number): Titanium.Filesystem.FileStream; + + /** + * Returns the contents of the file identified by this file object as a `Blob`. + */ + read(): Titanium.Blob; + + /** + * Renames the file identified by this file object. + */ + rename(newname: string): boolean; + + /** + * Returns the fully-resolved native path associated with this file object. + */ + resolve(): string; + + /** + * Sets the protection key as an attribute to the file identified by this file object. + */ + setProtectionKey(fileProtectionType: string): boolean; + + /** + * Returns the amount of free space available on the device where the file identified by this file object is stored. + */ + spaceAvailable(): number; + + /** + * Writes the specified data to the file identified by this file object. + */ + write(data: string, append?: boolean): boolean; + + /** + * Writes the specified data to the file identified by this file object. + */ + write(data: Titanium.Filesystem.File, append?: boolean): boolean; + + /** + * Writes the specified data to the file identified by this file object. + */ + write(data: Titanium.Blob, append?: boolean): boolean; + + /** + * Gets the value of the property. + */ + getExecutable(): boolean; + + /** + * Gets the value of the property. + */ + getHidden(): boolean; + + /** + * Sets the value of the property. + */ + setHidden(hidden: boolean): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getNativePath(): string; + + /** + * Gets the value of the property. + */ + getParent(): Titanium.Filesystem.File; + + /** + * Gets the value of the property. + */ + getReadonly(): boolean; + + /** + * Gets the value of the property. + */ + getSize(): number; + + /** + * Gets the value of the property. + */ + getRemoteBackup(): boolean; + + /** + * Sets the value of the property. + */ + setRemoteBackup(remoteBackup: boolean): void; + + /** + * Gets the value of the property. + */ + getSymbolicLink(): boolean; + + /** + * Gets the value of the property. + */ + getWritable(): boolean; + + /** + * Gets the value of the property. + */ + getWriteable(): boolean; + + } + + /** + * Wrapper around `Titanium.Filesystem.File` that implements the `Titanium.IOStream` interface + */ + interface FileStream extends Titanium.Proxy { + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * closes file stream, exception is thrown on error + */ + close(): void; + + } + + } + + /** + * The top level Geolocation module. The Geolocation module is used for accessing device location based information. + */ + namespace Geolocation { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request the best + * accuracy available. + */ + const ACCURACY_BEST: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request location + * updates accurate to the nearest 100 meters. + */ + const ACCURACY_HUNDRED_METERS: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request location + * updates accurate to the nearest kilometer. + */ + const ACCURACY_KILOMETER: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request location + * updates accurate to the nearest 10 meters. + */ + const ACCURACY_NEAREST_TEN_METERS: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request location + * updates accurate to the nearest three kilometers. + */ + const ACCURACY_THREE_KILOMETERS: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request more + * accurate location updates with higher battery usage. + */ + const ACCURACY_HIGH: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request highest possible + * accuracy and combine it with additional sensor data. + */ + const ACCURACY_BEST_FOR_NAVIGATION: number; + + /** + * Use with [accuracy](Titanium.Geolocation.accuracy) to request less + * accurate location updates with lower battery usage. + */ + const ACCURACY_LOW: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is authorized to use location services. + */ + const AUTHORIZATION_AUTHORIZED: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is not authorized to use location services, *or* + * location services are disabled. + */ + const AUTHORIZATION_DENIED: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is not authorized to use location servies *and* + * the user cannot change this application's status. + */ + const AUTHORIZATION_RESTRICTED: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the authorization state is unknown. + */ + const AUTHORIZATION_UNKNOWN: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is authorized to start location services at any time. This authorization + * includes the use of all location services, including monitoring regions and significant location changes. + */ + const AUTHORIZATION_ALWAYS: number; + + /** + * A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value + * indicating that the application is authorized to start most location services only while running in the foreground. + */ + const AUTHORIZATION_WHEN_IN_USE: number; + + /** + * Error code indicating that the user denied access to the location service. + */ + const ERROR_DENIED: number; + + /** + * Error code indicating that the heading could not be determined. + */ + const ERROR_HEADING_FAILURE: number; + + /** + * Error code indicating that the user's location could not be determined. + */ + const ERROR_LOCATION_UNKNOWN: number; + + /** + * Error code indicating that the network was unavailable. + */ + const ERROR_NETWORK: number; + + /** + * Error code indicating that region monitoring is delayed. + */ + const ERROR_REGION_MONITORING_DELAYED: number; + + /** + * Error code indicating that region monitoring is denied. + */ + const ERROR_REGION_MONITORING_DENIED: number; + + /** + * Error code indicating a region monitoring failure. + */ + const ERROR_REGION_MONITORING_FAILURE: number; + + /** + * Specifies the GPS location provider. + */ + const PROVIDER_GPS: string; + + /** + * Specifies the network location provider. + */ + const PROVIDER_NETWORK: string; + + /** + * Specifies the passive location provider. + */ + const PROVIDER_PASSIVE: string; + + /** + * The location data is being used for an unknown activity. + */ + const ACTIVITYTYPE_OTHER: string; + + /** + * The location data is used for tracking location changes to the automobile specifically during vehicular navigation. + */ + const ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION: string; + + /** + * The location data is used for tracking any pedestrian-related activity. + */ + const ACTIVITYTYPE_FITNESS: string; + + /** + * The location data is used for tracking movements of other types of vehicular + * navigation that are not automobile related. + */ + const ACTIVITYTYPE_OTHER_NAVIGATION: string; + + /** + * Specifies the requested accuracy for location updates. + */ + let accuracy: number; + + /** + * The minimum change of position (in meters) before a 'location' event is fired. + */ + let distanceFilter: number; + + /** + * Requested frequency for location updates, in milliseconds. + */ + let frequency: number; + + /** + * Indicates whether the current device supports a compass. + */ + const hasCompass: boolean; + + /** + * Minimum heading change (in degrees) before a `heading` event is fired. + */ + let headingFilter: number; + + /** + * Returns an authorization constant indicating if the application has access to location services. + */ + let locationServicesAuthorization: number; + + /** + * Indicates if the user has enabled or disabled location services for the device (not the application). + */ + const locationServicesEnabled: boolean; + + /** + * Determines the preferred location provider. + */ + let preferredProvider: string; + + /** + * Text to display in the permission dialog when requesting location + * services. + */ + let purpose: string; + + /** + * Determines whether the compass calibration UI is shown if needed. + */ + let showCalibration: boolean; + + /** + * Indicates if the location changes should be updated only when a significant change + * in location occurs. + */ + let trackSignificantLocationChange: boolean; + + /** + * Determines if the app can do background location updates. + */ + let allowsBackgroundLocationUpdates: boolean; + + /** + * The type of user activity to be associated with the location updates. Available in iOS 6.0 and later. + */ + let activityType: number; + + /** + * Indicates whether the location updates may be paused. Available in iOS 6.0 and later. + */ + let pauseLocationUpdateAutomatically: boolean; + + /** + * JSON representation of the last geolocation received. + */ + const lastGeolocation: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Resolves an address to a location. + */ + function forwardGeocoder(address: string, callback: (param0: ForwardGeocodeResponse) => any): void; + + /** + * Retrieves the current compass heading. + */ + function getCurrentHeading(callback: (param0: HeadingResponse) => any): void; + + /** + * Retrieves the last known location from the device. + */ + function getCurrentPosition(callback: (param0: LocationResults) => any): void; + + /** + * Returns `true` if the app has location access. + */ + function hasLocationPermissions(authorizationType: number): boolean; + + /** + * Requests for location access. + */ + function requestLocationPermissions(authorizationType: number, callback: (param0: LocationAuthorizationResponse) => any): void; + + /** + * Tries to resolve a location to an address. + */ + function reverseGeocoder(latitude: number, longitude: number, callback: (param0: ReverseGeocodeResponse) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAccuracy(): number; + + /** + * Sets the value of the property. + */ + function setAccuracy(accuracy: number): void; + + /** + * Gets the value of the property. + */ + function getDistanceFilter(): number; + + /** + * Sets the value of the property. + */ + function setDistanceFilter(distanceFilter: number): void; + + /** + * Gets the value of the property. + */ + function getFrequency(): number; + + /** + * Sets the value of the property. + */ + function setFrequency(frequency: number): void; + + /** + * Gets the value of the property. + */ + function getHasCompass(): boolean; + + /** + * Gets the value of the property. + */ + function getHeadingFilter(): number; + + /** + * Sets the value of the property. + */ + function setHeadingFilter(headingFilter: number): void; + + /** + * Gets the value of the property. + */ + function getLocationServicesAuthorization(): number; + + /** + * Sets the value of the property. + */ + function setLocationServicesAuthorization(locationServicesAuthorization: number): void; + + /** + * Gets the value of the property. + */ + function getLocationServicesEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getPreferredProvider(): string; + + /** + * Sets the value of the property. + */ + function setPreferredProvider(preferredProvider: string): void; + + /** + * Gets the value of the property. + */ + function getPurpose(): string; + + /** + * Sets the value of the property. + */ + function setPurpose(purpose: string): void; + + /** + * Gets the value of the property. + */ + function getShowCalibration(): boolean; + + /** + * Sets the value of the property. + */ + function setShowCalibration(showCalibration: boolean): void; + + /** + * Gets the value of the property. + */ + function getTrackSignificantLocationChange(): boolean; + + /** + * Sets the value of the property. + */ + function setTrackSignificantLocationChange(trackSignificantLocationChange: boolean): void; + + /** + * Gets the value of the property. + */ + function getAllowsBackgroundLocationUpdates(): boolean; + + /** + * Sets the value of the property. + */ + function setAllowsBackgroundLocationUpdates(allowsBackgroundLocationUpdates: boolean): void; + + /** + * Gets the value of the property. + */ + function getActivityType(): number; + + /** + * Sets the value of the property. + */ + function setActivityType(activityType: number): void; + + /** + * Gets the value of the property. + */ + function getPauseLocationUpdateAutomatically(): boolean; + + /** + * Sets the value of the property. + */ + function setPauseLocationUpdateAutomatically(pauseLocationUpdateAutomatically: boolean): void; + + /** + * Gets the value of the property. + */ + function getLastGeolocation(): string; + + + /** + * Module for Android-specific geolocation functionality. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Set to `true` to enable manual configuration of location updates through this module. + */ + let manualMode: boolean; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Adds and enables the specified location provider, possibly replacing an existing one. + */ + function addLocationProvider(provider: Titanium.Geolocation.Android.LocationProvider): void; + + /** + * Disables and removes the specified location provider. + */ + function removeLocationProvider(provider: Titanium.Geolocation.Android.LocationProvider): void; + + /** + * Adds and enables the specified location rule. + */ + function addLocationRule(rule: Titanium.Geolocation.Android.LocationRule): void; + + /** + * Disables and removes the specified location rule. + */ + function removeLocationRule(rule: Titanium.Geolocation.Android.LocationRule): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getManualMode(): boolean; + + /** + * Sets the value of the property. + */ + function setManualMode(manualMode: boolean): void; + + /** + * Creates and returns an instance of . + */ + function createLocationProvider(parameters?: any): Titanium.Geolocation.Android.LocationProvider; + + /** + * Creates and returns an instance of . + */ + function createLocationRule(parameters?: any): Titanium.Geolocation.Android.LocationRule; + + /** + * Represents a source of location information, such as GPS. + */ + interface LocationProvider extends Titanium.Proxy { + /** + * Type of location provider: [PROVIDER_GPS](Titanium.Geolocation.PROVIDER_GPS), + * [PROVIDER_NETWORK](Titanium.Geolocation.PROVIDER_NETWORK), or + * [PROVIDER_PASSIVE](Titanium.Geolocation.PROVIDER_PASSIVE). + */ + name: string; + + /** + * Limits the frequency of location updates to no more than one per `minUpdateTime` seconds. + */ + minUpdateTime: number; + + /** + * Don't send a location update unless the location has changed at least `minUpdateDistance` + * meters since the previous update. + */ + minUpdateDistance: number; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getMinUpdateTime(): number; + + /** + * Sets the value of the property. + */ + setMinUpdateTime(minUpdateTime: number): void; + + /** + * Gets the value of the property. + */ + getMinUpdateDistance(): number; + + /** + * Sets the value of the property. + */ + setMinUpdateDistance(minUpdateDistance: number): void; + + } + + /** + * A location rule to filter the results returned by location providers. + */ + interface LocationRule extends Titanium.Proxy { + /** + * If specified, this rule only applies to updates generated + * by the specified provider. If `null`, this rule applies to all updates. + */ + name: string; + + /** + * Minimum accuracy required for a location update. + */ + accuracy: number; + + /** + * Controls the frequency of location updates. + */ + minAge: number; + + /** + * Controls the freshness of location updates. Do not forward an update + * unless it is newer than `maxAge` milliseconds. + */ + maxAge: number; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getAccuracy(): number; + + /** + * Sets the value of the property. + */ + setAccuracy(accuracy: number): void; + + /** + * Gets the value of the property. + */ + getMinAge(): number; + + /** + * Sets the value of the property. + */ + setMinAge(minAge: number): void; + + /** + * Gets the value of the property. + */ + getMaxAge(): number; + + /** + * Sets the value of the property. + */ + setMaxAge(maxAge: number): void; + + } + } } - export enum Accelerometer { + + /** + * The Gesture module is responsible for high-level device gestures such as orientation changes + * and shake gestures. + */ + namespace Gesture { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Indicates if the device is currently held in portrait form. + */ + const portrait: boolean; + + /** + * Indicates if the device is currently held in landscape form. + */ + const landscape: boolean; + + /** + * Orientation of the device. + */ + const orientation: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns whether or not the device is currently held in landscape form. + */ + function isLandscape(): boolean; + + /** + * Returns whether or not the device is currently held in portrait form. + */ + function isPortrait(): boolean; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getOrientation(): number; } - export interface Utils { - base64decode (obj: string) : Ti.Blob; - base64decode (obj: Ti.Blob) : Ti.Blob; - base64encode (obj: string) : Ti.Blob; - base64encode (obj: Ti.Blob) : Ti.Blob; - base64encode (obj: Ti.Filesystem.File) : Ti.Blob; - md5HexDigest (obj: string) : string; - md5HexDigest (obj: Ti.Blob) : string; - sha1 (obj: string) : string; - sha1 (obj: Ti.Blob) : string; - sha256 (obj: string) : string; - sha256 (obj: Ti.Blob) : string; + + /** + * The top level Locale module. + */ + namespace Locale { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Country of the current system locale, as an ISO 2-letter code. + */ + const currentCountry: string; + + /** + * Language of the current system locale, as an ISO 2-letter code. + */ + const currentLanguage: string; + + /** + * Current system locale, as a combination of ISO 2-letter language and country codes. + */ + const currentLocale: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Formats a telephone number according to the current system locale. + */ + function formatTelephoneNumber(number: string): string; + + /** + * Returns the ISO 3-letter currency code for the specified locale. + */ + function getCurrencyCode(locale: string): string; + + /** + * Returns the currency symbol for the specified currency code. + */ + function getCurrencySymbol(currencyCode: string): string; + + /** + * Sets the current language of the application. + */ + function setLanguage(language: string): void; + + /** + * Returns the currency symbol for the specified locale. + */ + function getLocaleCurrencySymbol(locale: string): string; + + /** + * Returns a string, localized according to the current system locale using the appropriate + * `/i18n/LANG/strings.xml` localization file. + */ + function getString(key: string, hint?: string): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getCurrentCountry(): string; + + /** + * Gets the value of the property. + */ + function getCurrentLanguage(): string; + + /** + * Gets the value of the property. + */ + function getCurrentLocale(): string; + } - export interface Event { - bubbles : boolean; - cancelBubble : boolean; - source : any; - type : string; + + /** + * The top level Map module. The Map module is used for creating in-application native maps. + */ + namespace Map { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the annotation is not being dragged. + */ + const ANNOTATION_DRAG_STATE_NONE: number; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the user started dragging the annotation. + */ + const ANNOTATION_DRAG_STATE_START: number; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the user moved the annotation. + */ + const ANNOTATION_DRAG_STATE_DRAG: number; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the user canceled the drag action. + */ + const ANNOTATION_DRAG_STATE_CANCEL: number; + + /** + * Used in the [pinchangedragstate](Titanium.Map.View.pinchangedragstate) event + * to indicate that the user finished moving the annotation. + */ + const ANNOTATION_DRAG_STATE_END: number; + + /** + * Color constant used to set a map annotation to green via the + * property. + */ + const ANNOTATION_GREEN: number; + + /** + * Color constant used to set a map annotation to purple via the + * property. + */ + const ANNOTATION_PURPLE: number; + + /** + * Color constant used to set a map annotation to red via the + * property. + */ + const ANNOTATION_RED: number; + + /** + * Used with [mapType](Titanium.Map.View.mapType) to display a satellite image of the area with road and road name information layered on top. + */ + const HYBRID_TYPE: number; + + /** + * Used with [mapType](Titanium.Map.View.mapType) to display satellite imagery of the area. + */ + const SATELLITE_TYPE: number; + + /** + * Used with [mapType](Titanium.Map.View.mapType) to display a street map that shows the position of all roads and some road names. + */ + const STANDARD_TYPE: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates and returns an instance of . + */ + function createAnnotation(parameters?: any): Titanium.Map.Annotation; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Creates and returns an instance of . + */ + function createView(parameters?: any): Titanium.Map.View; + + /** + * Represents a labeled point of interest on the map that the user can click on. + */ + interface Annotation extends Titanium.Proxy { + /** + * Boolean to indicate whether the pin should animate when dropped. + */ + animate: boolean; + + /** + * Defines whether the annotation view is able to display extra information in a callout bubble. + */ + canShowCallout: boolean; + + /** + * Defines a center offset point for the annotation. + */ + centerOffset: Point; + + /** + * Defines a custom view to be used by the annotation. + */ + customView: Titanium.UI.View; + + /** + * Determines whether the pin can be dragged by the user. + */ + draggable: boolean; + + /** + * Image to use for the the pin. + */ + image: string | Titanium.Blob; + + /** + * Latitude of the annotation, in decimal degrees. + */ + latitude: number; + + /** + * Longitude of the annotation, in decimal degrees. + */ + longitude: number; + + /** + * Left button image on the annotation, specified as an image URL or an iOS + * button constant. + */ + leftButton: number | string; + + /** + * Left view that is displayed on the annotation. + */ + leftView: Titanium.UI.View; + + /** + * Image for the pin instead of the default image. + */ + pinImage: string; + + /** + * Pin color. Specify one of: , + * or . + */ + pincolor: number; + + /** + * Right button image on the annotation, specified as an image URL or an iOS + * button constant. + */ + rightButton: number | string; + + /** + * Right view that is displayed on the annotation. + */ + rightView: Titanium.UI.View; + + /** + * Secondary title of the annotation view. + */ + subtitle: string; + + /** + * Key in the locale file to use for the subtitle property. + */ + subtitleid: string; + + /** + * Primary title of the annotation view. + */ + title: string; + + /** + * Key in the locale file to use for the title property. + */ + titleid: string; + + /** + * Gets the value of the property. + */ + getAnimate(): boolean; + + /** + * Sets the value of the property. + */ + setAnimate(animate: boolean): void; + + /** + * Gets the value of the property. + */ + getCanShowCallout(): boolean; + + /** + * Sets the value of the property. + */ + setCanShowCallout(canShowCallout: boolean): void; + + /** + * Gets the value of the property. + */ + getCenterOffset(): Point; + + /** + * Sets the value of the property. + */ + setCenterOffset(centerOffset: Point): void; + + /** + * Gets the value of the property. + */ + getCustomView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setCustomView(customView: any): void; + + /** + * Gets the value of the property. + */ + getDraggable(): boolean; + + /** + * Sets the value of the property. + */ + setDraggable(draggable: boolean): void; + + /** + * Gets the value of the property. + */ + getImage(): string | Titanium.Blob; + + /** + * Sets the value of the property. + */ + setImage(image: string): void; + + /** + * Sets the value of the property. + */ + setImage(image: Titanium.Blob): void; + + /** + * Gets the value of the property. + */ + getLatitude(): number; + + /** + * Sets the value of the property. + */ + setLatitude(latitude: number): void; + + /** + * Gets the value of the property. + */ + getLongitude(): number; + + /** + * Sets the value of the property. + */ + setLongitude(longitude: number): void; + + /** + * Gets the value of the property. + */ + getLeftButton(): number | string; + + /** + * Sets the value of the property. + */ + setLeftButton(leftButton: number): void; + + /** + * Sets the value of the property. + */ + setLeftButton(leftButton: string): void; + + /** + * Gets the value of the property. + */ + getLeftView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setLeftView(leftView: any): void; + + /** + * Gets the value of the property. + */ + getPinImage(): string; + + /** + * Sets the value of the property. + */ + setPinImage(pinImage: string): void; + + /** + * Gets the value of the property. + */ + getPincolor(): number; + + /** + * Sets the value of the property. + */ + setPincolor(pincolor: number): void; + + /** + * Gets the value of the property. + */ + getRightButton(): number | string; + + /** + * Sets the value of the property. + */ + setRightButton(rightButton: number): void; + + /** + * Sets the value of the property. + */ + setRightButton(rightButton: string): void; + + /** + * Gets the value of the property. + */ + getRightView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setRightView(rightView: any): void; + + /** + * Gets the value of the property. + */ + getSubtitle(): string; + + /** + * Sets the value of the property. + */ + setSubtitle(subtitle: string): void; + + /** + * Gets the value of the property. + */ + getSubtitleid(): string; + + /** + * Sets the value of the property. + */ + setSubtitleid(subtitleid: string): void; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Sets the value of the property. + */ + setTitle(title: string): void; + + /** + * Gets the value of the property. + */ + getTitleid(): string; + + /** + * Sets the value of the property. + */ + setTitleid(titleid: string): void; + + } + + /** + * Map view is used for embedding native mapping capabilities as a view in your application. + */ + interface View extends Titanium.UI.View { + /** + * An array of annotations to add to the map. + */ + annotations: Titanium.Map.Annotation[]; + + /** + * Hide the annotation when clicking in the map view outside of the annotation. + */ + hideAnnotationWhenTouchMap: boolean; + + /** + * Map type, either: , or . + */ + mapType: number; + + /** + * A dictionary specifying the location and zoom level of the map. + * On the iOS platform, this property can only be set after the map view is loaded. + * To ensure this property is set when the application starts, wait for the + * [complete][Titanium.UI.Map-event-complete] event. + */ + region: MapRegionType; + + /** + * Boolean indicating if the map region should be modified + * to fit the map view's aspect ratio. + */ + regionFit: boolean; + + /** + * Boolean indicating if the user's current device location should be shown on the + * map. + */ + userLocation: boolean; + + /** + * The amount of north-to-south distance displayed on the map, measured in decimal degrees. + */ + readonly latitudeDelta: number; + + /** + * The amount of east-to-west distance displayed on the map, measured in decimal degrees. + */ + readonly longitudeDelta: number; + + /** + * Adds a new annotation to the map. + */ + addAnnotation(annotation: any): void; + + /** + * Adds one or more new annotations to the map. + */ + addAnnotations(annotations: any): void; + + /** + * Adds a route to the map. + */ + addRoute(route: MapRouteType): void; + + /** + * Deselects the specified annotation, so the main annotation is hidden and only + * a pin image is shown. + */ + deselectAnnotation(annotation: string): void; + + /** + * Deselects the specified annotation, so the main annotation is hidden and only + * a pin image is shown. + */ + deselectAnnotation(annotation: Titanium.Map.Annotation): void; + + /** + * Removes all annotations from the map. + */ + removeAllAnnotations(): void; + + /** + * Removes an existing annotation from the map. + */ + removeAnnotation(annotation: string): void; + + /** + * Removes an existing annotation from the map. + */ + removeAnnotation(annotation: Titanium.Map.Annotation): void; + + /** + * Removes one or more existing annotations from the map. + */ + removeAnnotations(annotations: ReadonlyArray): void; + + /** + * Removes one or more existing annotations from the map. + */ + removeAnnotations(annotations: ReadonlyArray): void; + + /** + * Remove a previously added route. + */ + removeRoute(route: MapRouteType): void; + + /** + * Selects the annoation, showing the full annotation. + */ + selectAnnotation(annotation: string): void; + + /** + * Selects the annoation, showing the full annotation. + */ + selectAnnotation(annotation: Titanium.Map.Annotation): void; + + /** + * Sets the map location and zoom level. + */ + setLocation(location: MapLocationType): void; + + /** + * Sets the type of map (satellite, hybrid, or standard). + */ + setMapType(mapType: number): void; + + /** + * Zooms in or out of the map. + */ + zoom(level: number): void; + + /** + * Gets the value of the property. + */ + getAnimate(): boolean; + + /** + * Sets the value of the property. + */ + setAnimate(animate: boolean): void; + + /** + * Gets the value of the property. + */ + getAnnotations(): Titanium.Map.Annotation[]; + + /** + * Sets the value of the property. + */ + setAnnotations(annotations: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getHideAnnotationWhenTouchMap(): boolean; + + /** + * Sets the value of the property. + */ + setHideAnnotationWhenTouchMap(hideAnnotationWhenTouchMap: boolean): void; + + /** + * Gets the value of the property. + */ + getMapType(): number; + + /** + * Sets the value of the property. + */ + setMapType(mapType: number): void; + + /** + * Gets the value of the property. + */ + getRegion(): MapRegionType; + + /** + * Sets the value of the property. + */ + setRegion(region: MapRegionType): void; + + /** + * Gets the value of the property. + */ + getRegionFit(): boolean; + + /** + * Sets the value of the property. + */ + setRegionFit(regionFit: boolean): void; + + /** + * Gets the value of the property. + */ + getUserLocation(): boolean; + + /** + * Sets the value of the property. + */ + setUserLocation(userLocation: boolean): void; + + /** + * Gets the value of the property. + */ + getLatitudeDelta(): number; + + /** + * Gets the value of the property. + */ + getLongitudeDelta(): number; + + } + } - export interface Stream { - MODE_APPEND : number; - MODE_READ : number; - MODE_WRITE : number; - createStream (params: CreateStreamArgs) : Ti.IOStream; - pump (inputStream: Ti.IOStream, handler: (...args : any[]) => any, maxChunkSize: number, isAsync?: boolean) : void; - read (sourceStream: Ti.IOStream, buffer: Ti.Buffer, offset?: number, length?: number, resultsCallback?: (...args : any[]) => any) : void; - readAll (sourceStream: Ti.IOStream, buffer?: Ti.Buffer, resultsCallback?: (...args : any[]) => any) : any; - write (outputStream: Ti.IOStream, buffer: Ti.Buffer, offset?: number, length?: number, resultsCallback?: (...args : any[]) => any) : void; - writeStream (inputStream: Ti.IOStream, outputStream: Ti.IOStream, maxChunkSize: number, resultsCallback?: (...args : any[]) => any) : void; + + /** + * The top-level Media module. + */ + namespace Media { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Audio file format 3GPP2. + */ + const AUDIO_FILEFORMAT_3GP2: number; + + /** + * Audio file format 3GPP. + */ + const AUDIO_FILEFORMAT_3GPP: number; + + /** + * Audio file format Audio Interchange File Format (AIFF). + */ + const AUDIO_FILEFORMAT_AIFF: number; + + /** + * Audio file format Adaptive Multi-Rate (AMR). + */ + const AUDIO_FILEFORMAT_AMR: number; + + /** + * Audio file format Apple Compressed Audio Format (CAF). + */ + const AUDIO_FILEFORMAT_CAF: number; + + /** + * Audio file format MP3. + */ + const AUDIO_FILEFORMAT_MP3: number; + + /** + * Audio file format MP4. + */ + const AUDIO_FILEFORMAT_MP4: number; + + /** + * Audio file format MP4A. + */ + const AUDIO_FILEFORMAT_MP4A: number; + + /** + * Audio file format WAVE. + */ + const AUDIO_FILEFORMAT_WAVE: number; + + /** + * Audio format MPEG4 AAC encoding. + */ + const AUDIO_FORMAT_AAC: number; + + /** + * Audio format 8-bit aLaw encoding. + */ + const AUDIO_FORMAT_ALAW: number; + + /** + * Audio format Apple lossless encoding. + */ + const AUDIO_FORMAT_APPLE_LOSSLESS: number; + + /** + * Audio format iLBC encoding. + */ + const AUDIO_FORMAT_ILBC: number; + + /** + * Audio format Apple IMA4 encoding. + */ + const AUDIO_FORMAT_IMA4: number; + + /** + * Audio format 16-bit, linear PCM encoding. + */ + const AUDIO_FORMAT_LINEAR_PCM: number; + + /** + * Audio format 8-bit muLaw encoding. + */ + const AUDIO_FORMAT_ULAW: number; + + /** + * Line-type constant for headphones. + */ + const AUDIO_HEADPHONES: number; + + /** + * Line-type constant for headphones and microphone. + */ + const AUDIO_HEADPHONES_AND_MIC: number; + + /** + * Line-type constant for headset in/out. + */ + const AUDIO_HEADSET_INOUT: number; + + /** + * Line-type constant for line-out. + */ + const AUDIO_LINEOUT: number; + + /** + * Line-type constant for microphone. + */ + const AUDIO_MICROPHONE: number; + + /** + * Line-type constant indicated mute switch is on. + */ + const AUDIO_MUTED: number; + + /** + * Line-type constant indicating receiver and microphone. + */ + const AUDIO_RECEIVER_AND_MIC: number; + + /** + * For long-duration sounds such as rain, car engine noise, and so on. + */ + const AUDIO_SESSION_CATEGORY_AMBIENT: string; + + /** + * Session mode for playing recorded music or other sounds that are central to the successful use of your application. + */ + const AUDIO_SESSION_CATEGORY_PLAYBACK: string; + + /** + * Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application. + */ + const AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD: string; + + /** + * Session mode for recording audio; it silences playback audio. + */ + const AUDIO_SESSION_CATEGORY_RECORD: string; + + /** + * Session mode for long-duration sounds such as rain, car engine noise, and so on. + */ + const AUDIO_SESSION_CATEGORY_SOLO_AMBIENT: string; + + /** + * For long-duration sounds such as rain, car engine noise, and so on. + */ + const AUDIO_SESSION_MODE_AMBIENT: number; + + /** + * Session mode for playing recorded music or other sounds that are central to the successful use of your application. + */ + const AUDIO_SESSION_MODE_PLAYBACK: number; + + /** + * Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application. + */ + const AUDIO_SESSION_MODE_PLAY_AND_RECORD: number; + + /** + * Session mode for recording audio; it silences playback audio. + */ + const AUDIO_SESSION_MODE_RECORD: number; + + /** + * Session mode for long-duration sounds such as rain, car engine noise, and so on. + */ + const AUDIO_SESSION_MODE_SOLO_AMBIENT: number; + + /** + * Constant that specifies audio should output to the default audio route. See for more information. + */ + const AUDIO_SESSION_OVERRIDE_ROUTE_NONE: number; + + /** + * Constant that specifies audio should output to the speaker. See for more information. + */ + const AUDIO_SESSION_OVERRIDE_ROUTE_SPEAKER: number; + + /** + * Constant for line level input on a dock connector. This is an input port. + */ + const AUDIO_SESSION_PORT_LINEIN: string; + + /** + * Constant for built-in microphone on an iOS device. This is an input port. + */ + const AUDIO_SESSION_PORT_BUILTINMIC: string; + + /** + * Constant for microphone on a wired headset. This is an input port. + */ + const AUDIO_SESSION_PORT_HEADSETMIC: string; + + /** + * Constant for line level output on a dock connector. This is an output port. + */ + const AUDIO_SESSION_PORT_LINEOUT: string; + + /** + * Constant for headphone or headset output. This is an output port. + */ + const AUDIO_SESSION_PORT_HEADPHONES: string; + + /** + * Constant for output on a Bluetooth A2DP device. This is an output port. + */ + const AUDIO_SESSION_PORT_BLUETOOTHA2DP: string; + + /** + * Constant for the speaker you hold to your ear when on a phone call. This is an output port. + */ + const AUDIO_SESSION_PORT_BUILTINRECEIVER: string; + + /** + * Constant for built-in speaker on an iOS device. This is an output port. + */ + const AUDIO_SESSION_PORT_BUILTINSPEAKER: string; + + /** + * Constant for output via High-Definition Multimedia Interface. This is an output port + */ + const AUDIO_SESSION_PORT_HDMI: string; + + /** + * Constant for output on a remote Air Play device. This is an output port. + */ + const AUDIO_SESSION_PORT_AIRPLAY: string; + + /** + * Constant for input or output on a Bluetooth Hands-Free Profile device. This can be both an input and output port. + */ + const AUDIO_SESSION_PORT_BLUETOOTHHFP: string; + + /** + * Constant for input or output on a Universal Serial Bus device. This can be both an input and output port. + */ + const AUDIO_SESSION_PORT_USBAUDIO: string; + + /** + * Constant for output on a Bluetooth Low Energy device. This is an output port. This is available on iOS7 and later. + */ + const AUDIO_SESSION_PORT_BLUETOOTHLE: string; + + /** + * Constant for Input or output via Car Audio. This can be both an input and output port. This is available on iOS7 and later. + */ + const AUDIO_SESSION_PORT_CARAUDIO: string; + + /** + * Line-type constant for speaker output. + */ + const AUDIO_SPEAKER: number; + + /** + * Line-type constant indicating that audio is unavailable. + */ + const AUDIO_UNAVAILABLE: number; + + /** + * Line-type constant indicating that line-type is unknown or not determined. + */ + const AUDIO_UNKNOWN: number; + + /** + * Constant specifying to have the device determine to use the flash or not. + */ + const CAMERA_FLASH_AUTO: number; + + /** + * Constant specifying to never fire the flash. + */ + const CAMERA_FLASH_OFF: number; + + /** + * Constant specifying to always fire the flash. + */ + const CAMERA_FLASH_ON: number; + + /** + * Constant specifying the front camera. + */ + const CAMERA_FRONT: number; + + /** + * Constant indicating the rear camera. + */ + const CAMERA_REAR: number; + + /** + * Constant specifying that app is authorized to use camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_AUTHORIZED: number; + + /** + * Constant specifying that app is denied usage of camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_DENIED: number; + + /** + * Constant specifying that app is restricted from using camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_RESTRICTED: number; + + /** + * Constant specifying that app is not yet authorized to use camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_NOT_DETERMINED: number; + + /** + * Constant specifying that app is not yet authorized to use camera. This is available on iOS7 and later. + */ + const CAMERA_AUTHORIZATION_UNKNOWN: number; + + /** + * Constant for media device busy error. + */ + const DEVICE_BUSY: number; + + /** + * Media type constant for photo media. + */ + const MEDIA_TYPE_PHOTO: string; + + /** + * Media type constant for live photo media. + */ + const MEDIA_TYPE_LIVEPHOTO: string; + + /** + * Media type constant for video media. + */ + const MEDIA_TYPE_VIDEO: string; + + /** + * Music library media containing any type of content. + */ + const MUSIC_MEDIA_TYPE_ALL: number; + + /** + * Music library media containing any type of audio content. + */ + const MUSIC_MEDIA_TYPE_ANY_AUDIO: number; + + /** + * Music library media containing audiobook content. + */ + const MUSIC_MEDIA_TYPE_AUDIOBOOK: number; + + /** + * Music library media containing music content. + */ + const MUSIC_MEDIA_TYPE_MUSIC: number; + + /** + * Music library media containing podcast content. + */ + const MUSIC_MEDIA_TYPE_PODCAST: number; + + /** + * Constant for grouping query results by title. + */ + const MUSIC_MEDIA_GROUP_TITLE: number; + + /** + * Constant for grouping query results by album. + */ + const MUSIC_MEDIA_GROUP_ALBUM: number; + + /** + * Constant for grouping query results by artist. + */ + const MUSIC_MEDIA_GROUP_ARTIST: number; + + /** + * Constant for grouping query results by album and artist. + */ + const MUSIC_MEDIA_GROUP_ALBUM_ARTIST: number; + + /** + * Constant for grouping query results by composer. + */ + const MUSIC_MEDIA_GROUP_COMPOSER: number; + + /** + * Constant for grouping query results by genre. + */ + const MUSIC_MEDIA_GROUP_GENRE: number; + + /** + * Constant for grouping query results by playlist. + */ + const MUSIC_MEDIA_GROUP_PLAYLIST: number; + + /** + * Constant for grouping query results by podcast title. + */ + const MUSIC_MEDIA_GROUP_PODCAST_TITLE: number; + + /** + * Constant for "Repeat All" setting. + */ + const MUSIC_PLAYER_REPEAT_ALL: number; + + /** + * Constant for user's default repeat setting. + */ + const MUSIC_PLAYER_REPEAT_DEFAULT: number; + + /** + * Constant for "No Repeat" setting. + */ + const MUSIC_PLAYER_REPEAT_NONE: number; + + /** + * Constant for "Repeat one item" setting. + */ + const MUSIC_PLAYER_REPEAT_ONE: number; + + /** + * Constant for shuffling complete albums setting. + */ + const MUSIC_PLAYER_SHUFFLE_ALBUMS: number; + + /** + * Constant for user's default shuffle setting. + */ + const MUSIC_PLAYER_SHUFFLE_DEFAULT: number; + + /** + * Constant for "no shuffle" setting. + */ + const MUSIC_PLAYER_SHUFFLE_NONE: number; + + /** + * Constant for shuffling songs setting. + */ + const MUSIC_PLAYER_SHUFFLE_SONGS: number; + + /** + * Constant for interrupted state. + */ + const MUSIC_PLAYER_STATE_INTERRUPTED: number; + + /** + * Constant for paused state. + */ + const MUSIC_PLAYER_STATE_PAUSED: number; + + /** + * Constant for playing state. + */ + const MUSIC_PLAYER_STATE_PLAYING: number; + + /** + * Constant for backward seek state. + */ + const MUSIC_PLAYER_STATE_SEEK_BACKWARD: number; + + /** + * Constant for forward seek state. + */ + const MUSIC_PLAYER_STATE_SEEK_FORWARD: number; + + /** + * Constant for stopped state. + */ + const MUSIC_PLAYER_STATE_STOPPED: number; + + /** + * Constant for media no camera error. + */ + const NO_CAMERA: number; + + /** + * Constant for media no video error. + */ + const NO_VIDEO: number; + + /** + * Media type constant for high-quality video recording. + */ + const QUALITY_HIGH: number; + + /** + * Media type constant for low-quality video recording. + */ + const QUALITY_LOW: number; + + /** + * Media type constant for medium-quality video recording. + */ + const QUALITY_MEDIUM: number; + + /** + * Media type constant for medium-quality video recording. + */ + const QUALITY_640x480: number; + + /** + * Media type constant for medium-quality video recording. + */ + const QUALITY_IFRAME_1280x720: number; + + /** + * Media type constant for medium-quality video recording. + */ + const QUALITY_IFRAME_960x540: number; + + /** + * Constant for unknown media error. + */ + const UNKNOWN_ERROR: number; + + /** + * Constant for default video controls. + */ + const VIDEO_CONTROL_DEFAULT: number; + + /** + * Constant for video controls for an embedded view. + */ + const VIDEO_CONTROL_EMBEDDED: number; + + /** + * Constant for fullscreen video controls. + */ + const VIDEO_CONTROL_FULLSCREEN: number; + + /** + * Constant for video controls hidden. + */ + const VIDEO_CONTROL_HIDDEN: number; + + /** + * Constant for no video controls. + */ + const VIDEO_CONTROL_NONE: number; + + /** + * Constant for video controls volume only. + */ + const VIDEO_CONTROL_VOLUME_ONLY: number; + + /** + * Video playback ended normally. + */ + const VIDEO_FINISH_REASON_PLAYBACK_ENDED: number; + + /** + * Video playback ended abnormally. + */ + const VIDEO_FINISH_REASON_PLAYBACK_ERROR: number; + + /** + * Video playback ended by user action (such as clicking the `Done` button). + */ + const VIDEO_FINISH_REASON_USER_EXITED: number; + + /** + * Indicates that the player can no longer play media items because of an error. + */ + const VIDEO_LOAD_STATE_FAILED: number; + + /** + * Current media is playable. + */ + const VIDEO_LOAD_STATE_PLAYABLE: number; + + /** + * Playback will be automatically started in this state when `autoplay` is true. + */ + const VIDEO_LOAD_STATE_PLAYTHROUGH_OK: number; + + /** + * Playback will be automatically paused in this state, if started. + */ + const VIDEO_LOAD_STATE_STALLED: number; + + /** + * Current load state is not known. + */ + const VIDEO_LOAD_STATE_UNKNOWN: number; + + /** + * A audio type of media in the movie returned by `mediaTypes` property. + */ + const VIDEO_MEDIA_TYPE_AUDIO: number; + + /** + * An unknown type of media in the movie returned by `mediaTypes` property. + */ + const VIDEO_MEDIA_TYPE_NONE: number; + + /** + * A video type of media in the movie returned by `mediaTypes` property. + */ + const VIDEO_MEDIA_TYPE_VIDEO: number; + + /** + * Video playback has been interrupted. + */ + const VIDEO_PLAYBACK_STATE_INTERRUPTED: number; + + /** + * Video playback is paused. + */ + const VIDEO_PLAYBACK_STATE_PAUSED: number; + + /** + * Video is being played. + */ + const VIDEO_PLAYBACK_STATE_PLAYING: number; + + /** + * Video playback is rewinding. + */ + const VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD: number; + + /** + * Video playback is seeking forward. + */ + const VIDEO_PLAYBACK_STATE_SEEKING_FORWARD: number; + + /** + * Video playback is stopped. + */ + const VIDEO_PLAYBACK_STATE_STOPPED: number; + + /** + * Constant for disabling repeat on video playback. + */ + const VIDEO_REPEAT_MODE_NONE: number; + + /** + * Constant for repeating one video (i.e., the one video will repeat constantly) during playback. + */ + const VIDEO_REPEAT_MODE_ONE: number; + + /** + * Scale video to fill the screen, clipping edges if necessary. + */ + const VIDEO_SCALING_ASPECT_FILL: number; + + /** + * Scale video to fit the screen, letterboxing if necessary. + */ + const VIDEO_SCALING_ASPECT_FIT: number; + + /** + * Video is scaled until both dimensions fit the screen exactly, stretching if necessary. + */ + const VIDEO_SCALING_MODE_FILL: number; + + /** + * Video scaling is disabled. + */ + const VIDEO_SCALING_NONE: number; + + /** + * Specifies that the video should be stretched to fill the bounds of layer. + */ + const VIDEO_SCALING_RESIZE: string; + + /** + * Specifies that the player should preserve the aspect ratio of video and fit the video within the bounds of layer. + */ + const VIDEO_SCALING_RESIZE_ASPECT: string; + + /** + * Specifies that the player should preserve the aspect ratio of video and fill the bounds of layer. + */ + const VIDEO_SCALING_RESIZE_ASPECT_FILL: string; + + /** + * Video source type is a file. + */ + const VIDEO_SOURCE_TYPE_FILE: number; + + /** + * Video source type is a remote stream. + */ + const VIDEO_SOURCE_TYPE_STREAMING: number; + + /** + * Video source type is unknown. + */ + const VIDEO_SOURCE_TYPE_UNKNOWN: number; + + /** + * Use the exact time. + */ + const VIDEO_TIME_OPTION_EXACT: number; + + /** + * Use the closest keyframe in the time. + */ + const VIDEO_TIME_OPTION_NEAREST_KEYFRAME: number; + + /** + * Use the closest sync (or key) frame at given the time. + */ + const VIDEO_TIME_OPTION_CLOSEST_SYNC: number; + + /** + * Use the sync (or key) frame located right after or at given the time. + */ + const VIDEO_TIME_OPTION_NEXT_SYNC: number; + + /** + * Use the sync (or key) frame located right before or at given the time. + */ + const VIDEO_TIME_OPTION_PREVIOUS_SYNC: number; + + /** + * An instance of representing the app-specific music player. + */ + const appMusicPlayer: Titanium.Media.MusicPlayer; + + /** + * Returns the line type constant for the current line type. + */ + const audioLineType: number; + + /** + * Returns `true` if the device is playing audio. + */ + const audioPlaying: boolean; + + /** + * A constant for the audio session category to be used. + */ + let audioSessionCategory: number; + + /** + * A constant for the audio session mode to be used. + */ + let audioSessionMode: number; + + /** + * Array indicating which cameras are available, `CAMERA_FRONT`, `CAMERA_REAR` or both. + */ + const availableCameras: number[]; + + /** + * Array of media type constants supported for the camera. + */ + let availableCameraMediaTypes: any[]; + + /** + * Array of media type constants supported for saving to the device's camera roll or saved images album. + */ + let availablePhotoGalleryMediaTypes: any[]; + + /** + * Array of media type constants supported for the photo library. + */ + let availablePhotoMediaTypes: any[]; + + /** + * Current average microphone level in dB or -1 if microphone monitoring is disabled. + */ + let averageMicrophonePower: number; + + /** + * Determines how the flash is fired when using the device's camera. + */ + let cameraFlashMode: number; + + /** + * `true` if the device has a recording input device available. + */ + const canRecord: boolean; + + /** + * Returns a description of the current route, consisting of zero or more input ports and zero or more output ports. + */ + const currentRoute: RouteDescription; + + /** + * `true` if the device has camera support. + */ + const isCameraSupported: boolean; + + /** + * Returns the authorization status for the camera. + */ + const cameraAuthorizationStatus: number; + + /** + * Returns the authorization status for the camera. + */ + const cameraAuthorization: number; + + /** + * Current microphone level peak power in dB or -1 if microphone monitoring is disabled. + */ + const peakMicrophonePower: number; + + /** + * An instance of representing the system-wide music player. + */ + const systemMusicPlayer: Titanium.Media.MusicPlayer; + + /** + * Current volume of the playback device. + */ + const volume: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Plays a device beep notification. + */ + function beep(): void; + + /** + * Hides the device camera UI. + */ + function hideCamera(): void; + + /** + * Hides the music library. + */ + function hideMusicLibrary(): void; + + /** + * Returns `true` if the source supports the specified media type. + */ + function isMediaTypeSupported(source: string, type: string): boolean; + + /** + * Shows the music library and allows the user to select one or more tracks. + */ + function openMusicLibrary(options: MusicLibraryOptionsType): void; + + /** + * Opens the photo gallery image picker. + */ + function openPhotoGallery(options: PhotoGalleryOptionsType): void; + + /** + * Displays the given image. + */ + function previewImage(options: any): void; + + /** + * Saves media to the device's photo gallery / camera roll. + */ + function saveToPhotoGallery(media: Titanium.Blob, callbacks: any): void; + + /** + * Saves media to the device's photo gallery / camera roll. + */ + function saveToPhotoGallery(media: Titanium.Filesystem.File, callbacks: any): void; + + /** + * Overrides the default audio route when using the session mode. + */ + function setOverrideAudioRoute(route: number): void; + + /** + * Shows the camera. + */ + function showCamera(options: CameraOptionsType): void; + + /** + * Returns `true` if the app has camera access. + */ + function hasMusicLibraryPermissions(): boolean; + + /** + * Request permissions for the native music-library. + */ + function requestMusicLibraryPermissions(callback: (param0: RequestMusicLibraryAccessResult) => any): void; + + /** + * Searches the music library for items matching the specified search predicates. + */ + function queryMusicLibrary(query: MediaQueryType): Titanium.Media.Item[]; + + /** + * Starts monitoring the microphone sound level. + */ + function startMicrophoneMonitor(): void; + + /** + * Stops monitoring the microphone sound level. + */ + function stopMicrophoneMonitor(): void; + + /** + * Uses the device camera to capture a photo. + */ + function takePicture(): void; + + /** + * Starts video capture using the camera specified. + */ + function startVideoCapture(): void; + + /** + * Stops video capture using the camera specified. + */ + function stopVideoCapture(): void; + + /** + * Switches between front and rear-facing cameras. Make sure to set one of the below constants to determine + * the camera you want to switch to. + */ + function switchCamera(camera: number): void; + + /** + * Returns `true` if the app has camera access. + */ + function hasCameraPermissions(): boolean; + + /** + * Requests for camera access. + */ + function requestCameraPermissions(callback: (param0: RequestCameraAccessResult) => any): void; + + /** + * Returns `true` if the app has photo gallery permissions. + */ + function hasPhotoGalleryPermissions(): boolean; + + /** + * Requests for photo gallery permissions. + */ + function requestPhotoGalleryPermissions(callback: (param0: RequestPhotoGalleryAccessResult) => any): void; + + /** + * Requests for camera access. + */ + function requestCameraAccess(callback: (param0: RequestCameraAccessResult) => any): void; + + /** + * Takes a screen shot of the visible UI on the device. + */ + function takeScreenshot(callback: (param0: ScreenshotResult) => any): void; + + /** + * Makes the device vibrate. + */ + function vibrate(pattern?: ReadonlyArray): void; + + /** + * Request the user's permission for audio recording. + */ + function requestAuthorization(callback: (param0: MediaAuthorizationResponse) => any): void; + + /** + * Returns `true` if the app has audio permissions. + */ + function hasAudioPermissions(): boolean; + + /** + * Returns `true` if the app has audio permissions. + */ + function hasAudioRecorderPermissions(): boolean; + + /** + * Request the user's permission for audio recording. + */ + function requestAudioPermissions(callback: (param0: MediaAuthorizationResponse) => any): void; + + /** + * Request the user's permission for audio recording. + */ + function requestAudioRecorderPermissions(callback: (param0: MediaAuthorizationResponse) => any): void; + + /** + * Creates and returns an instance of . + */ + function createAudioPlayer(parameters?: any): Titanium.Media.AudioPlayer; + + /** + * Creates and returns an instance of . + */ + function createAudioRecorder(parameters?: any): Titanium.Media.AudioRecorder; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getQUALITY_640x480(): number; + + /** + * Gets the value of the property. + */ + function getQUALITY_IFRAME_1280x720(): number; + + /** + * Gets the value of the property. + */ + function getQUALITY_IFRAME_960x540(): number; + + /** + * Gets the value of the property. + */ + function getAppMusicPlayer(): Titanium.Media.MusicPlayer; + + /** + * Gets the value of the property. + */ + function getAudioLineType(): number; + + /** + * Gets the value of the property. + */ + function getAudioPlaying(): boolean; + + /** + * Gets the value of the property. + */ + function getAudioSessionCategory(): number; + + /** + * Sets the value of the property. + */ + function setAudioSessionCategory(audioSessionCategory: number): void; + + /** + * Gets the value of the property. + */ + function getAudioSessionMode(): number; + + /** + * Sets the value of the property. + */ + function setAudioSessionMode(audioSessionMode: number): void; + + /** + * Gets the value of the property. + */ + function getAvailableCameras(): number[]; + + /** + * Gets the value of the property. + */ + function getAvailableCameraMediaTypes(): any[]; + + /** + * Sets the value of the property. + */ + function setAvailableCameraMediaTypes(availableCameraMediaTypes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + function getAvailablePhotoGalleryMediaTypes(): any[]; + + /** + * Sets the value of the property. + */ + function setAvailablePhotoGalleryMediaTypes(availablePhotoGalleryMediaTypes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + function getAvailablePhotoMediaTypes(): any[]; + + /** + * Sets the value of the property. + */ + function setAvailablePhotoMediaTypes(availablePhotoMediaTypes: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + function getAverageMicrophonePower(): number; + + /** + * Sets the value of the property. + */ + function setAverageMicrophonePower(averageMicrophonePower: number): void; + + /** + * Gets the value of the property. + */ + function getCameraFlashMode(): number; + + /** + * Sets the value of the property. + */ + function setCameraFlashMode(cameraFlashMode: number): void; + + /** + * Gets the value of the property. + */ + function getCanRecord(): boolean; + + /** + * Gets the value of the property. + */ + function getCurrentRoute(): RouteDescription; + + /** + * Gets the value of the property. + */ + function getIsCameraSupported(): boolean; + + /** + * Gets the value of the property. + */ + function getCameraAuthorizationStatus(): number; + + /** + * Gets the value of the property. + */ + function getCameraAuthorization(): number; + + /** + * Gets the value of the property. + */ + function getPeakMicrophonePower(): number; + + /** + * Gets the value of the property. + */ + function getSystemMusicPlayer(): Titanium.Media.MusicPlayer; + + /** + * Gets the value of the property. + */ + function getVolume(): number; + + /** + * Creates and returns an instance of . + */ + function createSound(parameters?: any): Titanium.Media.Sound; + + /** + * Creates and returns an instance of . + */ + function createSystemAlert(parameters?: any): Titanium.Media.SystemAlert; + + /** + * Creates and returns an instance of . + */ + function createVideoPlayer(parameters?: any): Titanium.Media.VideoPlayer; + + /** + * An audio player object used for streaming audio to the device, and low-level control of the audio playback. + */ + interface AudioPlayer extends Titanium.Proxy { + /** + * Audio data is being buffered from the network. + */ + readonly STATE_BUFFERING: number; + + /** + * Audio playback is being initialized. + */ + readonly STATE_INITIALIZED: number; + + /** + * Playback is paused. + */ + readonly STATE_PAUSED: number; + + /** + * Audio playback is active. + */ + readonly STATE_PLAYING: number; + + /** + * Audio playback is starting. + */ + readonly STATE_STARTING: number; + + /** + * Audio playback is stopped. + */ + readonly STATE_STOPPED: number; + + /** + * Audio playback is stopping. + */ + readonly STATE_STOPPING: number; + + /** + * Player is waiting for audio data from the network. + */ + readonly STATE_WAITING_FOR_DATA: number; + + /** + * Player is waiting for audio data to fill the queue. + */ + readonly STATE_WAITING_FOR_QUEUE: number; + + /** + * Used to identify the volume of audio streams for alarms. + */ + readonly AUDIO_TYPE_ALARM: number; + + /** + * Used to identify the volume of audio streams for DTMF tones or beeps. + */ + readonly AUDIO_TYPE_SIGNALLING: number; + + /** + * Used to identify the volume of audio streams for media playback. + */ + readonly AUDIO_TYPE_MEDIA: number; + + /** + * Used to identify the volume of audio streams for notifications. + */ + readonly AUDIO_TYPE_NOTIFICATION: number; + + /** + * Used to identify the volume of audio streams for the phone ring. + */ + readonly AUDIO_TYPE_RING: number; + + /** + * Used to identify the volume of audio streams for voice calls. + */ + readonly AUDIO_TYPE_VOICE: number; + + /** + * Boolean to indicate if audio should continue playing even if the associated + * Android [Activity](Titanium.Android.Activity) is paused. + */ + allowBackground: boolean; + + /** + * Focuses on the current audio player and stops other audio playing. + */ + audioFocus: boolean; + + /** + * Changes the audio-stream-type. + */ + audioType: number; + + /** + * Bit rate of the current playback stream. + */ + bitRate: number; + + /** + * Estimated duration in milliseconds of the file being played. + */ + readonly duration: number; + + /** + * Boolean indicating if the player is idle. + */ + readonly idle: boolean; + + /** + * Boolean indicating if audio playback is paused. + */ + paused: boolean; + + /** + * Boolean indicating if audio is currently playing. + */ + readonly playing: boolean; + + /** + * Current playback progress, in milliseconds. + */ + readonly progress: number; + + /** + * Current state of playback, specified using one of the `STATE` constants defined on this object. + */ + readonly state: number; + + /** + * URL for the audio stream. + */ + url: string; + + /** + * Volume of the audio, from 0.0 (muted) to 1.0 (loudest). + */ + volume: number; + + /** + * Boolean indicating if the playback is waiting for audio data from the network. + */ + readonly waiting: boolean; + + /** + * Size of the buffer used for streaming, in bytes. + */ + bufferSize: number; + + /** + * Current playback position of the audio. + */ + time: number; + + /** + * Returns the value of the [paused](Titanium.Media.AudioPlayer.paused) property. + */ + getPaused(): boolean; + + /** + * Returns the value of the [paused](Titanium.Media.AudioPlayer.paused) property. + */ + isPaused(): boolean; + + /** + * Returns the value of the [playing](Titanium.Media.AudioPlayer.playing) property. + */ + getPlaying(): boolean; + + /** + * Returns the value of the [playing](Titanium.Media.AudioPlayer.playing) property. + */ + isPlaying(): boolean; + + /** + * Pauses audio playback. + */ + pause(): void; + + /** + * Starts or resumes audio playback. + */ + play(): void; + + /** + * Sets the value of the [paused](Titanium.Media.AudioPlayer.paused) property. + */ + setPaused(paused: boolean): void; + + /** + * Stops buffering audio data and releases audio resources. + */ + release(): void; + + /** + * Returns the audio session id. + */ + getAudioSessionId(): number; + + /** + * Starts or resumes audio playback. + */ + start(): void; + + /** + * Converts a [state](Titanium.Media.AudioPlayer.state) value into a text description + * suitable for display. + */ + stateDescription(state: number): string; + + /** + * Stops audio playback. + */ + stop(): void; + + /** + * Gets the value of the property. + */ + getAllowBackground(): boolean; + + /** + * Sets the value of the property. + */ + setAllowBackground(allowBackground: boolean): void; + + /** + * Gets the value of the property. + */ + getAudioFocus(): boolean; + + /** + * Sets the value of the property. + */ + setAudioFocus(audioFocus: boolean): void; + + /** + * Gets the value of the property. + */ + getAudioType(): number; + + /** + * Sets the value of the property. + */ + setAudioType(audioType: number): void; + + /** + * Gets the value of the property. + */ + getBitRate(): number; + + /** + * Sets the value of the property. + */ + setBitRate(bitRate: number): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Gets the value of the property. + */ + getIdle(): boolean; + + /** + * Gets the value of the property. + */ + getPaused(): boolean; + + /** + * Sets the value of the property. + */ + setPaused(paused: boolean): void; + + /** + * Gets the value of the property. + */ + getPlaying(): boolean; + + /** + * Gets the value of the property. + */ + getProgress(): number; + + /** + * Gets the value of the property. + */ + getState(): number; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getVolume(): number; + + /** + * Sets the value of the property. + */ + setVolume(volume: number): void; + + /** + * Gets the value of the property. + */ + getWaiting(): boolean; + + /** + * Gets the value of the property. + */ + getBufferSize(): number; + + /** + * Sets the value of the property. + */ + setBufferSize(bufferSize: number): void; + + /** + * Gets the value of the property. + */ + getTime(): number; + + /** + * Sets the value of the property. + */ + setTime(time: number): void; + + } + + /** + * An audio recorder object used for recording audio from the device microphone. + */ + interface AudioRecorder extends Titanium.Proxy { + /** + * Audio compression to be used for the recording. + */ + compression: number; + + /** + * Audio format to be used for the recording. + */ + format: number; + + /** + * Indicates if the audio recorder is paused. + */ + readonly paused: boolean; + + /** + * Indicates if the audio recorder is recording. + */ + readonly recording: boolean; + + /** + * Indicates if the audio recorder is stopped. + */ + readonly stopped: boolean; + + /** + * Pauses the current audio recording. + */ + pause(): void; + + /** + * Resumes a paused recording. + */ + resume(): void; + + /** + * Starts an audio recording. + */ + start(): void; + + /** + * Stops the current audio recording and returns the recorded audio file. + */ + stop(): Titanium.Filesystem.File; + + /** + * Gets the value of the property. + */ + getCompression(): number; + + /** + * Sets the value of the property. + */ + setCompression(compression: number): void; + + /** + * Gets the value of the property. + */ + getFormat(): number; + + /** + * Sets the value of the property. + */ + setFormat(format: number): void; + + /** + * Gets the value of the property. + */ + getPaused(): boolean; + + /** + * Gets the value of the property. + */ + getRecording(): boolean; + + /** + * Gets the value of the property. + */ + getStopped(): boolean; + + } + + /** + * A representation of a media item returned by [openMusicLibrary](Titanium.Media.openMusicLibrary) or [queryMusicLibrary](Titanium.Media.queryMusicLibrary). + */ + interface Item extends Titanium.Proxy { + /** + * Artist credited for the album containing this item. + */ + readonly albumArtist: string; + + /** + * The persistent identifier for an album artist. + */ + readonly albumArtistPersistentID: number; + + /** + * The key for the persistent identifier for an album. + */ + readonly albumPersistentID: number; + + /** + * Title of the album containing this item. + */ + readonly albumTitle: string; + + /** + * Number of tracks for the album containing this item. + */ + readonly albumTrackCount: number; + + /** + * Track number for this item. + */ + readonly albumTrackNumber: number; + + /** + * Artist credited for this item. + */ + readonly artist: string; + + /** + * Image for the item's artwork as a `Blob` object, or `null` if no artwork is + * available. + */ + readonly artwork: Titanium.Blob; + + /** + * A URL pointing to the media item. + */ + readonly assetURL: string; + + /** + * The number of musical beats per minute for the media item, corresponding + * to the "BPM" field in the Info tab in the "Get Info" dialog in iTunes. + */ + readonly beatsPerMinute: number; + + /** + * The user's place in the media item the most recent time it was played. + */ + readonly bookmarkTime: string; + + /** + * Textual information about the media item, corresponding to the "Comments" + * field in in the Info tab in the Get Info dialog in iTunes. + */ + readonly comments: string; + + /** + * Composer of this item. + */ + readonly composer: string; + + /** + * Date when the item was added to the music library. + */ + readonly dateAdded: Date; + + /** + * Total number of discs for the album containing this item. + */ + readonly discCount: number; + + /** + * Disc number for this item in the album. + */ + readonly discNumber: number; + + /** + * Genre of this item. + */ + readonly genre: string; + + /** + * The persistent identifier for a genre. + */ + readonly genrePersistentID: number; + + /** + * True if the item represents a protected asset. + */ + readonly hasProtectedAsset: boolean; + + /** + * True if the media item is an iCloud item. + */ + readonly isCloudItem: boolean; + + /** + * True if this item is part of a compilation album. + */ + readonly isCompilation: boolean; + + /** + * True if this item is marked as "Explicit". + */ + readonly isExplicit: boolean; + + /** + * The most recent calendar date on which the user played the media item. + */ + readonly lastPlayedDate: Date; + + /** + * Lyrics for this item. + */ + readonly lyrics: string; + + /** + * The type of the media. + */ + readonly mediaType: number; + + /** + * The key for the persistent identifier for the media item. + */ + readonly persistentID: string; + + /** + * Number of times the item has been played. + */ + readonly playCount: number; + + /** + * Length (in seconds) of this item. + */ + readonly playbackDuration: number; + + /** + * Used to enqueue store tracks by their ID. + */ + readonly playbackStoreID: number; + + /** + * Title of a podcast item. + */ + readonly podcastTitle: string; + + /** + * The persistent identifier for an audio podcast. + */ + readonly podcastPersistentID: number; + + /** + * Rating for this item. + */ + readonly rating: number; + + /** + * Date when this this item was released. + */ + readonly releaseDate: Date; + + /** + * Number of times this item has been skipped. + */ + readonly skipCount: number; + + /** + * Title of this item. + */ + readonly title: string; + + /** + * Corresponds to the "Grouping" field in the Info tab in the "Get Info" + * dialog in iTunes. + */ + readonly userGrouping: string; + + /** + * Gets the value of the property. + */ + getAlbumArtist(): string; + + /** + * Gets the value of the property. + */ + getAlbumArtistPersistentID(): number; + + /** + * Gets the value of the property. + */ + getAlbumPersistentID(): number; + + /** + * Gets the value of the property. + */ + getAlbumTitle(): string; + + /** + * Gets the value of the property. + */ + getAlbumTrackCount(): number; + + /** + * Gets the value of the property. + */ + getAlbumTrackNumber(): number; + + /** + * Gets the value of the property. + */ + getArtist(): string; + + /** + * Gets the value of the property. + */ + getArtwork(): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getAssetURL(): string; + + /** + * Gets the value of the property. + */ + getBeatsPerMinute(): number; + + /** + * Gets the value of the property. + */ + getBookmarkTime(): string; + + /** + * Gets the value of the property. + */ + getComments(): string; + + /** + * Gets the value of the property. + */ + getComposer(): string; + + /** + * Gets the value of the property. + */ + getDateAdded(): Date; + + /** + * Gets the value of the property. + */ + getDiscCount(): number; + + /** + * Gets the value of the property. + */ + getDiscNumber(): number; + + /** + * Gets the value of the property. + */ + getGenre(): string; + + /** + * Gets the value of the property. + */ + getGenrePersistentID(): number; + + /** + * Gets the value of the property. + */ + getHasProtectedAsset(): boolean; + + /** + * Gets the value of the property. + */ + getIsCloudItem(): boolean; + + /** + * Gets the value of the property. + */ + getIsCompilation(): boolean; + + /** + * Gets the value of the property. + */ + getIsExplicit(): boolean; + + /** + * Gets the value of the property. + */ + getLastPlayedDate(): Date; + + /** + * Gets the value of the property. + */ + getLyrics(): string; + + /** + * Gets the value of the property. + */ + getMediaType(): number; + + /** + * Gets the value of the property. + */ + getPersistentID(): string; + + /** + * Gets the value of the property. + */ + getPlayCount(): number; + + /** + * Gets the value of the property. + */ + getPlaybackDuration(): number; + + /** + * Gets the value of the property. + */ + getPlaybackStoreID(): number; + + /** + * Gets the value of the property. + */ + getPodcastTitle(): string; + + /** + * Gets the value of the property. + */ + getPodcastPersistentID(): number; + + /** + * Gets the value of the property. + */ + getRating(): number; + + /** + * Gets the value of the property. + */ + getReleaseDate(): Date; + + /** + * Gets the value of the property. + */ + getSkipCount(): number; + + /** + * Gets the value of the property. + */ + getTitle(): string; + + /** + * Gets the value of the property. + */ + getUserGrouping(): string; + + } + + /** + * This object represents a music controller. + */ + interface MusicPlayer extends Titanium.Proxy { + /** + * Current point in song playback, in seconds. + */ + currentPlaybackTime: number; + + /** + * An `Item` object representing the currently playing media item. + */ + readonly nowPlaying: Titanium.Media.Item; + + /** + * Playback state. + */ + readonly playbackState: number; + + /** + * Repeat setting. + */ + repeatMode: number; + + /** + * Shuffle setting. + */ + shuffleMode: number; + + /** + * Volume level for the music player from 0.0 (muted) to 1.0 (loudest). + */ + volume: number; + + /** + * Pauses playback of the current media item. + */ + pause(): void; + + /** + * Begins playback of the current media item. + */ + play(): void; + + /** + * Begins seeking backward in the currently playing media. + */ + seekBackward(): void; + + /** + * Begins seeking forward in the currently playing media item. + */ + seekForward(): void; + + /** + * Sets the media queue. + */ + setQueue(queue: Titanium.Media.Item): void; + + /** + * Sets the media queue. + */ + setQueue(queue: ReadonlyArray): void; + + /** + * Sets the media queue. + */ + setQueue(queue: string): void; + + /** + * Skips to the beginning of the currently playing media item. + */ + skipToBeginning(): void; + + /** + * Skips to the next media item in the queue. + */ + skipToNext(): void; + + /** + * Skips to the previous media item in the queue. + */ + skipToPrevious(): void; + + /** + * Stops playback of the current media queue. + */ + stop(): void; + + /** + * Ends a seek operation and returns to the previous playback state. + * See also: [seekForward](Titanium.Media.MusicPlayer.seekForward) and + * [seekBackward](Titanium.Media.MusicPlayer.seekBackward). + */ + stopSeeking(): void; + + /** + * Gets the value of the property. + */ + getCurrentPlaybackTime(): number; + + /** + * Sets the value of the property. + */ + setCurrentPlaybackTime(currentPlaybackTime: number): void; + + /** + * Gets the value of the property. + */ + getNowPlaying(): Titanium.Media.Item; + + /** + * Gets the value of the property. + */ + getPlaybackState(): number; + + /** + * Gets the value of the property. + */ + getRepeatMode(): number; + + /** + * Sets the value of the property. + */ + setRepeatMode(repeatMode: number): void; + + /** + * Gets the value of the property. + */ + getShuffleMode(): number; + + /** + * Sets the value of the property. + */ + setShuffleMode(shuffleMode: number): void; + + /** + * Gets the value of the property. + */ + getVolume(): number; + + /** + * Sets the value of the property. + */ + setVolume(volume: number): void; + + } + + /** + * An object for playing basic audio resources. + */ + interface Sound extends Titanium.Proxy { + /** + * Audio data is being buffered from the network. + */ + readonly STATE_BUFFERING: number; + + /** + * Audio playback is being initialized. + */ + readonly STATE_INITIALIZED: number; + + /** + * Playback is paused. + */ + readonly STATE_PAUSED: number; + + /** + * Audio playback is active. + */ + readonly STATE_PLAYING: number; + + /** + * Audio playback is starting. + */ + readonly STATE_STARTING: number; + + /** + * Audio playback is stopped. + */ + readonly STATE_STOPPED: number; + + /** + * Audio playback is stopping. + */ + readonly STATE_STOPPING: number; + + /** + * Player is waiting for audio data from the network. + */ + readonly STATE_WAITING_FOR_DATA: number; + + /** + * Player is waiting for audio data to fill the queue. + */ + readonly STATE_WAITING_FOR_QUEUE: number; + + /** + * Used to identify the volume of audio streams for alarms. + */ + readonly AUDIO_TYPE_ALARM: number; + + /** + * Used to identify the volume of audio streams for DTMF tones or beeps. + */ + readonly AUDIO_TYPE_SIGNALLING: number; + + /** + * Used to identify the volume of audio streams for media playback. + */ + readonly AUDIO_TYPE_MEDIA: number; + + /** + * Used to identify the volume of audio streams for notifications. + */ + readonly AUDIO_TYPE_NOTIFICATION: number; + + /** + * Used to identify the volume of audio streams for the phone ring. + */ + readonly AUDIO_TYPE_RING: number; + + /** + * Used to identify the volume of audio streams for voice calls. + */ + readonly AUDIO_TYPE_VOICE: number; + + /** + * Determines whether the audio should continue playing even when its activity is paused. + */ + allowBackground: boolean; + + /** + * Changes the audio-stream-type. + */ + audioType: number; + + /** + * Duration of the audio resource. + */ + readonly duration: number; + + /** + * Determines whether the audio should loop upon completion. + */ + looping: boolean; + + /** + * Indicates if the audio is paused. + */ + paused: boolean; + + /** + * Indicates if the audio is playing. + */ + readonly playing: boolean; + + /** + * Current playback position of the audio. + */ + time: number; + + /** + * URL identifying the audio resource. + */ + url: string; + + /** + * Volume of the audio from 0.0 (muted) to 1.0 (loudest). + */ + volume: number; + + /** + * Returns the value of the [looping](Titanium.Media.Sound.looping) property. + */ + isLooping(): boolean; + + /** + * Returns the value of the [paused](Titanium.Media.Sound.paused) property. + */ + isPaused(): boolean; + + /** + * Returns the value of the [playing](Titanium.Media.Sound.playing) property. + */ + isPlaying(): boolean; + + /** + * Pauses the audio. + */ + pause(): void; + + /** + * Starting playing the sound, or resume playing a paused sound. + */ + play(): void; + + /** + * Releases all internal resources. + */ + release(): void; + + /** + * Resets the audio playback position to the beginning. + */ + reset(): void; + + /** + * Sets the value of the [looping](Titanium.Media.Sound.looping) property. + */ + setLooping(looping: boolean): void; + + /** + * Sets the value of the [paused](Titanium.Media.Sound.paused) property. + */ + setPaused(paused: boolean): void; + + /** + * Stops playing the audio and resets the playback position to the beginning of the clip. + */ + stop(): void; + + /** + * Gets the value of the property. + */ + getAudioType(): number; + + /** + * Sets the value of the property. + */ + setAudioType(audioType: number): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Gets the value of the property. + */ + getTime(): number; + + /** + * Sets the value of the property. + */ + setTime(time: number): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Gets the value of the property. + */ + getVolume(): number; + + /** + * Sets the value of the property. + */ + setVolume(volume: number): void; + + } + + /** + * An object for playing system sounds. + */ + interface SystemAlert extends Titanium.Proxy { + /** + * URL identifying the audio resource. + */ + url: string; + + /** + * Start playing the system alert. + */ + play(): void; + + /** + * Gets the value of the property. + */ + getUrl(): string; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + } + + /** + * A native control for playing videos. + */ + interface VideoPlayer extends Titanium.UI.View { + /** + * Whether or not the current movie can be played on a remote device. + */ + allowsAirPlay: boolean; + + /** + * Indicates if a movie should automatically start playback. + */ + autoplay: boolean; + + /** + * Sets the background view for customization which is always displayed behind movie content. + */ + backgroundView: Titanium.UI.View; + + /** + * URL of the media to play. + */ + contentURL: string; + + /** + * Current playback time of the current movie in milliseconds. + */ + currentPlaybackTime: number; + + /** + * The duration of the current movie in milliseconds, or 0.0 if not known. + */ + duration: number; + + /** + * The end time of movie playback, in milliseconds. + */ + endPlaybackTime: number; + + /** + * Determines if the movie is presented in the entire screen (obscuring all other application content). + */ + fullscreen: boolean; + + /** + * The start time of movie playback, in milliseconds. + */ + initialPlaybackTime: number; + + /** + * Returns the network load state of the movie player. + */ + readonly loadState: number; + + /** + * Media object to play, as either a `File`, a `Blob`, or a URL. + */ + media: Titanium.Blob | Titanium.Filesystem.File | string; + + /** + * The style of the playback controls. + */ + mediaControlStyle: number; + + /** + * The types of media in the movie, or if not known. + */ + mediaTypes: number; + + /** + * Style of the media playback controls. + */ + movieControlMode: number; + + /** + * Returns the status of the movie player. + */ + readonly moviePlayerStatus: number; + + /** + * Returns the natural size of the movie. + */ + naturalSize: MovieSize; + + /** + * Use the overlay view to add additional custom views between the video content and the controls. + */ + overlayView: Titanium.UI.View; + + /** + * Whether or not the receiver allows Picture in Picture playback. + */ + pictureInPictureEnabled: boolean; + + /** + * Currently playable duration of the movie, in milliseconds, for progressively + * downloaded network content, or 0.0 if not known. + */ + readonly playableDuration: number; + + /** + * Current playback state of the video player. + */ + readonly playbackState: number; + + /** + * Boolean to indicate if the player has started playing. + */ + readonly playing: boolean; + + /** + * Determines how the movie player repeats when reaching the end of playback. + */ + repeatMode: number; + + /** + * Determines how the content scales to fit the view. + */ + scalingMode: number; + + /** + * Whether or not the receiver shows playback controls. Default is YES. + */ + showsControls: boolean; + + /** + * The playback type of the movie. + */ + sourceType: number; + + /** + * URL of the media to play. + */ + url: string | string[]; + + /** + * Indicates if the movie player should inherit the application's audio session + * instead of creating a new session. + */ + useApplicationAudioSession: boolean; + + /** + * Volume of the audio portion of the video. + */ + volume: number; + + /** + * Cancels all pending asynchronous thumbnail requests. + */ + cancelAllThumbnailImageRequests(): void; + + /** + * Pauses playing the video. + */ + pause(): void; + + /** + * Starts playing the video. + */ + play(): void; + + /** + * Releases the internal video resources immediately. + */ + release(): void; + + /** + * Asynchronously request thumbnail images for one or more points in time in the video. + */ + requestThumbnailImagesAtTimes(times: ReadonlyArray, option: number, callback: (param0: ThumbnailResponse) => any): void; + + /** + * Stops playing the video. + */ + stop(): void; + + /** + * Returns a thumbnail image for the video at the specified time. + */ + thumbnailImageAtTime(time: number, option: number): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getAllowsAirPlay(): boolean; + + /** + * Sets the value of the property. + */ + setAllowsAirPlay(allowsAirPlay: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoplay(): boolean; + + /** + * Sets the value of the property. + */ + setAutoplay(autoplay: boolean): void; + + /** + * Gets the value of the property. + */ + getBackgroundView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setBackgroundView(backgroundView: any): void; + + /** + * Gets the value of the property. + */ + getContentURL(): string; + + /** + * Sets the value of the property. + */ + setContentURL(contentURL: string): void; + + /** + * Gets the value of the property. + */ + getCurrentPlaybackTime(): number; + + /** + * Sets the value of the property. + */ + setCurrentPlaybackTime(currentPlaybackTime: number): void; + + /** + * Gets the value of the property. + */ + getDuration(): number; + + /** + * Sets the value of the property. + */ + setDuration(duration: number): void; + + /** + * Gets the value of the property. + */ + getEndPlaybackTime(): number; + + /** + * Sets the value of the property. + */ + setEndPlaybackTime(endPlaybackTime: number): void; + + /** + * Gets the value of the property. + */ + getFullscreen(): boolean; + + /** + * Sets the value of the property. + */ + setFullscreen(fullscreen: boolean): void; + + /** + * Gets the value of the property. + */ + getInitialPlaybackTime(): number; + + /** + * Sets the value of the property. + */ + setInitialPlaybackTime(initialPlaybackTime: number): void; + + /** + * Gets the value of the property. + */ + getLoadState(): number; + + /** + * Sets the value of the property. + */ + setMedia(media: Titanium.Blob): void; + + /** + * Sets the value of the property. + */ + setMedia(media: Titanium.Filesystem.File): void; + + /** + * Sets the value of the property. + */ + setMedia(media: string): void; + + /** + * Gets the value of the property. + */ + getMediaControlStyle(): number; + + /** + * Sets the value of the property. + */ + setMediaControlStyle(mediaControlStyle: number): void; + + /** + * Gets the value of the property. + */ + getMediaTypes(): number; + + /** + * Sets the value of the property. + */ + setMediaTypes(mediaTypes: number): void; + + /** + * Gets the value of the property. + */ + getMovieControlMode(): number; + + /** + * Sets the value of the property. + */ + setMovieControlMode(movieControlMode: number): void; + + /** + * Gets the value of the property. + */ + getMoviePlayerStatus(): number; + + /** + * Gets the value of the property. + */ + getNaturalSize(): MovieSize; + + /** + * Sets the value of the property. + */ + setNaturalSize(naturalSize: MovieSize): void; + + /** + * Gets the value of the property. + */ + getOverlayView(): Titanium.UI.View; + + /** + * Sets the value of the property. + */ + setOverlayView(overlayView: any): void; + + /** + * Gets the value of the property. + */ + getPictureInPictureEnabled(): boolean; + + /** + * Sets the value of the property. + */ + setPictureInPictureEnabled(pictureInPictureEnabled: boolean): void; + + /** + * Gets the value of the property. + */ + getPlayableDuration(): number; + + /** + * Gets the value of the property. + */ + getPlaybackState(): number; + + /** + * Gets the value of the property. + */ + getPlaying(): boolean; + + /** + * Gets the value of the property. + */ + getRepeatMode(): number; + + /** + * Sets the value of the property. + */ + setRepeatMode(repeatMode: number): void; + + /** + * Gets the value of the property. + */ + getScalingMode(): number; + + /** + * Sets the value of the property. + */ + setScalingMode(scalingMode: number): void; + + /** + * Gets the value of the property. + */ + getShowsControls(): boolean; + + /** + * Sets the value of the property. + */ + setShowsControls(showsControls: boolean): void; + + /** + * Gets the value of the property. + */ + getSourceType(): number; + + /** + * Sets the value of the property. + */ + setSourceType(sourceType: number): void; + + /** + * Gets the value of the property. + */ + getUrl(): string | string[]; + + /** + * Sets the value of the property. + */ + setUrl(url: string): void; + + /** + * Sets the value of the property. + */ + setUrl(url: ReadonlyArray): void; + + /** + * Gets the value of the property. + */ + getUseApplicationAudioSession(): boolean; + + /** + * Sets the value of the property. + */ + setUseApplicationAudioSession(useApplicationAudioSession: boolean): void; + + /** + * Gets the value of the property. + */ + getVolume(): number; + + /** + * Sets the value of the property. + */ + setVolume(volume: number): void; + + } + + + /** + * Android-specific media-related functionality. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Scans newly created or downloaded media files to make them available to other + * Android media providers, such as the Gallery. + */ + function scanMediaFiles(paths: ReadonlyArray, mimeTypes: ReadonlyArray, callback: (param0: MediaScannerResponse) => any): void; + + /** + * Set the system homescreen wallpaper. + */ + function setSystemWallpaper(image: Titanium.Blob, scale: boolean): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + } + + /** + * The top level network module. + */ + namespace Network { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Special hostname value for listening sockets, representing all + * locally available network interfaces. + */ + const INADDR_ANY: string; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that the device is + * communicating over a local-area network. + */ + const NETWORK_LAN: number; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that the device is + * communicating over a mobile network. + */ + const NETWORK_MOBILE: number; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that no + * network is available. + */ + const NETWORK_NONE: number; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that the + * current network type is unknown. + */ + const NETWORK_UNKNOWN: number; + + /** + * A [networkType](Titanium.Network.networkType) value indicating that the + * device is communicating over a WiFi network. + */ + const NETWORK_WIFI: number; + + /** + * Constant value for an Alert style push notification. + */ + const NOTIFICATION_TYPE_ALERT: number; + + /** + * Constant value for a Badge style push notification. + */ + const NOTIFICATION_TYPE_BADGE: number; + + /** + * Constant value for a Sound style push notification. + */ + const NOTIFICATION_TYPE_SOUND: number; + + /** + * Constant value for a Newsstand style push notification. Only available on iOS5 and later + */ + const NOTIFICATION_TYPE_NEWSSTAND: number; + + /** + * Constant value specifying read-only mode for sockets. + */ + const READ_MODE: number; + + /** + * Constant value specifying read-write mode for sockets. + */ + const READ_WRITE_MODE: number; + + /** + * Constant value representing a socket in the CLOSED state. + */ + const SOCKET_CLOSED: number; + + /** + * Constant value representing a socket in the CONNECTED state. + */ + const SOCKET_CONNECTED: number; + + /** + * Constant value representing a socket in the ERROR state. + */ + const SOCKET_ERROR: number; + + /** + * Constant value representing a socket in the INITIALIZED state. + */ + const SOCKET_INITIALIZED: number; + + /** + * Constant value representing a socket in the LISTENING state. + */ + const SOCKET_LISTENING: number; + + /** + * Constant value specifying write-only mode for sockets. + */ + const WRITE_MODE: number; + + /** + * Constant value specifying TLS version 1.0 for SSL. + */ + const TLS_VERSION_1_0: number; + + /** + * Constant value specifying TLS version 1.1 for SSL. + */ + const TLS_VERSION_1_1: number; + + /** + * Constant value specifying TLS version 1.2 for SSL. + */ + const TLS_VERSION_1_2: number; + + /** + * Constant value specifying that the progress of a download can not be calculated. + */ + const PROGRESS_UNKNOWN: number; + + /** + * A list of all cookies in the cookie storage. + */ + const allHTTPCookies: Titanium.Network.Cookie[]; + + /** + * Network type value as a constant. + */ + const networkType: number; + + /** + * Network type as a String. Returns one of `NONE`, `WIFI`, `LAN`, `MOBILE`, or `UNKNOWN`. + */ + const networkTypeName: string; + + /** + * Boolean value indicating if the device can reach the Internet. + */ + const online: boolean; + + /** + * Remote device UUID if the device is registered with the Apple Push Notification + * Service, or null if it is not registered. + */ + const remoteDeviceUUID: string; + + /** + * Array of push notification type constants enabled for the application. + */ + const remoteNotificationTypes: number[]; + + /** + * Indicates whether push notifications have been enabled using + * [registerForPushNotifications](Titanium.Network.registerForPushNotifications). + */ + const remoteNotificationsEnabled: boolean; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Legacy method to add a connectivity listener to listen for network changes. + */ + function addConnectivityListener(callback: (param0: any) => any): void; + + /** + * Adds a cookie to the HTTP client cookie store. + */ + function addHTTPCookie(cookie: Titanium.Network.Cookie): void; + + /** + * Adds a cookie to the system cookie store. + */ + function addSystemCookie(cookie: Titanium.Network.Cookie): void; + + /** + * Creates and returns a `BonjourBrowser` object. + */ + function createBonjourBrowser(serviceType: string, domain: string, parameters?: any): Titanium.Network.BonjourBrowser; + + /** + * Creates and returns a `BonjourService` object. + */ + function createBonjourService(name: string, type: string, domain: string, parameters?: any): Titanium.Network.BonjourService; + + /** + * Legacy method to create and return an instance of . + */ + function createTCPSocket(hostName: string, port: number, mode: number, parameters: any): Titanium.Network.TCPSocket; + + /** + * Returns a decoded version of a URI encoded value. + */ + function decodeURIComponent(value: string): string; + + /** + * Returns a URI encoded version of the specified URI component. + */ + function encodeURIComponent(value: string): string; + + /** + * Gets all the cookies with the domain, path and name matched with the given values from the HTTP client cookie store. + */ + function getHTTPCookies(domain: string, path: string, name: string): Titanium.Network.Cookie[]; + + /** + * Gets all the cookies with the domain matched with the given values from the HTTP client cookie store. + */ + function getHTTPCookiesForDomain(domain: string): Titanium.Network.Cookie[]; + + /** + * Gets all the cookies with the domain, path and name matched with the given values from the system cookie store. + */ + function getSystemCookies(domain: string, path: string, name: string): Titanium.Network.Cookie[]; + + /** + * Removes all the cookies from the HTTP client cookie store. + */ + function removeAllHTTPCookies(): void; + + /** + * Removes all the cookie from the system client cookie store. + */ + function removeAllSystemCookies(): void; + + /** + * Removes the cookie with the domain, path and name exactly the same as the given values from the HTTP client cookie store. + */ + function removeHTTPCookie(domain: string, path: string, name: string): void; + + /** + * Removes the cookies with the domain matched with the given values from the HTTP client cookie store. + */ + function removeHTTPCookiesForDomain(domain: string): void; + + /** + * Removes the cookie with the domain, path and name exactly the same as the given values from the system cookie store. + */ + function removeSystemCookie(domain: string, path: string, name: string): void; + + /** + * Registers for push notifications with the Apple Push Notification Service. + */ + function registerForPushNotifications(config: PushNotificationConfig): void; + + /** + * Legacy method to remove a connectivity listener. + */ + function removeConnectivityListener(callback: (param0: any) => any): void; + + /** + * Unregisters the application for push notifications. + */ + function unregisterForPushNotifications(): void; + + /** + * Creates and returns an instance of . + */ + function createCookie(parameters?: any): Titanium.Network.Cookie; + + /** + * Creates and returns an instance of . + */ + function createHTTPClient(parameters?: any): Titanium.Network.HTTPClient; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAllHTTPCookies(): Titanium.Network.Cookie[]; + + /** + * Gets the value of the property. + */ + function getNetworkType(): number; + + /** + * Gets the value of the property. + */ + function getNetworkTypeName(): string; + + /** + * Gets the value of the property. + */ + function getOnline(): boolean; + + /** + * Gets the value of the property. + */ + function getRemoteDeviceUUID(): string; + + /** + * Gets the value of the property. + */ + function getRemoteNotificationTypes(): number[]; + + /** + * Gets the value of the property. + */ + function getRemoteNotificationsEnabled(): boolean; + + /** + * A browser for the discovery and retrieval of Bonjour services available on the network. + */ + interface BonjourBrowser extends Titanium.Proxy { + /** + * The domain the browser is searching in + */ + domain: string; + + /** + * Whether or not the browser is currently searching + */ + isSearching: boolean; + + /** + * The type of the service the browser searches for + */ + serviceType: string; + + /** + * Conduct a search for Bonjour services matching the type and domain specified during creation + */ + search(): void; + + /** + * Halt an ongoing search + */ + stopSearch(): void; + + /** + * Gets the value of the property. + */ + getDomain(): string; + + /** + * Sets the value of the property. + */ + setDomain(domain: string): void; + + /** + * Gets the value of the property. + */ + getIsSearching(): boolean; + + /** + * Sets the value of the property. + */ + setIsSearching(isSearching: boolean): void; + + /** + * Gets the value of the property. + */ + getServiceType(): string; + + /** + * Sets the value of the property. + */ + setServiceType(serviceType: string): void; + + } + + /** + * Describes a service on the network which is published by Bonjour. + */ + interface BonjourService extends Titanium.Proxy { + /** + * the domain of the service + */ + domain: string; + + /** + * whether or not the service is local to the device + */ + isLocal: boolean; + + /** + * the name of the service + */ + name: string; + + /** + * the TCPSocket object that is used to connect to the service + */ + socket: any; + + /** + * the type of the service + */ + type: string; + + /** + * Publish a Bonjour service to the network. Only works if isLocal is TRUE + */ + publish(socket: any): void; + + /** + * Resolve a Bonjour service from the network. Must be done before attempting to access the service's socket information, if a remote service. You cannot resolve a locally published service. + */ + resolve(timeout: number): void; + + /** + * Halts publication of a service. + */ + stop(): void; + + /** + * Gets the value of the property. + */ + getDomain(): string; + + /** + * Sets the value of the property. + */ + setDomain(domain: string): void; + + /** + * Gets the value of the property. + */ + getIsLocal(): boolean; + + /** + * Sets the value of the property. + */ + setIsLocal(isLocal: boolean): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Sets the value of the property. + */ + setName(name: string): void; + + /** + * Gets the value of the property. + */ + getSocket(): any; + + /** + * Sets the value of the property. + */ + setSocket(socket: any): void; + + /** + * Gets the value of the property. + */ + getType(): string; + + /** + * Sets the value of the property. + */ + setType(type: string): void; + + } + + /** + * Cookie object used to manage the system cookie store and HTTP client cookie store. + */ + interface Cookie extends Titanium.Proxy { + /** + * The comment describing the purpose of this cookie + */ + comment: string; + + /** + * The domain attribute of the cookie. + */ + domain: string; + + /** + * The expiration Date of the cookie. + */ + expiryDate: string; + + /** + * Sets the Max-Age attribute of a Cookie, in delta-seconds. + */ + maxAge: number; + + /** + * The httponly attribute of the cookie. + */ + httponly: boolean; + + /** + * The name of the cookie. + */ + readonly name: string; + + /** + * The origual url attribute of the cookie. + */ + originalUrl: string; + + /** + * The path attribute of the cookie. + */ + path: string; + + /** + * The secure attribute of the cookie. + */ + secure: boolean; + + /** + * The value of the cookie. + */ + value: string; + + /** + * The version of the cookie specification to which this cookie conforms. + */ + version: number; + + /** + * Returns true if the cookie is valid. + */ + isValid(): boolean; + + /** + * Gets the value of the property. + */ + getComment(): string; + + /** + * Sets the value of the property. + */ + setComment(comment: string): void; + + /** + * Gets the value of the property. + */ + getDomain(): string; + + /** + * Sets the value of the property. + */ + setDomain(domain: string): void; + + /** + * Gets the value of the property. + */ + getExpiryDate(): string; + + /** + * Sets the value of the property. + */ + setExpiryDate(expiryDate: string): void; + + /** + * Gets the value of the property. + */ + getMaxAge(): number; + + /** + * Sets the value of the property. + */ + setMaxAge(maxAge: number): void; + + /** + * Gets the value of the property. + */ + getHttponly(): boolean; + + /** + * Sets the value of the property. + */ + setHttponly(httponly: boolean): void; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getOriginalUrl(): string; + + /** + * Sets the value of the property. + */ + setOriginalUrl(originalUrl: string): void; + + /** + * Gets the value of the property. + */ + getPath(): string; + + /** + * Sets the value of the property. + */ + setPath(path: string): void; + + /** + * Gets the value of the property. + */ + getSecure(): boolean; + + /** + * Sets the value of the property. + */ + setSecure(secure: boolean): void; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + /** + * Gets the value of the property. + */ + getVersion(): number; + + /** + * Sets the value of the property. + */ + setVersion(version: number): void; + + } + + /** + * HTTP client object that (mostly) implements the XMLHttpRequest specification. + */ + interface HTTPClient extends Titanium.Proxy { + /** + * Ready state constant indicating that the request is complete. + */ + readonly DONE: number; + + /** + * Ready state constant indicating that response headers have been received. + */ + readonly HEADERS_RECEIVED: number; + + /** + * Ready state constant indicating that response data is being received from the remote server. + */ + readonly LOADING: number; + + /** + * Ready state constant indicating that the connection has been opened, but the request has + * not yet been sent. + */ + readonly OPENED: number; + + /** + * Ready state constant indicating that HTTPClient request has not been opened or sent. + */ + readonly UNSENT: number; + + /** + * All of the response headers. + */ + readonly allResponseHeaders: string; + + /** + * Returns all the response headers returned with the request. + */ + readonly responseHeaders: any; + + /** + * Determines whether automatic encoding is enabled for the specified URL. + */ + autoEncodeUrl: boolean; + + /** + * Determines whether automatic automatic handling of HTTP redirects is enabled. + */ + autoRedirect: boolean; + + /** + * Indicates whether the response was successful. + */ + readonly connected: boolean; + + /** + * Connection type, normally either `GET`, `POST` or `PATCH`. + */ + readonly connectionType: string; + + /** + * Sets the domain parameter for authentication credentials. + */ + domain: string; + + /** + * Determines whether the client should attempt to keep a persistent connection. + */ + enableKeepAlive: boolean; + + /** + * Target local file to receive data. + */ + file: string; + + /** + * Absolute URL of the request. + */ + readonly location: string; + + /** + * Function to be called at regular intervals as the request data is being received. + */ + ondatastream: (param0: any) => any; + + /** + * Function to be called upon a error response. + */ + onerror: (param0: FailureResponse) => any; + + /** + * Function to be called upon a successful response. + */ + onload: (param0: SuccessResponse) => any; + + /** + * Function to be called for each [readyState](Titanium.Network.HTTPClient.readyState) change. + */ + onreadystatechange: (param0: any) => any; + + /** + * Function to be called at regular intervals as the request data is being transmitted. + */ + onsendstream: (param0: any) => any; + + /** + * Sets the password parameter for authentication credentials. + */ + password: string; + + /** + * The current ready state of this HTTP request. + */ + readonly readyState: number; + + /** + * Response data as a `Blob` object. + */ + readonly responseData: Titanium.Blob; + + /** + * Response as text. + */ + readonly responseText: string; + + /** + * Response object as an XML DOM Document object. + */ + readonly responseXML: Titanium.XML.Document; + + /** + * The Security Manager for this client. + */ + securityManager: SecurityManagerProtocol; + + /** + * Response HTTP status code. + */ + readonly status: number; + + /** + * Human-readable status message associated with the status code. + */ + readonly statusText: string; + + /** + * Timeout in milliseconds when the connection should be aborted. + */ + timeout: number; + + /** + * Sets the username parameter for authentication credentials. + */ + username: string; + + /** + * Determines how SSL certification validation is performed on connection. + */ + validatesSecureCertificate: boolean; + + /** + * Sets the TLS version to use for handshakes. + */ + tlsVersion: number; + + /** + * Determines whether HTTP responses are cached. + */ + cache: boolean; + + /** + * Cancels a pending request. + */ + abort(): void; + + /** + * Registers a new AuthSchemeFactory for a given scheme. + */ + addAuthFactory(scheme: string, factory: any): void; + + /** + * Adds a custom key manager. + */ + addKeyManager(X509KeyManager: any): void; + + /** + * Adds a custom trust manager. + */ + addTrustManager(X509TrustManager: any): void; + + /** + * Clears any cookies stored for the host. + */ + clearCookies(host: string): void; + + /** + * Returns the value of the specified response header. + */ + getResponseHeader(name: string): string; + + /** + * Opens the request and prepares the connection. + */ + open(method: string, url: string, async?: boolean): void; + + /** + * Sends the request. + */ + send(data?: any): void; + + /** + * Sends the request. + */ + send(data?: string): void; + + /** + * Sends the request. + */ + send(data?: Titanium.Filesystem.File): void; + + /** + * Sends the request. + */ + send(data?: Titanium.Blob): void; + + /** + * Sets the value for the specified request header. Must be called after `open` but before `send`. + */ + setRequestHeader(name: string, value: string): void; + + /** + * Sets the request timeout. + */ + setTimeout(timeout: number): void; + + /** + * Gets the value of the property. + */ + getAllResponseHeaders(): string; + + /** + * Gets the value of the property. + */ + getResponseHeaders(): any; + + /** + * Gets the value of the property. + */ + getAutoEncodeUrl(): boolean; + + /** + * Sets the value of the property. + */ + setAutoEncodeUrl(autoEncodeUrl: boolean): void; + + /** + * Gets the value of the property. + */ + getAutoRedirect(): boolean; + + /** + * Sets the value of the property. + */ + setAutoRedirect(autoRedirect: boolean): void; + + /** + * Gets the value of the property. + */ + getConnected(): boolean; + + /** + * Gets the value of the property. + */ + getConnectionType(): string; + + /** + * Gets the value of the property. + */ + getDomain(): string; + + /** + * Sets the value of the property. + */ + setDomain(domain: string): void; + + /** + * Gets the value of the property. + */ + getEnableKeepAlive(): boolean; + + /** + * Sets the value of the property. + */ + setEnableKeepAlive(enableKeepAlive: boolean): void; + + /** + * Gets the value of the property. + */ + getFile(): string; + + /** + * Sets the value of the property. + */ + setFile(file: string): void; + + /** + * Gets the value of the property. + */ + getLocation(): string; + + /** + * Gets the value of the property. + */ + getOndatastream(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOndatastream(ondatastream: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnerror(): (param0: FailureResponse) => any; + + /** + * Sets the value of the property. + */ + setOnerror(onerror: (param0: FailureResponse) => any): void; + + /** + * Gets the value of the property. + */ + getOnload(): (param0: SuccessResponse) => any; + + /** + * Sets the value of the property. + */ + setOnload(onload: (param0: SuccessResponse) => any): void; + + /** + * Gets the value of the property. + */ + getOnreadystatechange(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnreadystatechange(onreadystatechange: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getOnsendstream(): (param0: any) => any; + + /** + * Sets the value of the property. + */ + setOnsendstream(onsendstream: (param0: any) => any): void; + + /** + * Gets the value of the property. + */ + getPassword(): string; + + /** + * Sets the value of the property. + */ + setPassword(password: string): void; + + /** + * Gets the value of the property. + */ + getReadyState(): number; + + /** + * Gets the value of the property. + */ + getResponseData(): Titanium.Blob; + + /** + * Gets the value of the property. + */ + getResponseText(): string; + + /** + * Gets the value of the property. + */ + getResponseXML(): Titanium.XML.Document; + + /** + * Gets the value of the property. + */ + getSecurityManager(): SecurityManagerProtocol; + + /** + * Sets the value of the property. + */ + setSecurityManager(securityManager: SecurityManagerProtocol): void; + + /** + * Gets the value of the property. + */ + getStatus(): number; + + /** + * Gets the value of the property. + */ + getStatusText(): string; + + /** + * Gets the value of the property. + */ + getTimeout(): number; + + /** + * Sets the value of the property. + */ + setTimeout(timeout: number): void; + + /** + * Gets the value of the property. + */ + getUsername(): string; + + /** + * Sets the value of the property. + */ + setUsername(username: string): void; + + /** + * Gets the value of the property. + */ + getValidatesSecureCertificate(): boolean; + + /** + * Sets the value of the property. + */ + setValidatesSecureCertificate(validatesSecureCertificate: boolean): void; + + /** + * Gets the value of the property. + */ + getTlsVersion(): number; + + /** + * Sets the value of the property. + */ + setTlsVersion(tlsVersion: number): void; + + /** + * Gets the value of the property. + */ + getCache(): boolean; + + /** + * Sets the value of the property. + */ + setCache(cache: boolean): void; + + } + + /** + * The TCPSocket instance returned from . This object + * represents a socket which either listens locally on the device for connections, + * or connects to a remote machine. + */ + interface TCPSocket extends Titanium.Proxy { + /** + * the host name to connect to. Must be or an identifier for the local device in order to listen + */ + hostName: string; + + /** + * whether or not the socket is valid + */ + isValid: boolean; + + /** + * the socket's mode + */ + mode: number; + + /** + * the port to connect/listen on + */ + port: number; + + /** + * strip terminating null character when sending string data; default is false + */ + stripTerminator: boolean; + + /** + * close the socket + */ + close(): void; + + /** + * connect the scocket to a TCP server + */ + connect(): void; + + /** + * set up the socket to receive connections + */ + listen(): void; + + /** + * write data to the socket, if the mode is WRITE_MODE or READ_WRITE_MODE + */ + write(data: any, sendTo: number): void; + + /** + * write data to the socket, if the mode is WRITE_MODE or READ_WRITE_MODE + */ + write(data: string, sendTo: number): void; + + /** + * Gets the value of the property. + */ + getHostName(): string; + + /** + * Sets the value of the property. + */ + setHostName(hostName: string): void; + + /** + * Gets the value of the property. + */ + getIsValid(): boolean; + + /** + * Sets the value of the property. + */ + setIsValid(isValid: boolean): void; + + /** + * Gets the value of the property. + */ + getMode(): number; + + /** + * Sets the value of the property. + */ + setMode(mode: number): void; + + /** + * Gets the value of the property. + */ + getPort(): number; + + /** + * Sets the value of the property. + */ + setPort(port: number): void; + + /** + * Gets the value of the property. + */ + getStripTerminator(): boolean; + + /** + * Sets the value of the property. + */ + setStripTerminator(stripTerminator: boolean): void; + + } + + + /** + * Socket module, used for creating sockets. + */ + namespace Socket { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * State value representing an initialized socket. + */ + const INITIALIZED: number; + + /** + * State value representing a connected socket. + */ + const CONNECTED: number; + + /** + * State value representing a socket that is listening for connections. + */ + const LISTENING: number; + + /** + * State value representing a closed socket. + */ + const CLOSED: number; + + /** + * State value indicating an error has occurred on the socket. + */ + const ERROR: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns a new TCP socket object. + */ + function createTCP(params?: any): Titanium.Network.Socket.TCP; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * TCP socket that implements the `Titanium.IOStream` interface. + */ + interface TCP extends Titanium.Proxy { + /** + * The host to connect to or listen on. + */ + host: string; + + /** + * The port to connect to or listen on. + */ + port: number; + + /** + * Max number of pending incoming connections to be allowed when the socket is in the [LISTENING](Titanium.Network.Socket.LISTENING) state. + */ + listenQueueSize: number; + + /** + * Timeout, in milliseconds, for `connect` and all `write` operations. + */ + timeout: number; + + /** + * Callback to be fired when the socket enters the "connected" state. + */ + connected: (param0: ConnectedCallbackArgs) => any; + + /** + * Callback to be fired when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state. + */ + error: (param0: ErrorCallbackArgs) => any; + + /** + * Callback to be fired when a listener accepts a connection. + */ + accepted: (param0: AcceptedCallbackArgs) => any; + + /** + * Current state of the socket. + */ + readonly state: number; + + /** + * Reads data from this stream into a buffer. + */ + read(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Writes data from a buffer to this stream. + */ + write(buffer: Titanium.Buffer, offset?: number, length?: number): number; + + /** + * Indicates whether this stream is writable. + */ + isWritable(): boolean; + + /** + * Indicates whether this stream is readable. + */ + isReadable(): boolean; + + /** + * Closes a socket. + */ + close(): void; + + /** + * Attempts to connect the socket to its host/port. + */ + connect(): void; + + /** + * Attempts to start listening on the socket's host/port. + */ + listen(): void; + + /** + * Tells a [LISTENING](Titanium.Network.Socket.LISTENING) socket to accept a connection request at the top of a listener's request queue when one becomes available. + */ + accept(options: AcceptDict): void; + + /** + * Gets the value of the property. + */ + getHost(): string; + + /** + * Sets the value of the property. + */ + setHost(host: string): void; + + /** + * Gets the value of the property. + */ + getPort(): number; + + /** + * Sets the value of the property. + */ + setPort(port: number): void; + + /** + * Gets the value of the property. + */ + getListenQueueSize(): number; + + /** + * Sets the value of the property. + */ + setListenQueueSize(listenQueueSize: number): void; + + /** + * Gets the value of the property. + */ + getTimeout(): number; + + /** + * Sets the value of the property. + */ + setTimeout(timeout: number): void; + + /** + * Gets the value of the property. + */ + getConnected(): (param0: ConnectedCallbackArgs) => any; + + /** + * Sets the value of the property. + */ + setConnected(connected: (param0: ConnectedCallbackArgs) => any): void; + + /** + * Gets the value of the property. + */ + getError(): (param0: ErrorCallbackArgs) => any; + + /** + * Sets the value of the property. + */ + setError(error: (param0: ErrorCallbackArgs) => any): void; + + /** + * Gets the value of the property. + */ + getAccepted(): (param0: AcceptedCallbackArgs) => any; + + /** + * Sets the value of the property. + */ + setAccepted(accepted: (param0: AcceptedCallbackArgs) => any): void; + + /** + * Gets the value of the property. + */ + getState(): number; + + } + + } + } + + /** + * The top-level Platform module. The Platform module is used to access the device's platform-related + * functionality. + */ + namespace Platform { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Constant to indicate that the system is plugged in and currently being charged. + */ + const BATTERY_STATE_CHARGING: number; + + /** + * Constant to indicate that the battery is fully charged. + */ + const BATTERY_STATE_FULL: number; + + /** + * Constant to indicate that the battery state is not known or monitoring is disabled. + */ + const BATTERY_STATE_UNKNOWN: number; + + /** + * Constant to indicate that the system is unplugged. + */ + const BATTERY_STATE_UNPLUGGED: number; + + /** + * System's WIFI IP address. No other network types are supported. + */ + const address: string; + + /** + * System's processor architecture. + */ + const architecture: string; + + /** + * System's unused memory, measured in megabytes on iOS and bytes on Android. + */ + const availableMemory: number; + + /** + * Battery level in percent, accessible only when `batteryMonitoring` is enabled. Measured + * in 5% increments on iPhone/iPad. + */ + const batteryLevel: number; + + /** + * Determines whether battery monitoring is enabled. + */ + let batteryMonitoring: boolean; + + /** + * Indicates the state of the battery. Accessible only when `batteryMonitoring` is enabled. + */ + const batteryState: number; + + /** + * Returns the DisplayCaps object. + */ + const displayCaps: Titanium.Platform.DisplayCaps; + + /** + * Applications's globally-unique ID (UUID). + */ + const id: string; + + /** + * An alphanumeric string that uniquely identifies a device to the app's vendor. + */ + const identifierForVendor: string; + + /** + * An alphanumeric string unique to each device, used only for serving advertisements. + */ + let identifierForAdvertising: string; + + /** + * A Boolean value that indicates whether the user has limited ad tracking. + */ + const isAdvertisingTrackingEnabled: boolean; + + /** + * System's default language. + */ + const locale: string; + + /** + * System's network interface mac address, or app UUID. + */ + const macaddress: string; + + /** + * Manufacturer of the device. + */ + const manufacturer: string; + + /** + * Model of the device. + */ + const model: string; + + /** + * Name of the platform. Returns `android` for the Android platform, `iPhone OS` for the iOS + * platform (iPhone, iPad, or iPod Touch), and `windows` for the Windows platform. + * Since iOS 10 this property returns `iOS` for for the iOS platform (iPhone, iPad, or iPod Touch). + */ + const name: string; + + /** + * System's WIFI network mask. No other network types are supported. + */ + const netmask: string; + + /** + * Short name of the system's Operating System. Returns `android` for the Android platfrom, + * `iphone` for the iPhone or iPod Touch, `ipad` for the iPad, `windowsphone` for Windows Phone, and `windowsstore` for Windows Store + * platform. + */ + const osname: string; + + /** + * Operating System architecture. On Android, this is `32bit`. + */ + const ostype: string; + + /** + * Number of processing cores. + */ + const processorCount: number; + + /** + * Short name of the JavaScript runtime in use. + */ + const runtime: string; + + /** + * System name, if set. On iOS, this can be found in Settings > General > About > Name. + */ + const username: string; + + /** + * System's OS version. + */ + const version: string; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns whether the system is configured with a default application to handle the URL's protocol. + */ + function canOpenURL(url: string): boolean; + + /** + * Creates a globally-unique identifier. + */ + function createUUID(): string; + + /** + * Opens this URL using the system's default application for its protocol. + */ + function openURL(url: string): boolean; + + /** + * Returns whether the system settings are configured to show times in 24-hour format. + */ + function is24HourTimeFormat(): boolean; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getAddress(): string; + + /** + * Gets the value of the property. + */ + function getArchitecture(): string; + + /** + * Gets the value of the property. + */ + function getAvailableMemory(): number; + + /** + * Gets the value of the property. + */ + function getBatteryLevel(): number; + + /** + * Gets the value of the property. + */ + function getBatteryMonitoring(): boolean; + + /** + * Sets the value of the property. + */ + function setBatteryMonitoring(batteryMonitoring: boolean): void; + + /** + * Gets the value of the property. + */ + function getBatteryState(): number; + + /** + * Gets the value of the property. + */ + function getDisplayCaps(): Titanium.Platform.DisplayCaps; + + /** + * Gets the value of the property. + */ + function getId(): string; + + /** + * Gets the value of the property. + */ + function getIdentifierForVendor(): string; + + /** + * Gets the value of the property. + */ + function getIdentifierForAdvertising(): string; + + /** + * Sets the value of the property. + */ + function setIdentifierForAdvertising(identifierForAdvertising: string): void; + + /** + * Gets the value of the property. + */ + function getIsAdvertisingTrackingEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getLocale(): string; + + /** + * Gets the value of the property. + */ + function getMacaddress(): string; + + /** + * Gets the value of the property. + */ + function getManufacturer(): string; + + /** + * Gets the value of the property. + */ + function getModel(): string; + + /** + * Gets the value of the property. + */ + function getName(): string; + + /** + * Gets the value of the property. + */ + function getNetmask(): string; + + /** + * Gets the value of the property. + */ + function getOsname(): string; + + /** + * Gets the value of the property. + */ + function getOstype(): string; + + /** + * Gets the value of the property. + */ + function getProcessorCount(): number; + + /** + * Gets the value of the property. + */ + function getRuntime(): string; + + /** + * Gets the value of the property. + */ + function getUsername(): string; + + /** + * Gets the value of the property. + */ + function getVersion(): string; + + /** + * The Display Caps object returned by the property. + */ + interface DisplayCaps extends Titanium.Proxy { + /** + * Logical density of the display. + */ + readonly density: string; + + /** + * Display density expressed as dots-per-inch. + */ + readonly dpi: number; + + /** + * Logical density of the display, as a scaling factor for the Density Independent Pixel (dip) + * unit. + */ + readonly logicalDensityFactor: number; + + /** + * Absolute height of the display in relation to UI orientation. Measured in platform-specific + * units; pixels on Android and density-independent pixels (dip) on iOS. + */ + readonly platformHeight: number; + + /** + * Absolute width of the display in relation to UI orientation. Measured in platform-specific + * units; pixels on Android and density-independent pixels (dip) on iOS. + */ + readonly platformWidth: number; + + /** + * Physical pixels per inch of the display in the X dimension. + */ + readonly xdpi: number; + + /** + * Physical pixels per inch of the display in the Y dimension. + */ + readonly ydpi: number; + + /** + * Gets the value of the property. + */ + getDensity(): string; + + /** + * Gets the value of the property. + */ + getDpi(): number; + + /** + * Gets the value of the property. + */ + getLogicalDensityFactor(): number; + + /** + * Gets the value of the property. + */ + getPlatformHeight(): number; + + /** + * Gets the value of the property. + */ + getPlatformWidth(): number; + + /** + * Gets the value of the property. + */ + getXdpi(): number; + + /** + * Gets the value of the property. + */ + getYdpi(): number; + + } + + + /** + * The Android-specific Platform module, used to access the device's platform-related functionality. + */ + namespace Android { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Android API level identifier of the Operating System. + */ + const API_LEVEL: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is large + */ + const PHYSICAL_SIZE_CATEGORY_LARGE: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is normal + */ + const PHYSICAL_SIZE_CATEGORY_NORMAL: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is small + */ + const PHYSICAL_SIZE_CATEGORY_SMALL: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is undefined + */ + const PHYSICAL_SIZE_CATEGORY_UNDEFINED: number; + + /** + * Constant to indicate that the physical size category of the current device/emulator is extra large + */ + const PHYSICAL_SIZE_CATEGORY_XLARGE: number; + + /** + * The physical size category of the Android device or emulator. + */ + const physicalSizeCategory: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Gets the value of the property. + */ + function getPhysicalSizeCategory(): number; + + } + } + + /** + * Stream module containing stream utility methods. + */ + namespace Stream { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Use with [createStream](Titanium.Stream.createStream) to open a stream in read + * mode. + */ + const MODE_READ: number; + + /** + * Use with [createStream](Titanium.Stream.createStream) to open a stream in write + * mode. + */ + const MODE_WRITE: number; + + /** + * Use with [createStream](Titanium.Stream.createStream) to open a stream in append + * mode. + */ + const MODE_APPEND: number; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Creates stream from a `Buffer` or `Blob` object. + */ + function createStream(params: CreateStreamArgs): Titanium.IOStream; + + /** + * Asynchronously reads data from an [IOStream](Titanium.IOStream) into a buffer. + */ + function read(sourceStream: Titanium.IOStream, buffer: Titanium.Buffer, offset?: number, length?: number, resultsCallback?: (param0: ReadCallbackArgs) => any): void; + + /** + * Reads all data from the specified [IOStream](Titanium.IOStream). + */ + function readAll(sourceStream: Titanium.IOStream, buffer?: Titanium.Buffer, resultsCallback?: (param0: ReadCallbackArgs) => any): Titanium.Buffer | void; + + /** + * Asynchronously writes data from a buffer to an [IOStream](Titanium.IOStream). + */ + function write(outputStream: Titanium.IOStream, buffer: Titanium.Buffer, offset?: number, length?: number, resultsCallback?: (param0: WriteCallbackArgs) => any): void; + + /** + * Writes all data from an input stream to an output stream. + */ + function writeStream(inputStream: Titanium.IOStream, outputStream: Titanium.IOStream, maxChunkSize: number, resultsCallback?: (param0: WriteStreamCallbackArgs) => any): void; + + /** + * Reads data from input stream and passes it to a handler method. + */ + function pump(inputStream: Titanium.IOStream, handler: (param0: PumpCallbackArgs) => any, maxChunkSize: number, isAsync?: boolean): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * The top-level Utils module, containing a set of JavaScript methods that are often useful when + * building applications. + */ + namespace Utils { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Returns the specified data decoded from Base64. + */ + function base64decode(obj: string): Titanium.Blob; + + /** + * Returns the specified data decoded from Base64. + */ + function base64decode(obj: Titanium.Blob): Titanium.Blob; + + /** + * Returns the specified data decoded from Base64. + */ + function base64decode(obj: Titanium.Filesystem.File): Titanium.Blob; + + /** + * Returns the specified data encoded to Base64. + */ + function base64encode(obj: string): Titanium.Blob; + + /** + * Returns the specified data encoded to Base64. + */ + function base64encode(obj: Titanium.Blob): Titanium.Blob; + + /** + * Returns the specified data encoded to Base64. + */ + function base64encode(obj: Titanium.Filesystem.File): Titanium.Blob; + + /** + * Returns a MD5 digest of the specified data as a hex-based String. + */ + function md5HexDigest(obj: string): string; + + /** + * Returns a MD5 digest of the specified data as a hex-based String. + */ + function md5HexDigest(obj: Titanium.Blob): string; + + /** + * Returns a SHA-1 hash of the specified data as a hex-based String. + */ + function sha1(obj: string): string; + + /** + * Returns a SHA-1 hash of the specified data as a hex-based String. + */ + function sha1(obj: Titanium.Blob): string; + + /** + * Returns a SHA-256 hash of the specified data as a hex-based String. + */ + function sha256(obj: string): string; + + /** + * Returns a SHA-256 hash of the specified data as a hex-based String. + */ + function sha256(obj: Titanium.Blob): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + } + + /** + * Used to enable data and file transfers between a watchOS and iOS application. + */ + namespace WatchSession { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * Returns the current activation state of the watch. + */ + const activationState: number; + + /** + * The watch is currently not activated. + */ + const ACTIVATION_STATE_NOT_ACTIVATED: number; + + /** + * The watch is currently inactive. + */ + const ACTIVATION_STATE_INACTIVE: number; + + /** + * The watch is currently activated. + */ + const ACTIVATION_STATE_ACTIVATED: number; + + /** + * Returns `true` if there is more content for the session to deliver. + */ + const hasContentPending: boolean; + + /** + * The number of calls remaining to `transferCurrentComplication` before the system starts + * transferring the complicationUserInfo as regular userInfos. + */ + const remainingComplicationUserInfoTransfers: number; + + /** + * Returns `true` if the device supports watch connectivity. + */ + const isSupported: boolean; + + /** + * Returns `true` if the device is paired with a watch. + */ + const isPaired: boolean; + + /** + * Returns `true` if the accompanying watch app is installed. + */ + const isWatchAppInstalled: boolean; + + /** + * Returns `true` if complication is enabled on the installed watch app. + */ + const isComplicationEnabled: boolean; + + /** + * Returns `true` if the watch is currently reachable. + */ + const isReachable: boolean; + + /** + * Returns `true` if the watch is currently activated. + */ + const isActivated: boolean; + + /** + * The most recent application context sent to the watch app. + */ + const recentApplicationContext: any; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Activates the watch session + */ + function activateSession(): void; + + /** + * Sends a message to the apple watch. + */ + function sendMessage(message: any, reply?: (param0: MessageReply) => any): void; + + /** + * Sends an app context update to the apple watch. + */ + function updateApplicationContext(params: any): void; + + /** + * Transfers an user info to the apple watch. + */ + function transferUserInfo(params: any): void; + + /** + * Transfers a file to the apple watch. + */ + function transferFile(params: any): void; + + /** + * Transfers complication data to the watch application. + */ + function transferCurrentComplication(params: any): void; + + /** + * Cancels all incomplete user info and complication transfers to the apple watch. + */ + function cancelAllUserInfoTransfers(): void; + + /** + * Cancels all incomplete file transfers to the apple watch. + */ + function cancelAllFileTransfers(): void; + + /** + * Cancels all incomplete transfers to the apple watch. + */ + function cancelAllTransfers(): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getActivationState(): number; + + /** + * Gets the value of the property. + */ + function getHasContentPending(): boolean; + + /** + * Gets the value of the property. + */ + function getRemainingComplicationUserInfoTransfers(): number; + + /** + * Gets the value of the property. + */ + function getIsSupported(): boolean; + + /** + * Gets the value of the property. + */ + function getIsPaired(): boolean; + + /** + * Gets the value of the property. + */ + function getIsWatchAppInstalled(): boolean; + + /** + * Gets the value of the property. + */ + function getIsComplicationEnabled(): boolean; + + /** + * Gets the value of the property. + */ + function getIsReachable(): boolean; + + /** + * Gets the value of the property. + */ + function getIsActivated(): boolean; + + /** + * Gets the value of the property. + */ + function getRecentApplicationContext(): any; + + } + + /** + * The top level XML module. The XML module is used for parsing and processing XML-based content. + */ + namespace XML { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * Parses an XML string into a object. + */ + function parseString(xml: string): Titanium.XML.Document; + + /** + * Serializes a [Node](Titanium.XML.Node) object into a string. + */ + function serializeToString(node: Titanium.XML.Node): string; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + + /** + * Represents an attribute of an [Element](Titanium.XML.Element). + */ + interface Attr extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * Attribute name + */ + readonly name: string; + + /** + * The to which the attribute belongs. + */ + readonly ownerElement: Titanium.XML.Element; + + /** + * True if this attribute was explicitly given a value in the instance document, false otherwise. + */ + readonly specified: boolean; + + /** + * The attribute value as a string. + */ + value: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getOwnerElement(): Titanium.XML.Element; + + /** + * Gets the value of the property. + */ + getSpecified(): boolean; + + /** + * Gets the value of the property. + */ + getValue(): string; + + /** + * Sets the value of the property. + */ + setValue(value: string): void; + + } + + /** + * Used to include blocks of literal text containing characters that would otherwise need + * to be escaped. + */ + interface CDATASection extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The character data of the node that implements this interface. Throws an exception during setting if this node is readonly. + */ + data: string; + + /** + * The number of characters that are available through data and the substringData method. This may have the value zero, i.e., may be empty. + */ + readonly length: number; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly. + */ + appendData(arg: string): void; + + /** + * Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + deleteData(offset: number, count: number): void; + + /** + * Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length. + */ + insertData(offset: number, arg: string): void; + + /** + * Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + replaceData(offset: number, count: number, arg: string): void; + + /** + * Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative. + */ + substringData(offset: number, count: number): string; + + /** + * Breaks this node into two nodes at the specified by offset, and returns a new node of the same type, which contains all the content at and after the offset point. Throws an exception if the specified offset is negative or if this node is read only. + */ + splitText(offset: number): Titanium.XML.Text; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * An interface extending with a set of attributes and methods for accessing character data in the DOM. + * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-FF21A306) on Android and iOS. For reasons of compatibility with the javascript engine, text is represented by UTF-8 instead of UTF-16 on Android and iOS. + */ + interface CharacterData extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The character data of the node that implements this interface. Throws an exception during setting if this node is readonly. + */ + data: string; + + /** + * The number of characters that are available through data and the substringData method. This may have the value zero, i.e., may be empty. + */ + readonly length: number; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly. + */ + appendData(arg: string): void; + + /** + * Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + deleteData(offset: number, count: number): void; + + /** + * Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length. + */ + insertData(offset: number, arg: string): void; + + /** + * Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + replaceData(offset: number, count: number, arg: string): void; + + /** + * Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative. + */ + substringData(offset: number, count: number): string; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * Represents the contents of an XML comment. + */ + interface Comment extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The character data of the node that implements this interface. Throws an exception during setting if this node is readonly. + */ + data: string; + + /** + * The number of characters that are available through data and the substringData method. This may have the value zero, i.e., may be empty. + */ + readonly length: number; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly. + */ + appendData(arg: string): void; + + /** + * Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + deleteData(offset: number, count: number): void; + + /** + * Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length. + */ + insertData(offset: number, arg: string): void; + + /** + * Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + replaceData(offset: number, count: number, arg: string): void; + + /** + * Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative. + */ + substringData(offset: number, count: number): string; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * The interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490) on Android and iOS. + */ + interface DOMImplementation extends Titanium.Proxy { + /** + * Creates an object of the specified type with its document element. Raises an exception if qualifiedName is malformed, contains an illegal character, or is inconsistent with namespaceURI. Also raises an exception if doctype has already been used with a different document. + */ + createDocument(namespaceURI: string, qualifiedName: string, doctype: Titanium.XML.DocumentType): Titanium.XML.Document; + + /** + * Creates an empty node. Entity declarations and notations are not made available. Entity reference expansions and default attribute additions do not occur. Raises an exception if qualifiedName is malformed or contains an illegal character. + */ + createDocumentType(qualifiedName: string, publicId: string, systemId: string): Titanium.XML.DocumentType; + + /** + * Test if the implements a specific feature. + */ + hasFeature(feature: string, version: string): boolean; + + } + + /** + * The DOM Document returned from . + */ + interface Document extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * An interface to the list of entities that are defined for the document, such as via a Document Type Definition (DTD). + */ + readonly doctype: Titanium.XML.DocumentType; + + /** + * Root element of this document. + */ + readonly documentElement: Titanium.XML.Element; + + /** + * [DOMImplementation](Titanium.XML.DOMImplementation) object associated with this + * document. + */ + readonly implementation: Titanium.XML.DOMImplementation; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Creates an attribute with the given name. + */ + createAttribute(name: string): Titanium.XML.Attr; + + /** + * Creates an attribute with the given name and namespace. + */ + createAttributeNS(namespaceURI: string, name: string): Titanium.XML.Attr; + + /** + * Creates and returns a [CDATASection](Titanium.XML.CDATASection). + */ + createCDATASection(data: string): Titanium.XML.CDATASection; + + /** + * Creates a [Comment](Titanium.XML.Comment) with the supplied string data. + */ + createComment(data: string): Titanium.XML.Comment; + + /** + * Creates an empty [DocumentFragment](Titanium.XML.DocumentFragment). + */ + createDocumentFragment(): Titanium.XML.DocumentFragment; + + /** + * Creates an element with the given tag name. + */ + createElement(tagName: string): Titanium.XML.Element; + + /** + * Create a new element with the given namespace and name. + */ + createElementNS(namespaceURI: string, name: string): Titanium.XML.Element; + + /** + * Creates an [EntityReference](Titanium.XML.EntityReference) with the given name. + */ + createEntityReference(name: string): Titanium.XML.EntityReference; + + /** + * Creates a processing instruction for inserting into the DOM tree. + */ + createProcessingInstruction(target: string, data: string): Titanium.XML.ProcessingInstruction; + + /** + * Creates a text node. + */ + createTextNode(data: string): Titanium.XML.Text; + + /** + * Returns an [Element](Titanium.XML.Element) that has an ID attribute with the given value. + */ + getElementById(elementId: string): Titanium.XML.Element; + + /** + * Returns a node list of elements in the document which have the given tag. + */ + getElementsByTagName(tagname: string): Titanium.XML.NodeList; + + /** + * Returns a node list of elements in the document which belong to the given namespace and have the given tag name. + */ + getElementsByTagNameNS(namespaceURI: string, localname: string): Titanium.XML.NodeList; + + /** + * Imports a node from another document to this document, + * without altering or removing the source node from the original document. + */ + importNode(importedNode: Titanium.XML.Node, deep: boolean): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getDoctype(): Titanium.XML.DocumentType; + + /** + * Gets the value of the property. + */ + getDocumentElement(): Titanium.XML.Element; + + /** + * Gets the value of the property. + */ + getImplementation(): Titanium.XML.DOMImplementation; + + } + + /** + * A lightweight document object used as a container for a group of nodes. + */ + interface DocumentFragment extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + } + + /** + * Each has a `doctype` attribute whose value is either 'null' or a object. + */ + interface DocumentType extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * A containing the general entities, both external and internal, declared in the DTD. Parameter entities are not contained. Duplicates are discarded. + */ + readonly entities: Titanium.XML.NamedNodeMap; + + /** + * The internal subset as a string. + */ + readonly internalSubset: string; + + /** + * The name of DTD; i.e., the name immediately following the `DOCTYPE` keyword. + */ + readonly name: string; + + /** + * A containing the notations declared in the DTD. Duplicates are discarded. Every node in this map also implements the interface. + */ + readonly notations: Titanium.XML.NamedNodeMap; + + /** + * The public identifier of the external subset. + */ + readonly publicId: string; + + /** + * The system identifier of the external subset. + */ + readonly systemId: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getEntities(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getInternalSubset(): string; + + /** + * Gets the value of the property. + */ + getName(): string; + + /** + * Gets the value of the property. + */ + getNotations(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getPublicId(): string; + + /** + * Gets the value of the property. + */ + getSystemId(): string; + + } + + /** + * Represents an element in a DOM document, a defined by a start-tag and end-tag (or an empty tag). Elements may have [attributes](Titanium.XML.Attr) associated with them. + * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614) on Android and iOS with some non-standard extensions. + */ + interface Element extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The name of the element, as defined by its tag. + */ + readonly tagName: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Retrieves an attribute value by name, returning it as a string. + */ + getAttribute(name: string): string; + + /** + * Adds a new attribute. Any attribute with the same name is replaced. Throws an exception if the element is read-only, or if the name contains an illegal character. + */ + setAttribute(name: string, value: string): void; + + /** + * Removes an attribute by name. If the attribute has a default value, it is immediately replaced with this default, including namespace URI and local name. Throws an exception if the element is read-only. + */ + removeAttribute(name: string): void; + + /** + * Retrieves an attribute value by name, returning it as a object. + */ + getAttributeNode(name: string): Titanium.XML.Attr; + + /** + * Adds a new attribute. Any attribute with the same `nodeName` as the argument is replaced. Throws an exception if the element is read-only, if `newAttr` is from a different document, or if `newAttr` is already an attribute of another element. + */ + setAttributeNode(newAttr: Titanium.XML.Attr): Titanium.XML.Attr; + + /** + * Removes the specified attribute node. If the removed attribute has a default value, it is replaced immediately, with the same namespace and local name as the removed attribute, if applicable. Throws an exception if the element is read-only, or the attribute is not an attribute of the element. + */ + removeAttributeNode(oldAttr: Titanium.XML.Attr): void; + + /** + * Retrieves a of all descendant elements with a given tag name, in preorder traversal. + */ + getElementsByTagName(name: string): Titanium.XML.NodeList; + + /** + * Retrieves an attribute value by local name and namespace URI, returning it as a string. + */ + getAttributeNS(namespaceURI: string, localName: string): string; + + /** + * Adds a new attribute. Any attribute with the same local name and namespace URI is present on the element is replaced, with its prefix changed to that of the `qualifiedName` parameter. Throws an exception if the element is read-only, if the name contains an illegal character, or if the qualified name contains an error. + */ + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + + /** + * Removes an attribute by local name and namespace URI. If the attribute has a default value, it is immediately replaced with this default, including namespace URI and local name. Throws an exception if the element is read-only. + */ + removeAttributeNS(namespaceURI: string, localName: string): void; + + /** + * Retrieves an attribute value by local name and namespace URI, returning it as a object. + */ + getAttributeNodeNS(namespaceURI: string, localName: string): Titanium.XML.Attr; + + /** + * Adds a new attribute. Any attribute with the same local name and namespace URI is replaced. Throws an exception if the element is read-only, if `newAttr` is from a different document, or if `newAttr` is already an attribute of another element. + */ + setAttributeNodeNS(newAttr: Titanium.XML.Attr): Titanium.XML.Attr; + + /** + * Retrieves a of all descendant elements with a given local name and namespace URI, in preorder traversal. + */ + getElementsByTagNameNS(namespaceURI: string, localName: string): Titanium.XML.NodeList; + + /** + * Determines whether or not an attribute with the given name is available in the element, or has a default value. + */ + hasAttribute(name: string): boolean; + + /** + * Determines whether or not an attribute with the given name is available in the element, or has a default value. + */ + hasAttributeNS(namespaceURI: string, localName: string): boolean; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getTagName(): string; + + } + + /** + * This interface represents an entity, either parsed or unparsed, in an XML document. Note that this models the entity itself not the entity declaration. The nodeName attribute that is inherited from Node contains the name of the entity. An Entity node does not have any parent. + * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-527DCFF2) on Android and iOS. + */ + interface Entity extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * For unparsed entities, the name of the notation for the entity. For parsed entities, this is `null`. + */ + readonly notationName: string; + + /** + * The public identifier associated with the entity, if specified. If the public identifier was not specified, this is `null`. + */ + readonly publicId: string; + + /** + * The system identifier associated with the entity, if specified. If the system identifier was not specified, this is null. + */ + readonly systemId: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getNotationName(): string; + + /** + * Gets the value of the property. + */ + getPublicId(): string; + + /** + * Gets the value of the property. + */ + getSystemId(): string; + + } + + /** + * Represents an XML entity reference. + */ + interface EntityReference extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + } + + /** + * A key-value paired map that maps String objects to objects. + * Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1780488922) on Android and iOS. + */ + interface NamedNodeMap extends Titanium.Proxy { + /** + * The number of nodes in the map. The valid range of child node indices is 0-`length`-1, inclusive. + */ + readonly length: number; + + /** + * Retrieves a node specified by name. + */ + getNamedItem(name: string): Titanium.XML.Node; + + /** + * Adds a node using its `nodeName` attribute. If a node with that name is already present, it is replaced. Throws an exception if the argument is from a different document, the map is read-only, or the argument is an attribute of another element. + */ + setNamedItem(node: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Removes a node from the map specified by name. When this map contains attributes attached to an element, if the removed attribtue is known to have a default, it is replaced with that value. + */ + removeNamedItem(name: string): Titanium.XML.Node; + + /** + * Retrieves the node at the specified index of the map. Note that NamedNodeMaps are not ordered. + */ + item(index: number): Titanium.XML.Node; + + /** + * Retrieves a node specified by name and namespace. Returns `null` if no matching node is in the map. + */ + getNamedItemNS(namespaceURI: string, localName: string): Titanium.XML.Node; + + /** + * Adds a node using its `namespaceURI` and `localName` attributes. If a node with that name is already present, it is replaced. Throws an exception if the argument is from a different document, the map is read-only, or the argument is an attribute of another element. + */ + setNamedItemNS(node: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Removes a node from the map specified by local name and namespace URI. When this map contains attributes attached to an element, if the removed attribtue is known to have a default, it is replaced with that value. Returns the node removed from the map, or `null` if there is no corresponding node. + */ + removeNamedItemNS(namespaceURI: string, localName: string): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * A single node in the [Document](Titanium.XML.Document) tree. + */ + interface Node extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + } + + /** + * A list of objects. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177) on Android and iOS. + */ + interface NodeList extends Titanium.Proxy { + /** + * The length of the node list. + */ + readonly length: number; + + /** + * Returns the object at the specified index. + */ + item(index: number): Titanium.XML.Node; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + /** + * Represents a notation declared in the DTD. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-5431D1B9) on Android and iOS. + */ + interface Notation extends Titanium.Proxy { + /** + * The public identifier of this notation. If the public identifier was not specified, this is `null`. + */ + readonly publicId: string; + + /** + * The system identifier of this notation. If the system identifier was not specified, this is `null`. + */ + readonly systemId: string; + + /** + * Gets the value of the property. + */ + getPublicId(): string; + + /** + * Gets the value of the property. + */ + getSystemId(): string; + + } + + /** + * A way to keep processor-specific information in the text of the document. Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1004215813) on Android and iOS. + */ + interface ProcessingInstruction extends Titanium.Proxy { + /** + * Retrieve the content of this processing instruction. This from the first non white space character after the target to the character immediatly preceding the ?>. When setting a processing instruction, a DOMException may be thrown on an invalid instruction. + */ + data: string; + + /** + * Retrieve the target of this processing instruction. XML defines this as being the first token following the markup that begins the processing instruction. + */ + readonly target: string; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getTarget(): string; + + } + + /** + * Represents the textual content of an or Implements the [DOM Level 2 API](http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1312295772) on Android and iOS. + */ + interface Text extends Titanium.Proxy { + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Element](Titanium.XML.Element) node. + */ + readonly ELEMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Attr](Titanium.XML.Attr) node. + */ + readonly ATTRIBUTE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Text](Titanium.XML.Text) node. + */ + readonly TEXT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [CDATASection](Titanium.XML.CDATASection) node. + */ + readonly CDATA_SECTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [EntityReference](Titanium.XML.EntityReference) node. + */ + readonly ENTITY_REFERENCE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify an + * [Entity](Titanium.XML.Entity) node. + */ + readonly ENTITY_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [ProcessingInstruction](Titanium.XML.ProcessingInstruction) node. + */ + readonly PROCESSING_INSTRUCTION_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Comment](Titanium.XML.Comment) node. + */ + readonly COMMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Document](Titanium.XML.Document) node. + */ + readonly DOCUMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentType](Titanium.XML.DocumentType) node. + */ + readonly DOCUMENT_TYPE_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [DocumentFragment](Titanium.XML.DocumentFragment) node. + */ + readonly DOCUMENT_FRAGMENT_NODE: number; + + /** + * Used with [nodeType](Titanium.XML.Node.nodeType) to identify a + * [Notation](Titanium.XML.Notation) node. + */ + readonly NOTATION_NODE: number; + + /** + * Name of this node. + */ + readonly nodeName: string; + + /** + * Content (value) of this node. + */ + nodeValue: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly textContent: string; + + /** + * Content (value) of all text nodes within this node. + */ + readonly text: string; + + /** + * This node's type. One of `ELEMENT_NODE`, `ATTRIBUTE_NODE`, `TEXT_NODE`, `CDATA_SECTION_NODE`, + * `ENTITY_REFERENCE_NODE`, `ENTITY_NODE`, `PROCESSING_INSTRUCTION_NODE`, `COMMENT_NODE`, + * `DOCUMENT_NODE`, `DOCUMENT_TYPE_NODE`, `DOCUMENT_FRAGMENT_NODE`, `NOTATION_NODE`. + */ + readonly nodeType: number; + + /** + * This node's parent node. + */ + readonly parentNode: Titanium.XML.Node; + + /** + * A of this node's children. + */ + readonly childNodes: Titanium.XML.NodeList; + + /** + * This node's first child. + */ + readonly firstChild: Titanium.XML.Node; + + /** + * This node's last child. + */ + readonly lastChild: Titanium.XML.Node; + + /** + * This node's previous sibling. + */ + readonly previousSibling: Titanium.XML.Node; + + /** + * This node's next sibling. + */ + readonly nextSibling: Titanium.XML.Node; + + /** + * A map of this node's attributes. + */ + readonly attributes: Titanium.XML.NamedNodeMap; + + /** + * This node's owning document. + */ + readonly ownerDocument: Titanium.XML.Document; + + /** + * Namespace URI of this node. + */ + readonly namespaceURI: string; + + /** + * Namespace prefix of this node. + */ + prefix: string; + + /** + * Local part of the qualified name of this node. + */ + localName: string; + + /** + * The character data of the node that implements this interface. Throws an exception during setting if this node is readonly. + */ + data: string; + + /** + * The number of characters that are available through data and the substringData method. This may have the value zero, i.e., may be empty. + */ + readonly length: number; + + /** + * Appends the node `newChild` as a child of this node. + */ + appendChild(newChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Returns a duplicate of this node. + */ + cloneNode(deep: boolean): Titanium.XML.Node; + + /** + * Returns `true` if this node has attributes. + */ + hasAttributes(): boolean; + + /** + * Returns `true` if this node has child nodes. + */ + hasChildNodes(): boolean; + + /** + * Inserts the node `newChild` before the node `refChild`. + */ + insertBefore(newChild: Titanium.XML.Node, refChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Tests whether the DOM implementation supports a specific feature. + */ + isSupported(feature: string, version: string): boolean; + + /** + * Normalizes text and attribute nodes in this node's child hierarchy. + */ + normalize(): void; + + /** + * Removes a child node from this node. + */ + removeChild(oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Replaces the node `oldChild` with the node `newChild`. + */ + replaceChild(newChild: Titanium.XML.Node, oldChild: Titanium.XML.Node): Titanium.XML.Node; + + /** + * Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified. Throws an exception if this node is readonly. + */ + appendData(arg: string): void; + + /** + * Remove a range of characters from the node. Upon success, data and length reflect the change. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + deleteData(offset: number, count: number): void; + + /** + * Insert a string at the specified offset. Throws an exception if this node is readonly, if offset is negative, or if offset is beyond the data's length. + */ + insertData(offset: number, arg: string): void; + + /** + * Replace the characters starting at the specified offset with the specified string. Throws an exception if this node is readonly, if offset is negative, offset is beyond the data's length, or if count is negative. + */ + replaceData(offset: number, count: number, arg: string): void; + + /** + * Extracts a range of data from the node. Throws an exception if offset is negative, offset is beyond the data's length, or if count is negative. + */ + substringData(offset: number, count: number): string; + + /** + * Breaks this node into two nodes at the specified by offset, and returns a new node of the same type, which contains all the content at and after the offset point. Throws an exception if the specified offset is negative or if this node is read only. + */ + splitText(offset: number): Titanium.XML.Text; + + /** + * Gets the value of the property. + */ + getAttributes(): Titanium.XML.NamedNodeMap; + + /** + * Gets the value of the property. + */ + getData(): string; + + /** + * Sets the value of the property. + */ + setData(data: string): void; + + /** + * Gets the value of the property. + */ + getLength(): number; + + } + + } + + /** + * The top level Yahoo module. The Yahoo module is used for accessing Yahoo related API services. + */ + namespace Yahoo { + /** + * Indicates if the proxy will bubble an event to its parent. + */ + let bubbleParent: boolean; + + /** + * The name of the API that this proxy corresponds to. + */ + const apiName: string; + + /** + * The Window or TabGroup whose Activity lifecycle should be triggered on the proxy. + */ + let lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Adds the specified callback as an event listener for the named event. + */ + function addEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Removes the specified callback as an event listener for the named event. + */ + function removeEventListener(name: string, callback: (param0: any) => any): void; + + /** + * Fires a synthesized event to any registered listeners. + */ + function fireEvent(name: string, event: any): void; + + /** + * Applies the properties to the proxy. + */ + function applyProperties(props: any): void; + + /** + * invoke a Yahoo YQL query + */ + function yql(yql: string, callback: (param0: YQLResponse) => any): void; + + /** + * Gets the value of the property. + */ + function getBubbleParent(): boolean; + + /** + * Sets the value of the property. + */ + function setBubbleParent(bubbleParent: boolean): void; + + /** + * Gets the value of the property. + */ + function getApiName(): string; + + /** + * Gets the value of the property. + */ + function getLifecycleContainer(): Titanium.UI.Window | Titanium.UI.TabGroup; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.Window): void; + + /** + * Sets the value of the property. + */ + function setLifecycleContainer(lifecycleContainer: Titanium.UI.TabGroup): void; + } } - -declare class Dictionary { - -} - -declare class BarItemType { - accessibilityLabel : string; - enabled : boolean; - image : any; - title : string; - width : number; -} - -declare class MatrixCreationDict { - anchorPoint : Dictionary; - rotate : number; - scale : number; -} - -declare class TableViewIndexEntry { - index : number; - title : string; -} - -declare class FacebookRESTResponsev1 { - error : string; - method : string; - result : string; - success : boolean; -} - -declare class titleAttributesParams { - color : string; - font : Font; - shadow : shadowDict; -} - -declare class MapRegionType { - latitude : number; - latitudeDelta : number; - longitude : number; - longitudeDelta : number; -} - -declare class CropRectType { - height : number; - width : number; - x : number; - y : number; -} - -declare class LocationResults extends ErrorResponse { - coords : LocationCoordinates; - provider : LocationProviderDict; -} - -declare class ErrorResponse { - code : number; - error : string; - success : boolean; -} - -declare class CloudPushNotificationsQueryResponse extends CloudResponse { - subscriptions : Array>; -} - -declare class CloudResponse { - code : number; - error : boolean; - message : string; - meta : Dictionary; - success : boolean; -} - -declare enum CloudPushNotificationsResponse { - -} - -declare class textFieldSelectedParams { - length : number; - location : number; -} - -declare class recurrenceEndDictionary { - endDate : Date; - occurrenceCount : number; -} - -declare namespace Global { - export function L (key: string, hint?: string) : string; - export function alert (message: string) : void; - export function clearInterval (timerId: number) : void; - export function clearTimeout (timerId: number) : void; - export function decodeURIComponent (encodedURI: string) : string; - export function encodeURIComponent (string: string) : string; - export function require (moduleId: string) : any; - export function setInterval (_function: (...args : any[]) => any, delay: number) : number; - export function setTimeout (_function: (...args : any[]) => any, delay: number) : number; - export interface console { - debug (message: any) : void; - error (message: any) : void; - info (message: any) : void; - log (message: any) : void; - warn (message: any) : void; - } - export interface String { - format (formatString: string, value: string) : string; - format (formatString: string, value: number) : string; - formatCurrency (value: number) : string; - formatDate (date: Date, format?: string) : string; - formatDecimal (value: number, locale?: string, pattern?: string) : string; - formatTime (date: Date, format?: string) : string; - } - export interface JSON { - parse (text: string, reviver: (...args : any[]) => any) : any; - stringify (value: any, replacer?: (...args : any[]) => any, space?: number) : string; - stringify (value: any, replacer?: Array, space?: string) : string; - stringify (value: any, replacer?: Array, space?: number) : string; - stringify (value: any, replacer?: (...args : any[]) => any, space?: string) : string; - } -} - -declare class CloudGeoFenceResponse extends CloudResponse { - geo_fences : Array>; -} - -declare class ServiceIntentOptions { - startMode : number; - url : string; -} - -declare class AcceptedCallbackArgs { - inbound : Ti.Network.Socket.TCP; - socket : Ti.Network.Socket.TCP; -} - -declare class HeadingData { - accuracy : number; - magneticHeading : number; - timestamp : number; - trueHeading : number; - x : number; - y : number; - z : number; -} - -declare class FacebookGraphResponsev1 { - error : string; - path : string; - result : string; - success : boolean; -} - -declare class textAreaSelectedParams { - length : number; - location : number; -} - -declare class ThumbnailResponse extends ErrorResponse { - image : Ti.Blob; - time : number; -} - -declare class Dimension { - height : number; - width : number; - x : number; - y : number; -} - -declare class ReadCallbackArgs extends ErrorResponse { - bytesProcessed : number; - errorDescription : string; - errorState : number; - source : Ti.IOStream; -} - -declare class CloudACLsCheckResponse extends CloudResponse { - permission : Dictionary; -} - -declare class ViewTemplate { - bindId : string; - childTemplates : Array; - events : Dictionary; - properties : Dictionary; - type : string; -} - -declare class CloudChatsResponse extends CloudResponse { - chats : Array>; -} - -declare class MediaQueryType { - albumArtist : any; - albumTitle : any; - artist : any; - composer : any; - genre : any; - grouping : number; - isCompilation : any; - mediaType : any; - title : any; -} - -declare class WebAPIError { - code : number; - message : string; - name : string; -} - -declare class DocumentViewerOptions { - animated : boolean; - view : Ti.UI.View; -} - -declare class ListViewAnimationProperties { - animated : boolean; - animationStyle : number; - position : number; -} - -declare class CloudPushSchedulesResponse extends CloudResponse { - push_schedules : Array; -} - -declare class DataCallbackArgs { - address : string; - bytesData : Array; - port : string; - stringData : string; -} - -declare class CloudPushNotificationErrorArg { - error : string; -} - -declare class ScreenshotResult { - media : Ti.Blob; -} - -declare class YQLResponse extends ErrorResponse { - data : any; - message : string; -} - -declare class ForwardGeocodeResponse extends ErrorResponse { - accuracy : number; - address : string; - city : string; - country : string; - countryCode : string; - country_code : string; - displayAddress : string; - latitude : string; - longitude : string; - postalCode : string; - region1 : string; - region2 : string; - street : string; - street1 : string; -} - -declare class CloudEventsResponse extends CloudResponse { - events : Array>; -} - -declare class ReadyStatePayload { - readyState : number; -} - -declare class ErrorCallbackArgs { - errorCode : number; - socket : Ti.Network.Socket.TCP; -} - -declare class FailureResponse { - code: Number; - error: string; - success: boolean; -} - -declare class WriteCallbackArgs extends ErrorResponse { - bytesProcessed : number; - errorDescription : string; - errorState : number; - source : Ti.IOStream; -} - -declare class CloudPushNotificationSuccessArg { - deviceToken : string; -} - -declare class MapLocationType { - animate : boolean; - latitude : number; - latitudeDelta : number; - longitude : number; - longitudeDelta : number; - regionFit : boolean; -} - -declare class DecodeStringDict { - charset : string; - length : number; - position : number; - source : Ti.Buffer; -} - -declare class ListViewContentInsetOption { - animated : boolean; - duration : number; -} - -declare class RouteDescription { - inputs : Array; - outputs : Array; -} - -declare class CreateStreamArgs { - mode : number; - source : any; -} - -declare enum ContactsAuthorizationResponse { - -} - -declare class CloudCheckinsResponse extends CloudResponse { - checkins : Array>; -} - -declare class CreateBufferArgs { - byteOrder : number; - length : number; - type : string; - value : any; -} - -declare class CloudPushNotificationConfig { - error : (...args : any[]) => any; - success : (...args : any[]) => any; -} - -declare class CloudReviewsResponse extends CloudResponse { - reviews : Array>; -} - -declare class Point { - x : number; - y : number; -} - -declare class CloudPhotosResponse extends CloudResponse { - photos : Array>; -} - -declare class PushNotificationConfig { - callback : (...args : any[]) => any; - error : (...args : any[]) => any; - success : (...args : any[]) => any; - types : Array; -} - -declare class MapRouteType { - color : string; - name : string; - points : Array; - width : number; -} - -declare class AcceptDict { - error : (...args : any[]) => any; - timeout : number; -} - -declare class MediaQueryInfoType { - exact : boolean; - value : any; -} - -declare class PumpCallbackArgs extends ErrorResponse { - buffer : Ti.Buffer; - bytesProcessed : number; - errorDescription : string; - errorState : number; - source : Ti.IOStream; - totalBytesProcessed : number; -} - -declare class MusicLibraryOptionsType { - allowMultipleSelections : boolean; - animated : boolean; - autohide : boolean; - cancel : (...args : any[]) => any; - error : (...args : any[]) => any; - mediaTypes : any; - success : (...args : any[]) => any; -} - -declare class shadowDict { - blurRadius : number; - color : string; - offset : Dictionary; -} - -declare class launchOptions { - launchOptionsLocationKey : boolean; - source : string; - url : string; -} - -declare class WriteStreamCallbackArgs extends ErrorResponse { - bytesProcessed : number; - errorDescription : string; - errorState : number; - fromStream : Ti.IOStream; - toStream : Ti.IOStream; -} - -declare class CloudChatGroupsResponse extends CloudResponse { - chat_groups : Array>; -} - -declare class CloudPhotoCollectionsPhotosResponse extends CloudResponse { - photos : Array>; -} - -declare class DecodeNumberDict { - byteOrder : number; - position : number; - source : Ti.Buffer; - type : string; -} - -declare class ConnectedCallbackArgs { - socket : Ti.Network.Socket.TCP; -} - -declare class CloudPhotoCollectionsResponse extends CloudResponse { - collections : Array>; -} - -declare class CloudObjectsResponse extends CloudResponse { - classname : Array>; -} - -declare class PopoverParams { - animated : boolean; - rect : Dimension; - view : Ti.UI.View; -} - -declare class MediaScannerResponse { - path : string; - uri : string; -} - -declare class CloudPushNotificationsQueryChannelResponse extends CloudResponse { - push_channels : Array; -} - -declare class CloudPostsResponse extends CloudResponse { - posts : Array>; -} - -declare class CloudSocialIntegrationsResponse extends CloudResponse { - users : Array>; -} - -declare class APSConnectionDelegate { - -} - -declare class CameraOptionsType { - allowEditing : boolean; - animated : boolean; - arrowDirection : number; - autohide : boolean; - autorotate : boolean; - cancel : (...args : any[]) => any; - error : (...args : any[]) => any; - inPopOver : boolean; - mediaTypes : Array; - overlay : Ti.UI.View; - popoverView : Ti.UI.View; - saveToPhotoGallery : boolean; - showControls : boolean; - success : (...args : any[]) => any; - transform : Ti.UI._2DMatrix; - videoMaximumDuration : number; - videoQuality : number; -} - -declare class ListViewIndexEntry { - index : number; - title : string; -} - -declare class CloudStreamProgress { - progress : number; - url : string; -} - -declare class MusicLibraryResponseType { - items : Array; - representative : Ti.Media.Item; - types : number; -} - -declare class CloudEventOccurrencesResponse extends CloudResponse { - event_occurrences : Array>; -} - -declare class CloudUsersResponse extends CloudResponse { - users : Array>; -} - -declare class TableViewContentInsetOption { - animated : boolean; - duration : number; -} - -declare class CloudFriendRequestsResponse extends CloudResponse { - friend_requests : Array>; -} - -declare class CloudACLsResponse extends CloudResponse { - acls : Array>; -} - -declare class ListViewMarkerProps { - itemIndex : number; - sectionIndex : number; -} - -declare class EventsAuthorizationResponse { - code : number; - error : string; - success : boolean; +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudACLsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of ACL objects, if any exist. + */ + acls?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudACLsCheckResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Dictionary of permissions. + */ + permission?: any; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudChatsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `chats` objects, if any exist. + */ + chats?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudChatGroupsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `chat_groups` objects, if any exist. + */ + chat_groups?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudCheckinsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `checkins` objects, if any exist. + */ + checkins?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudClientsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * IP address of client. + */ + ip_address?: string; + + /** + * Location of client. + */ + location?: any; + +} + +/** + * Argument passed to the callback as a request is transmitted or received. + */ +interface CloudStreamProgress { + /** + * A value from 0.0-1.0 with the progress of the exchange. + */ + progress?: number; + + /** + * The URL for the request, to help identify it. + */ + url?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudEmailsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudEventsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `event` objects, if any exist. + */ + events?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudEventOccurrencesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `event` objects, if any exist. + */ + event_occurrences?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudFilesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `file` objects, if any exist. + */ + files?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudFriendsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `user` objects, if any exist. + */ + users?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudFriendRequestsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `user` objects, if any exist. + */ + friend_requests?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudGeoFenceResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of geo-fence objects, if any exist. + */ + geo_fences?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudKeyValuesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `keyvalues` objects, if any exist. + */ + keyvalues?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudLikesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `like` objects, if any exist. + */ + likes?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudMessagesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `message` objects, if any exist. + */ + messages?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudObjectsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `classname` objects, if any exist. + */ + classname?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPhotoCollectionsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `collections` objects, if any exist. + */ + collections?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPhotoCollectionsPhotosResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `photos` objects, if any exist. + */ + photos?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPhotosResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `photos` objects, if any exist. + */ + photos?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPlacesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `places` objects, if any exist. + */ + places?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPostsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `posts` objects, if any exist. + */ + posts?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPushNotificationsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully. + */ +interface CloudPushNotificationsQueryChannelResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Array of `push_channel` names, if any exist. + */ + push_channels?: string[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully. + */ +interface CloudPushNotificationsShowChannelResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Dictionary containing counts of devices subscribed to a push channel, grouped by platform. + */ + devices?: any; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudPushNotificationsQueryResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `subscription` objects, if any exist. + */ + subscriptions?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully. + */ +interface CloudPushSchedulesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Array of [schedules push notifications](http://docs.appcelerator.com/arrowdb/latest/#!/api/PushSchedules), if any exist. + */ + push_schedules?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudReviewsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `reviews` objects, if any exist. + */ + reviews?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudSocialIntegrationsResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `users` objects, if any exist. + */ + users?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudStatusesResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `statuses` objects, if any exist. + */ + statuses?: any[]; + +} + +/** + * Properties for the modal dialog used in 3-Legged OAuth + */ +interface CloudUsersSecureDialog { + /** + * Defines the title for the dialog. + */ + title?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudUsersResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Set of `user` objects, if any exist. + */ + users?: any[]; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CloudUsersSecureResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Indicates whether the request failed. + */ + error?: boolean; + + /** + * Meta data, if any returned. + */ + meta?: any; + + /** + * Error code, if any returned. + */ + code?: number; + + /** + * Error message, if any returned. + */ + message?: string; + + /** + * Identifies the current access token when using 3-Legged OAuth. + */ + accessToken?: string; + + /** + * Indicates the number of seconds before the access token expires. + */ + expiresIn?: number; + +} + +/** + * Simple object for specifying token retrieval options to [retrieveDeviceToken](Modules.CloudPush.retrieveDeviceToken). + */ +interface CloudPushNotificationConfig { + /** + * Callback function called when the push registration is successfully completed. + */ + success?: (param0: CloudPushNotificationSuccessArg) => any; + + /** + * Callback function called when an error occurs during registration. + */ + error?: (param0: CloudPushNotificationErrorArg) => any; + +} + +/** + * A simple object passed to the [retrieveDeviceToken](Modules.CloudPush.retrieveDeviceToken) success callback. + */ +interface CloudPushNotificationSuccessArg { + /** + * The device token which this device was registered for. + */ + deviceToken?: string; + +} + +/** + * A simple object passed to the [retrieveDeviceToken](Modules.CloudPush.retrieveDeviceToken) error callback. + */ +interface CloudPushNotificationErrorArg { + /** + * Description of the error. + */ + error?: string; + +} + +/** + * Optional Titanium modules. + */ +interface Modules { +} + +/** + * Simple object passed to the + * [startActivityForResult](Titanium.Android.Activity.startActivityForResult) callback. + */ +interface ActivityResult { + /** + * Unique, automatically generated integer request code. + */ + requestCode?: number; + + /** + * Integer result code that the started activity passed to + * [setResult](Titanium.Android.Activity.setResult). + */ + resultCode?: number; + + /** + * Intent that can contain data returned to the caller. Data can be attached to + * the intent as "extras"). + */ + intent?: Titanium.Android.Intent; + +} + +/** + * Options passed to . + */ +interface ServiceIntentOptions { + /** + * URL for the service's JavaScript. + */ + url?: string; + + /** + * One of the `START_` constants from to specify the "stickiness" of the Service when Android shuts down the host application. + */ + startMode?: number; + } -declare class PlayerQueue { - items : Array; +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestPermissionAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface CalendarPermissionResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code, if any returned. + */ + code?: number; + +} + +/** + * Parameter for wakeLock + */ +interface wakeLockOptions { + /** + * Minimum time the device will be switched on (plus device switch-off time) + */ + time?: number; + + /** + * Wake lock level and flag. See [PowerManager.newWakeLock in the Android API Reference](https://developer.android.com/reference/android/os/PowerManager.html#newWakeLock(int,%20java.lang.String)) + */ + flags?: number; + +} + +/** + * Dictionary of options for the method. + */ +interface showParams { + /** + * String to be used as title for the dialog. + */ + title?: string; + + /** + * String to be used as a message for the dialog. + */ + message?: string; + + /** + * Array of String instances. + */ + buttonNames?: string[]; + + /** + * Array of String instances. + */ + options?: string[]; + + /** + * Determines whether to animate the dialog as it is shown. + */ + animated?: boolean; + + /** + * View to which to attach the dialog. + */ + view?: Titanium.UI.View; + + /** + * Positions the arrow of the option dialog relative to the attached view's dimensions. + */ + rect?: Dimension; + +} + +/** + * Dictionary describing the arguments passed to the application on startup. + * Use the [getArguments](Titanium.App.getArguments) method to retrieve the launch options. + */ +interface launchOptions { + /** + * This key indicates that the application was launched in order to open + * the specified URL. + */ + url?: string; + + /** + * This key indicates that the application was launched by another + * application with the specified bundle ID. + */ + source?: string; + + /** + * If set to `true`, this key indicates that the application was launched in response to an + * incoming location event. + */ + launchOptionsLocationKey?: boolean; + +} + +/** + * Dictionary object of parameters used to create a notification using + * . + */ +interface NotificationParams { + /** + * Alert button text ('Open', by default) or slider text ('slide to unlock...', by default) + * to display. + */ + alertAction?: string; + + /** + * Alert message to display. + */ + alertBody?: string; + + /** + * Alert title to display. Available since Titanium SDK 5.4.0. + */ + alertTitle?: string; + + /** + * Image to display instead of `Default.png` when launching the application. + */ + alertLaunchImage?: string; + + /** + * Application badge value. + */ + badge?: number; + + /** + * String identifier of category of actions to be displayed for an interactive + * notification (only for iOS 8 and above). + */ + category?: string; + + /** + * Date and time for the notification to occur. + */ + date?: Date; + + /** + * Interval to repeat the notification. One of `weekly`, `daily`, `yearly,` `monthly`. + */ + repeat?: string; + + /** + * Path to the sound file to play when notification occurs, relative to the `Resources` folder. + */ + sound?: string; + + /** + * Timezone of the date configured for the notification. If not set, the system timezone is used. + */ + timezone?: string; + + /** + * Data to pass to the application with the notification event. + */ + userInfo?: any; + + /** + * Region the notification will be triggered in. Allowed parameter are: + * - `latitude`: Latitude of the location center, in decimal degrees (required). + * - `longitude`: Longitude of the location center, in decimal degrees (required). + * - `triggersOnce`: Whether or not the notification will only fire once (optional, default: true). + * - `identifier`: Identifier of the region (optional). + */ + region?: any; + +} + +/** + * Dictionary object of parameters used to identify an incoming URL that is handled + * by the application. + */ +interface LaunchOptionsType { + /** + * The application or service that triggered the handled URL. + */ + source?: string; + + /** + * The url that was triggered by the application or service. + */ + url?: string; + +} + +/** + * Dictionary object of parameters used to register the application with local notifications using + * the method. + * To retrieve the current notification settings, use the + * property. + */ +interface UserNotificationSettings { + /** + * Notification types to use. + */ + types?: number[]; + + /** + * Set of categories of user notification actions required by the applicaiton to use. + */ + categories?: Titanium.App.iOS.UserNotificationCategory[]; + +} + +/** + * Simple object used to specify options for [imageAsCropped](Titanium.Blob.imageAsCropped). + */ +interface ImageAsCroppedDict { + /** + * Width to crop this image to. + */ + width?: number; + + /** + * Height to crop this image to. + */ + height?: number; + + /** + * Left coordinate of the cropped rectangle within the source image. + */ + x?: number; + + /** + * Top coordinate of the cropped rectangle within the source image. + */ + y?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface EventsAuthorizationResponse { + /** + * Indicates whether the request succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code, if any returned. + */ + code?: number; + +} + +/** + * Dictionary containing `daysOfWeek` and `week`. + */ +interface daysOfTheWeekDictionary { + /** + * The day of the week. Values are from 1 to 7, with Sunday being 1. + */ + daysOfWeek?: number; + + /** + * The week number of the day of the week. + * Values range from -53 to 53. A negative value indicates a value from the end of + * the range. 0 indicates the week number is irrelevant. + */ + week?: number; + +} + +/** + * Dictionary containing either `endDate` or `occurrenceCount` property. + */ +interface recurrenceEndDictionary { + /** + * End date of the recurrence end, or undefined if the recurrence end is count-based. + */ + endDate?: Date; + + /** + * Occurrence count of the recurrence end, or 0 if the recurrence end is date-based. + */ + occurrenceCount?: number; + +} + +/** + * Named parameters for . + */ +interface EncodeNumberDict { + /** + * Number to encode. + */ + source: number; + + /** + * Destination buffer. + */ + dest: Titanium.Buffer; + + /** + * Encoding type to use. + */ + type: string; + + /** + * Index in the `dest` buffer of the first byte of encoded data. + */ + position?: number; + + /** + * Byte order to encode with. + */ + byteOrder?: number; + +} + +/** + * Named parameters for . + */ +interface DecodeNumberDict { + /** + * Buffer to decode. + */ + source: Titanium.Buffer; + + /** + * The encoding type to use. + */ + type: string; + + /** + * Index in the `source` buffer of the first byte of data to decode. + */ + position?: number; + + /** + * byte order to decode with. + */ + byteOrder?: number; + +} + +/** + * Named parameters for . + */ +interface EncodeStringDict { + /** + * Source string to encode. + */ + source: string; + + /** + * Destination buffer. + */ + dest: Titanium.Buffer; + + /** + * Index in the `dest` buffer of the first byte of the encoded string. + */ + destPosition?: number; + + /** + * Position in `source` to start encoding. + */ + sourcePosition?: number; + + /** + * Number of characters in `source` to encode. + */ + sourceLength?: number; + + /** + * Character encoding to use when encoding this string to bytes. + */ + charset?: string; + +} + +/** + * Named parameters for . + */ +interface DecodeStringDict { + /** + * Buffer to decode. + */ + source: Titanium.Buffer; + + /** + * Index in the `source` buffer of the first byte of data to decode. + */ + position?: number; + + /** + * Number of bytes to decode. + */ + length?: number; + + /** + * Character set to use when encoding this string to bytes. + */ + charset?: string; + +} + +/** + * Dictionary of options for the method. + */ +interface showContactsParams { + /** + * Determines whether to animate the show/hide of the contacts picker (iPhone, iPad only.) + */ + animated?: boolean; + + /** + * Field names to show when selecting properties. By default, shows all available. + */ + fields?: string[]; + + /** + * Function to call when selection is canceled. + */ + cancel?: (param0: any) => any; + + /** + * Function to call when a person is selected. Must not be used with `selectedProperty` property. + */ + selectedPerson?: (param0: any) => any; + + /** + * Function to call when a property is selected. Must not be used with `selectedPerson` + * property. + * Note: If ringtone or texttone is selected, null values are returned, since these are unsupported + * by Apple. + * Since iOS 9.0, there is a native apple issue whereby it may return null if the birthday property + * is selected on certain device models. + * The callback contains the selected property and a 'person' object of type . + * Since iOS 9.0, apple only returns the person object with partial information. Currently it is known to + * at least contain the selected property and fullName. + */ + selectedProperty?: (param0: any) => any; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface ContactsAuthorizationResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Properties used in any event or callback which needs to report a success or failure. + */ +interface ErrorResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Properties used in any event or callback which needs to report a success. + */ +interface SuccessResponse { + /** + * Indicates if the operation succeeded. Returns `true`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0. + */ + code?: number; + +} + +/** + * Properties used in any event or callback which needs to report a failure. + */ +interface FailureResponse { + /** + * Indicates if the operation succeeded. Returns `false`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns a non-zero value. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestStorageAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the [getCurrentPosition](Titanium.Geolocation.getCurrentPosition) callback. + */ +interface LocationResults { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * If `success` is true, object describing the location provider generating this update. + */ + provider?: LocationProviderDict; + + /** + * If `success` is true, actual location data for this update. + */ + coords?: LocationCoordinates; + +} + +/** + * Simple object holding the data for a location update. + */ +interface LocationCoordinates { + /** + * Latitude of the location update, in decimal degrees. + */ + latitude?: number; + + /** + * Longitude of the location update, in decimal degrees. + */ + longitude?: number; + + /** + * Altitude of the location update, in meters. + */ + altitude?: number; + + /** + * Accuracy of the location update, in meters. + */ + accuracy?: number; + + /** + * Vertical accuracy of the location update, in meters. + */ + altitudeAccuracy?: number; + + /** + * Compass heading, in degrees. May be unknown if device is not moving. On + * iOS, a negative value indicates that the heading data is not valid. + */ + heading?: number; + + /** + * Current speed in meters/second. On iOS, a negative value indicates that the + * heading data is not valid or the accuracy is configured incorrectly. + * Note: Due to the Apple Geolocation API, set the + * property to in order to properly + * measure speed changes and prevent the app from returning negative values. + */ + speed?: number; + + /** + * Timestamp for this location update, in milliseconds. + */ + timestamp?: number; + + /** + * The floor of the building on which the user is located. Available in iOS 8.0 and later. + */ + floor?: LocationCoordinatesFloor; + +} + +/** + * Simple object holding floor of the building on which the user is located. + * In places where floor information can be determined. + */ +interface LocationCoordinatesFloor { + /** + * The logical floor of the building. + */ + level?: number; + +} + +/** + * Simple object returned in the callback from the + * [forwardGeocoder](Titanium.Geolocation.forwardGeocoder) method. + * Note that Android includes a number of extra fields. + */ +interface ForwardGeocodeResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Estimated accuracy of the geocoding, in meters. + */ + accuracy?: number; + + /** + * Longitude of the geocoded address. + */ + longitude?: string; + + /** + * Latitude of the geocoded address. + */ + latitude?: string; + + /** + * Street name, without street address. + */ + street?: string; + + /** + * Street name. + */ + street1?: string; + + /** + * City name. + */ + city?: string; + + /** + * First line of region. + */ + region1?: string; + + /** + * Not used. + */ + region2?: string; + + /** + * Postal code. + */ + postalCode?: string; + + /** + * Country name. + */ + country?: string; + + /** + * Country code. + */ + countryCode?: string; + + /** + * Country code. Same as `countryCode`. + */ + country_code?: string; + + /** + * Display address. Identical to `address`. + */ + displayAddress?: string; + + /** + * Full address. + */ + address?: string; + +} + +/** + * Argument passed to the [getCurrentHeading](Titanium.Geolocation.getCurrentHeading) callback. + */ +interface HeadingResponse { + /** + * Indicates a successful operation. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. + */ + code?: number; + + /** + * If `success` is true, the actual heading data. + */ + heading?: HeadingData; + +} + +/** + * Simple object holding compass heading data. + */ +interface HeadingData { + /** + * Accuracy of the compass heading, in platform-specific units. + */ + accuracy?: number; + + /** + * Declination in degrees from magnetic North. + */ + magneticHeading?: number; + + /** + * Declination in degrees from true North. + */ + trueHeading?: number; + + /** + * Timestamp for the heading data, in milliseconds. + */ + timestamp?: number; + + /** + * Raw geomagnetic data for the X axis. + */ + x?: number; + + /** + * Raw geomagnetic data for the Y axis. + */ + y?: number; + + /** + * Raw geomagnetic data for the Z axis. + */ + z?: number; + +} + +/** + * Simple object describing a location provider. + */ +interface LocationProviderDict { + /** + * Accuracy of the location provider, either fine (1) or coarse (2). + */ + accuracy?: number; + + /** + * Name of the location provider. + */ + name?: string; + + /** + * Power consumption for this provider, either low (1), medium (2), or high (3). + */ + power?: number; + +} + +/** + * Simple object returned in the callback from the + * [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) method. + */ +interface ReverseGeocodeResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * An array of reverse-geocoded addresses matching the requested location. + */ + places?: GeocodedAddress[]; + +} + +/** + * Simple object representing a place, returned in the callback from the + * [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) method. + */ +interface GeocodedAddress { + /** + * Street name, without street address. + */ + street?: string; + + /** + * Street name. + */ + street1?: string; + + /** + * City name. + */ + city?: string; + + /** + * First line of region. + */ + region1?: string; + + /** + * Not used. + */ + region2?: string; + + /** + * Postal code. On iOS, use `zipcode`. + */ + postalCode?: string; + + /** + * Postal code. On Android, use `postalCode`. + */ + zipcode?: string; + + /** + * Country name. + */ + country?: string; + + /** + * Country code. On iOS, use `country_code`. + */ + countryCode?: string; + + /** + * Country code. Same as `country_code`. + */ + country_code?: string; + + /** + * Longitude of the geocoded point. + */ + longitude?: string; + + /** + * Latitude of the geocoded point. + */ + latitude?: string; + + /** + * Display address. Identical to `address`. + */ + displayAddress?: string; + + /** + * Full address. + */ + address?: string; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface LocationAuthorizationResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Simple object representing a map location and zoom level. + */ +interface MapRegionType { + /** + * Longitude value for the center point of the map, in decimal degrees. + */ + longitude?: number; + + /** + * Latitude value for the center point of the map, in decimal degrees. + */ + latitude?: number; + + /** + * The amount of east-to-west distance displayed on the map, measured in decimal degrees. + */ + longitudeDelta?: number; + + /** + * The amount of north-to-south distance displayed on the map, measured in decimal degrees. + */ + latitudeDelta?: number; + +} + +/** + * Simple object used as an argument to [setLocation](Titanium.Map.View.setLocation). + */ +interface MapLocationType { + /** + * Longitude value for the center point of the map, in decimal degrees. + */ + longitude?: number; + + /** + * Latitude value for the center point of the map, in decimal degrees. + */ + latitude?: number; + + /** + * The amount of east-to-west distance displayed on the map, measured in decimal degrees. + */ + longitudeDelta?: number; + + /** + * The amount of north-to-south distance displayed on the map, measured in decimal degrees. + */ + latitudeDelta?: number; + + /** + * Set to `true` to animate the move to the new location. + */ + animate?: boolean; + + /** + * If `true`, the specified region is modified to fit the aspect ratio of the + * map view, while remaining centered on `latitude`,`longitude`. + */ + regionFit?: boolean; + +} + +/** + * Simple object defining a map route. + */ +interface MapRouteType { + /** + * Route name. + */ + name: string; + + /** + * Array of map points making up the route. + */ + points: MapPointType[]; + + /** + * Color to use when drawing the route, as a color name or hex triplet. + */ + color?: string; + + /** + * Line width to use when drawing the route. + */ + width?: number; + +} + +/** + * Simple object representing a point on the map. + */ +interface MapPointType { + /** + * Longitude value of the map point, in decimal degrees. + */ + longitude?: number; + + /** + * Latitude value of the map point, in decimal degrees. + */ + latitude?: number; + +} + +/** + * Simple object passed to the [scanMediaFiles](Titanium.Media.Android.scanMediaFiles) callback. + */ +interface MediaScannerResponse { + /** + * Path to the media file that was scanned. + */ + path?: string; + + /** + * URI to the file if it was scanned and added to the media library, or `null` + * if the file was not added. + */ + uri?: string; + +} + +/** + * Simple object for specifying options to [openMusicLibrary](Titanium.Media.openMusicLibrary). + */ +interface MusicLibraryOptionsType { + /** + * Function to call when the music library selection is made. + */ + success?: (param0: MusicLibraryResponseType) => any; + + /** + * Function to call upon receiving an error. + */ + error?: (param0: FailureResponse) => any; + + /** + * Function to call if the user presses the cancel button. + */ + cancel?: (param0: FailureResponse) => any; + + /** + * Specifies that the library should be hidden automatically after media selection is completed. + */ + autohide?: boolean; + + /** + * Boolean if the dialog should be animated when showing and hiding. + */ + animated?: boolean; + + /** + * An array of media type constants defining selectable media. + */ + mediaTypes?: number | number[]; + + /** + * Set to `true` to allow the user to select multiple items from the library. + */ + allowMultipleSelections?: boolean; + +} + +/** + * Simple object passed to the [openMusicLibrary](Titanium.Media.openMusicLibrary) + * `success` callback function. + */ +interface MusicLibraryResponseType { + /** + * A single representative of the selected items. + */ + representative?: Titanium.Media.Item; + + /** + * A list of all the items chosen by the user. + */ + items?: Titanium.Media.Item[]; + + /** + * Media types in this collection, represented as the bitwise OR of the media type + * values for all media types represented in `items`. + */ + types?: number; + +} + +/** + * A specifier for a media library query. By default, filters perform an exact match. + */ +interface MediaQueryType { + /** + * A constant that specifies the ordering of the result array. + */ + grouping?: number; + + /** + * The media type to filter on. + */ + mediaType?: MediaQueryInfoType | number; + + /** + * The title to filter on. Value should be a String. + */ + title?: MediaQueryInfoType | string; + + /** + * The album title to filter on. Value should be a String. + */ + albumTitle?: MediaQueryInfoType | string; + + /** + * The artist to filter on. Value should be a String. + */ + artist?: MediaQueryInfoType | string; + + /** + * The album artist to filter on. Value should be a String. + */ + albumArtist?: MediaQueryInfoType | string; + + /** + * The genre to filter on. Value should be a String. + */ + genre?: MediaQueryInfoType | string; + + /** + * The composer to filter on. Value should be a String. + */ + composer?: MediaQueryInfoType | string; + + /** + * Filter by whether or not the item is a compilation. + * The value should be a Boolean. + */ + isCompilation?: MediaQueryInfoType | boolean; + + /** + * The play count to filter on. Value should be a Number. + */ + playCount?: MediaQueryInfoType | number; + + /** + * The persistent ID to filter on. Value should be a Number. + */ + persistentID?: MediaQueryInfoType | number; + + /** + * The album persistent ID to filter on. Value should be a Number. + */ + albumPersistentID?: MediaQueryInfoType | number; + + /** + * The album artist persistent ID to filter on. Value should be a Number. + */ + albumArtistPersistentID?: MediaQueryInfoType | number; + + /** + * The genre persistent ID to filter on. Value should be a Number. + */ + genrePersistentID?: MediaQueryInfoType | number; + + /** + * The composer persistent ID to filter on. Value should be a Number. + */ + composerPersistentID?: MediaQueryInfoType | number; + + /** + * Filter by whether or not the item is a cloud item. + * Value should be a Boolean. + */ + isCloudItem?: MediaQueryInfoType | boolean; + + /** + * Filter by whether or not the item is a protected asset. + * Value should be a Boolean. + */ + hasProtectedAsset?: MediaQueryInfoType | boolean; + + /** + * The podcast title to filter on. Value should be a String. + */ + podcastTitle?: MediaQueryInfoType | string; + + /** + * The podcast persistent ID to filter on. Value should be a Number. + */ + podcastPersistentID?: MediaQueryInfoType | number; + +} + +/** + * A full query descriptor for a filtering predicate. + */ +interface MediaQueryInfoType { + /** + * The value for the given predicate. See the descriptions in for information about which properties require which values. + */ + value?: number | string | boolean; + + /** + * Whether or not the predicate is for an exact match. The default is `true`. + */ + exact?: boolean; + +} + +/** + * Simple object for specifying options to [showCamera](Titanium.Media.showCamera). + */ +interface CameraOptionsType { + /** + * Function to call when the camera is closed after a successful capture/selection. + */ + success?: (param0: CameraMediaItemType) => any; + + /** + * Function to call upon receiving an error. + */ + error?: (param0: FailureResponse) => any; + + /** + * Function to call if the user presses the cancel button. + */ + cancel?: (param0: FailureResponse) => any; + + /** + * Specifies if the camera should be hidden automatically after the media capture is completed. + */ + autohide?: boolean; + + /** + * Specifies if the dialog should be animated upon showing and hiding. + */ + animated?: boolean; + + /** + * Specifies if the media should be saved to the photo gallery upon successful capture. + */ + saveToPhotoGallery?: boolean; + + /** + * Specifies if the media should be editable after capture/selection. + */ + allowEditing?: boolean; + + /** + * Array of media type constants to allow. Note: If you want to select live photos, iOS only allows + * you to select existing live photos from the gallery, capturing new live photos is not supported by + * iOS public API, yet. + */ + mediaTypes?: string[]; + + /** + * Maximum duration (in milliseconds) to allow video capture before completing. + */ + videoMaximumDuration?: number; + + /** + * Constant to indicate the video quality during capture. + */ + videoQuality?: number; + + /** + * Opens the camera with the specified camera direction. + */ + whichCamera?: number; + + /** + * Indicates if the built-in camera controls should be displayed. + */ + showControls?: boolean; + + /** + * View to added as an overlay to the camera UI (on top). + */ + overlay?: Titanium.UI.View; + + /** + * Transformation matrix to apply to the camera or photogallery view. + */ + transform?: Titanium.UI.Matrix2D; + + /** + * Show the camera in a popover. + */ + inPopOver?: boolean; + + /** + * View to position the camera or photo gallery popover on top of. + */ + popoverView?: Titanium.UI.View; + + /** + * Controls the type of arrow and position of the popover. + */ + arrowDirection?: number; + + /** + * Determines if the camera preview should rotate or not. + */ + autorotate?: boolean; + +} + +/** + * Simple object for specifying options to + * [openPhotoGallery](Titanium.Media.openPhotoGallery). + */ +interface PhotoGalleryOptionsType { + /** + * Function to call when the photo gallery is closed after a successful selection. + */ + success?: (param0: CameraMediaItemType) => any; + + /** + * Function to call upon receiving an error. + */ + error?: (param0: FailureResponse) => any; + + /** + * Function to call if the user presses the cancel button. + */ + cancel?: (param0: FailureResponse) => any; + + /** + * Specifies if the photo gallery should be hidden automatically after the media + * selection is completed. + */ + autohide?: boolean; + + /** + * Specifies if the dialog should be animated upon showing and hiding. + */ + animated?: boolean; + + /** + * Specifies if the media should be editable after capture/selection. + */ + allowEditing?: boolean; + + /** + * Array of media type constants to allow. If you want to allow live photos with + * on iOS 9.1 and later, you also need to specify + * at least as a fallback. If you do not allow live + * photos, they still can be selected, but will be represented as a normal photo (static). + */ + mediaTypes?: string[]; + + /** + * View to position the photo gallery popover on top of. + */ + popoverView?: Titanium.UI.View; + + /** + * Controls the type of arrow and position of the popover. + */ + arrowDirection?: number; + + /** + * Specifies if the user should be able to select multiple photos. + */ + allowMultiple?: boolean; + +} + +/** + * A media object from the camera or photo gallery. + */ +interface CameraMediaItemType { + /** + * Indicates if the operation succeeded. Returns `true`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0. + */ + code?: number; + + /** + * The media object, as a [Blob](Titanium.Blob). + */ + media?: Titanium.Blob; + + /** + * The type of media, either `MEDIA_TYPE_PHOTO`, `MEDIA_TYPE_LIVEPHOTO` or `MEDIA_TYPE_VIDEO` defined in . + */ + mediaType?: string; + + /** + * Simple object defining the user's selected crop rectangle, or `null` if the user has not edited the photo. + */ + cropRect?: CropRectType; + + /** + * Simple object defining the preview image size. + */ + previewRect?: PreviewRectType; + + /** + * The live photo object, as a and + * `undefined` if no live photo is selected. + */ + livePhoto?: Titanium.UI.iOS.LivePhoto; + +} + +/** + * Simple object for describing the crop rectangle for an image. + */ +interface CropRectType { + /** + * X coordinate of the crop rectangle's upper-left corner. + */ + x?: number; + + /** + * Y coordinate of the crop rectangle's upper-left corner. + */ + y?: number; + + /** + * Width of the crop rectangle, in pixels. + */ + width?: number; + + /** + * Height of the crop rectangle, in pixels. + */ + height?: number; + +} + +/** + * Simple object for describing the preview image rectangle. This will be undefined when custom camera overlay is not used. + */ +interface PreviewRectType { + /** + * Width preview image, in pixels. + */ + width?: number; + + /** + * Height preview image, in pixels. + */ + height?: number; + +} + +/** + * Options passed to . + */ +interface PreviewImageOptions { + /** + * The image to preview. Must be a blob based on a file, such as from . + */ + image?: Titanium.Blob; + + /** + * Function to be called back if the preview succeeds. No info is passed. + */ + success?: (param0: any) => any; + + /** + * Function called back if the preview fails. Check the `message` property of passed back parameter. + */ + error?: (param0: PreviewImageError) => any; + +} + +/** + * The parameter passed to the `error` callback of . + */ +interface PreviewImageError { + /** + * Indicates if the operation succeeded. Returns `false`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code, if applicable. + */ + code?: number; + + /** + * Description of the error. + */ + message?: string; + +} + +/** + * The parameter passed to the callback. + */ +interface ScreenshotResult { + /** + * The screenshot image. + */ + media?: Titanium.Blob; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface MediaAuthorizationResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestCameraAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestMusicLibraryAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Argument passed to the callback when a request finishes successfully or erroneously. + */ +interface RequestPhotoGalleryAccessResult { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * An Object describing the current audio route. + */ +interface RouteDescription { + /** + * An Array of current input ports for the session. See the `AUDIO_SESSION_PORT` constants. + */ + inputs?: any[]; + + /** + * An Array of current output ports for the session. See the `AUDIO_SESSION_PORT` constants. + */ + outputs?: any[]; + +} + +/** + * Simple object passed to the thumbnail callback in response to the + * [requestThumbnailImagesAtTimes](Titanium.Media.VideoPlayer.requestThumbnailImagesAtTimes) + * method. + */ +interface ThumbnailResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Thumbnail image, as a `Blob`. + */ + image?: Titanium.Blob; + + /** + * Time offset for the thumbnail, in seconds. + */ + time?: number; + +} + +/** + * Simple object used to describe the size of a movie. + */ +interface MovieSize { + /** + * Width of the movie. + */ + width?: number; + + /** + * Height of the movie. + */ + height?: number; + +} + +/** + * The protocol that the must implement. + */ +interface SecurityManagerProtocol { + /** + * Returns if the security manager will participate in authentication of this end point. + */ + willHandleURL(url: any): boolean; + + /** + * The for this connection. + */ + connectionDelegateForUrl(url: any): APSConnectionDelegate; + + /** + * Returns an array of objects implementing the [X509TrustManager](http://developer.android.com/reference/javax/net/ssl/X509TrustManager.html) protocol for the SSL Context. + */ + getTrustManagers(proxy: any): any[]; + + /** + * Returns an array of objects implementing the [X509KeyManager](http://developer.android.com/reference/javax/net/ssl/X509KeyManager.html) protocol for the SSL Context. + */ + getKeyManagers(proxy: any): any[]; + +} + +/** + * An extension of the [NSURLConnectionDelegate](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate) protocol to allow users to participate in authentication and resource management for this HTTPClient. + */ +interface APSConnectionDelegate { +} + +/** + * An Object describing the current ready state. See [onreadystatechange](Titanium.Network.HTTPClient.onreadystatechange) for more information. + */ +interface ReadyStatePayload { + /** + * The state for which `onreadystatechange` was invoked. Set to one of `Titanium.Network.HTTPClient` ready-state constants + */ + readyState?: number; + +} + +/** + * Simple object for specifying push notification options to + * [registerForPushNotifications](Titanium.Network.registerForPushNotifications). + */ +interface PushNotificationConfig { + /** + * Array of `NOTIFICATION_TYPE` constants that the application would like to receive. + */ + types?: number[]; + + /** + * Callback function called when the push registration is successfully completed. + */ + success?: (param0: PushNotificationSuccessArg) => any; + + /** + * Callback function called when an error occurs during registration. + */ + error?: (param0: PushNotificationErrorArg) => any; + + /** + * Callback function invoked upon receiving a new push notification. + */ + callback?: (param0: PushNotificationData) => any; + +} + +/** + * A simple object passed to the + * [registerForPushNotifications](Titanium.Network.registerForPushNotifications) success callback. + */ +interface PushNotificationSuccessArg { + /** + * Indicates if the operation succeeded. Returns `true`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0. + */ + code?: number; + + /** + * The value of this string is always "remote". + */ + type?: string; + + /** + * The device token which this device was registered for. + */ + deviceToken?: string; + +} + +/** + * A simple object passed to the + * [registerForPushNotifications](Titanium.Network.registerForPushNotifications) error callback. + */ +interface PushNotificationErrorArg { + /** + * Indicates if the operation succeeded. Returns `false`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns a non-zero value. + */ + code?: number; + + /** + * The value of this string is always "remote". + */ + type?: string; + +} + +/** + * A simple object representing a push notification. + */ +interface PushNotificationData { + /** + * The `userinfo` dictionary passed to the Apple Push Notification Service. + */ + data?: any; + + /** + * Boolean indicating if notification was received while app was in background. + * This property became available in Titanium Mobile 3.1.0 for iOS. + */ + inBackground?: boolean; + +} + +/** + * Argument object passed to the [connected](Titanium.Network.Socket.TCP.connected) callback when the socket connects. + */ +interface ConnectedCallbackArgs { + /** + * Socket instance that has been connected. + */ + socket?: Titanium.Network.Socket.TCP; + +} + +/** + * Object passed to the error callback when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state. + */ +interface ErrorCallbackArgs { + /** + * Indicates if the operation succeeded. Returns `false`. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns a non-zero value. + */ + code?: number; + + /** + * Socket that experienced the error. + */ + socket?: Titanium.Network.Socket.TCP; + + /** + * The error code of the error (potentially system-dependent). + */ + errorCode?: number; + +} + +/** + * Argument object passed to the [accepted](Titanium.Network.Socket.TCP.accepted) + * callback when a listener accepts a connection. + */ +interface AcceptedCallbackArgs { + /** + * Socket which received the connection. + */ + socket?: Titanium.Network.Socket.TCP; + + /** + * Socket which represents the inbound connection. + */ + inbound?: Titanium.Network.Socket.TCP; + +} + +/** + * Options object for the [accept](Titanium.Network.Socket.TCP.accept) method. + */ +interface AcceptDict { + /** + * Timeout, in milliseconds, for all `write` operations. + */ + timeout?: number; + + /** + * Callback to be fired when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state. + */ + error?: (param0: ErrorCallbackArgs) => any; + +} + +/** + * Argument passed to [createStream](Titanium.Stream.createStream). + */ +interface CreateStreamArgs { + /** + * Object that the stream will read from or write to. + */ + source?: Titanium.Blob | Titanium.Buffer; + + /** + * Mode to open the stream in. + */ + mode?: number; + +} + +/** + * Argument passed to the read callback when an asynchronous [read](Titanium.Stream.read) operation + * finishes. + */ +interface ReadCallbackArgs { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Stream being read. + */ + source?: Titanium.IOStream; + + /** + * Number of bytes processed, or -1 in the event of an error or end of stream. + */ + bytesProcessed?: number; + + /** + * Whether an error was encountered. Set to 1 in the case of an error, 0 + * otherwise. + */ + errorState?: number; + + /** + * Text description of the error. + */ + errorDescription?: string; + +} + +/** + * Argument passed to the write callback when an asynchronous + * [write](Titanium.Stream.write) operation + * finishes. + */ +interface WriteCallbackArgs { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Stream being written to. + */ + source?: Titanium.IOStream; + + /** + * Number of bytes processed, or -1 in the event of an error or end of stream. + */ + bytesProcessed?: number; + + /** + * Whether an error was encountered. Set to 1 in the case of an error, 0 + * otherwise. + */ + errorState?: number; + + /** + * Text description of the error. + */ + errorDescription?: string; + +} + +/** + * Argument passed to the callback when an asynchronous + * [writeStream](Titanium.Stream.writeStream) operation finishes. + */ +interface WriteStreamCallbackArgs { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Stream being read from. + */ + fromStream?: Titanium.IOStream; + + /** + * Stream being written to. + */ + toStream?: Titanium.IOStream; + + /** + * Number of bytes processed, or -1 in the event of an error or end of stream. + */ + bytesProcessed?: number; + + /** + * Whether an error was encountered. Set to 1 in the case of an error, 0 + * otherwise. + */ + errorState?: number; + + /** + * Text description of the error. + */ + errorDescription?: string; + +} + +/** + * Argument passed to the callback each time the + * [pump](Titanium.Stream.pump) operation has new data to deliver. + */ +interface PumpCallbackArgs { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Stream being read from. + */ + source?: Titanium.IOStream; + + /** + * Buffer object holding the data currently being pumped to the handler method. + */ + buffer?: Titanium.Buffer; + + /** + * Number of bytes being passed to this invocation of the handler, or + * -1 in the event of an error or end of stream. + */ + bytesProcessed?: number; + + /** + * Total number of bytes read from the stream so far, + * including the data passed to this current invocation of the handler. + */ + totalBytesProcessed?: number; + + /** + * Whether an error was encountered. Set to 1 in the case of an error, 0 + * otherwise. + */ + errorState?: number; + + /** + * Text description of the error. + */ + errorDescription?: string; + +} + +/** + * Arguments to be passed to createBuffer + */ +interface CreateBufferArgs { + /** + * An initial value which will be encoded and placed in the buffer. If value is a Number, type must also be set. (this is simply a convenient way of calling or and placing the encoded value in the returned buffer.) + */ + value?: string | number; + + /** + * The length of the buffer. + */ + length?: number; + + /** + * The type of data encoding to use with `value`. + */ + type?: string; + + /** + * The byte order of this buffer. + */ + byteOrder?: number; + +} + +/** + * Simple object passed to to initialize a matrix. + */ +interface MatrixCreationDict { + /** + * Scale the matrix by the specified scaling factor. The same scaling factor is used + * for both horizontal and vertical scaling. + */ + scale?: number; + + /** + * Rotation angle, in degrees. See the [rotate](Titanium.UI.2DMatrix.rotate) method + * for a discussion of rotation. + */ + rotate?: number; + + /** + * Point to rotate around, specified as a dictionary object with `x` and `y` + * properties, where { x: 0.5, y: 0.5 } represents the center of whatever is being + * rotated. + */ + anchorPoint?: any; + +} + +/** + * An abstract datatype for specifying an attributed string attribute. + */ +interface Attribute { + /** + * Attribute to apply to the text. + */ + type: number; + + /** + * Attribute value. + */ + value: number; + + /** + * Attribute range. + */ + range: number[]; + } + +/** + * Dictionary describing the items for . + */ +interface ClipboardItemsType { + /** + * An array of key-value items to add to the clipboard. The key must a valid mime-type + * matching the mime-type of the value. + */ + items?: any[]; + + /** + * The privacy options to apply to all the items on the clipboard. The available options are + * described in `Ti.UI.CLIPBOARD_OPTION_*`. Depending on the key, the value can be a Date or + * Boolean. + */ + options?: any; -declare class CoverFlowImageType { - height : number; - image : any; - width : number; } + +/** + * An abstract datatype for specifying a text font. + */ +interface Font { + /** + * Specifies the font family or specific font to use. + */ + fontFamily?: string; + + /** + * Font size, in platform-dependent units. + */ + fontSize?: number | string; + + /** + * Font weight. Valid values are "bold", "semibold", "normal", "thin", + * "light" and "ultralight". + */ + fontWeight?: string; + + /** + * Font style. Valid values are "italic" or "normal". + */ + fontStyle?: string; -declare class BroadcastIntentOptions { - action : string; - className : string; - data : string; - flags : number; - packageName : string; - url : string; + /** + * The text style for the font. + */ + textStyle?: string; + } + +/** + * Template that represents the basic appearance of a list item. + */ +interface ItemTemplate { + /** + * Contains key-value pairs of view properties and their values that are applied to the ListItem. + */ + properties?: any; + + /** + * Contains key-value pairs of view events and their listeners that are applied to the ListItem. + */ + events?: any; + + /** + * Contains an array of subview templates to be added (in order) as children to this view. + */ + childTemplates?: ViewTemplate[]; -declare class CloudUsersSecureResponse extends CloudResponse { - accessToken : string; - expiresIn : number; } + +/** + * Template that represents a view subcomponent of an . + */ +interface ViewTemplate { + /** + * View's class name, for example, `Ti.UI.Button`. + */ + type: string; + + /** + * View's ID (or set of IDs) used for data binding. This value must be unique. + */ + bindId?: string; + + /** + * Contains key-value pairs of view properties and their values that are applied to this view component. + */ + properties?: any; + + /** + * Contains key-value pairs of view events and their listeners that are applied to this view component. + */ + events?: any; -declare class CloudClientsResponse extends CloudResponse { - ip_address : string; - location : Dictionary; + /** + * Contains an array of subview templates to be added (in order) as children to this view. + */ + childTemplates?: ViewTemplate[]; + } + +/** + * Represents displayed item data. + */ +interface ListDataItem { + /** + * Template ID configured with the property or + * . + */ + template?: string | number; -declare class PushNotificationErrorArg { - type : string; + /** + * Contains key-value pairs of view properties and their values that are applied to the + * `ListItem`. + */ + properties?: any; + } + +/** + * Represents the custom edit action for a ListItem. + */ +interface RowActionType { + /** + * The title of the row action. + */ + title: string; -declare class CloudStatusesResponse extends CloudResponse { - statuses : Array>; + /** + * The [identifier](RowActionType. identifier) of the row action. Only included in the event + * if previously defined. Available in Titanium 6.0.0 and later. + */ + identifier?: string; + + /** + * The style of the row action. + */ + style: number; + + /** + * The background color of the row action. + */ + color?: string; + } + +/** + * A simple object for specifying the animation properties to use when inserting or deleting + * sections or cells, or scrolling the list. + */ +interface ListViewAnimationProperties { + /** + * Whether this list change should be animated. Ignored if any `animationStyle` value is specified. + */ + animated?: boolean; -declare class windowToolbarParam { - animated : boolean; - barColor : string; - tintColor : string; - translucent : boolean; + /** + * Type of animation to use for cell insertions and deletions. + */ + animationStyle?: number; + + /** + * Specifies what position to scroll the selected cell to. + */ + position?: number; + } + +/** + * A simple object that represents an index entry in a `ListView`. + */ +interface ListViewIndexEntry { + /** + * Title to display in the index bar. + */ + title?: string; + + /** + * Section index associated with this title. + */ + index?: number; -declare class GeocodedAddress { - address : string; - city : string; - country : string; - countryCode : string; - country_code : string; - displayAddress : string; - latitude : string; - longitude : string; - postalCode : string; - region1 : string; - region2 : string; - street : string; - street1 : string; - zipcode : string; } -declare class ContactsCallbackArgs extends ErrorResponse { - data : Array; +/** + * Optional parameter for [setContentInsets](Titanium.UI.ListView.setContentInsets) method. + */ +interface ListViewContentInsetOption { + /** + * Determines whether the list view's content inset change is animated. + */ + animated?: boolean; + + /** + * The duration in `milliseconds` for animation while the content inset is being changed. + */ + duration?: number; + } + +/** + * The parameter for [setMarker](Titanium.UI.ListView.setMarker) and [addMarker](Titanium.UI.ListView.addMarker) methods. + */ +interface ListViewMarkerProps { + /** + * The sectionIndex of the reference item. + */ + sectionIndex?: number; + + /** + * The itemIndex of the reference item. + */ + itemIndex?: number; -declare class zoomScaleOption { - animated : boolean; } -declare class LocationCoordinates { - accuracy : number; - altitude : number; - altitudeAccuracy : number; - heading : number; - latitude : number; - longitude : number; - speed : number; - timestamp : number; -} +/** + * The parameter for [setContentInsets](Titanium.UI.TableView.setContentInsets) method. + */ +interface ListViewEdgeInsets { + /** + * Value specifying the top insets for the enclosing scroll view of the list view. + */ + top?: number; + + /** + * Value specifying the left insets for the enclosing scroll view of the list view. + */ + left?: number; -declare class ActivityResult { - intent : Ti.Android.Intent; - requestCode : number; - resultCode : number; -} + /** + * Value specifying the right insets for the enclosing scroll view of the list view. + */ + right?: number; + + /** + * Value specifying the bottom insets for the enclosing scroll view of the list view. + */ + bottom?: number; + +} -declare class CloudUsersSecureDialog { - title : string; -} +/** + * The arguments for the and events. + */ +interface ListItemEventType { + /** + * List section if the item is contained in a list section. + */ + section?: Titanium.UI.ListSection; -declare class CloudFriendsResponse extends CloudResponse { - users : Array>; -} - -declare class PhotoGalleryOptionsType { - allowEditing : boolean; - animated : boolean; - arrowDirection : number; - autohide : boolean; - cancel : (...args : any[]) => any; - error : (...args : any[]) => any; - mediaTypes : Array; - popoverView : Ti.UI.View; - success : (...args : any[]) => any; -} - -declare class NotificationParams { - alertAction : string; - alertBody : string; - alertLaunchImage : string; - badge : number; - category : string; - date : Date; - repeat : string; - sound : string; - timezone : string; - userInfo : Dictionary; -} + /** + * Section index. + */ + sectionIndex?: number; -declare enum SuccessResponse { + /** + * Item index. + */ + itemIndex?: number; -} + /** + * The item ID bound to the list item that generated the event. + */ + itemId?: string; -declare class daysOfTheWeekDictionary { - daysOfWeek : number; - week : number; } -declare class Modules { +/** + * Dictionary of options for the method. + */ +interface hideParams { + /** + * Determines whether to animate the dialog as it is dismissed. + */ + animated?: boolean; -} +} -declare class ReferenceInsets { - bottom : number; - left : number; - right : number; - top : number; -} +/** + * Optional parameter for [setContentOffset](Titanium.UI.ScrollView.setContentOffset) method. + */ +interface contentOffsetOption { + /** + * Determines whether the scroll view's content area change is animated. + */ + animated?: boolean; + +} -declare class hideStatusBarParams { - animated : boolean; - animationStyle : number; -} +/** + * Optional parameter for [setZoomScale](Titanium.UI.ScrollView.setZoomScale) method. + */ +interface zoomScaleOption { + /** + * Determines whether the scroll view's zooming is animated. + */ + animated?: boolean; + +} + +/** + * A simple object for specifying the animation properties when scrolling the view. + */ +interface ScrollViewAnimationProperties { + /** + * When set to `true` it will scroll smoothly to the destination. + */ + animated?: boolean; -declare class PreviewImageOptions { - error : (...args : any[]) => any; - image : Ti.Blob; - success : (...args : any[]) => any; } -declare class ListDataItem { - properties : Dictionary; - template : any; -} +/** + * Dictionary to specify edge insets for . + */ +interface TabIconInsets { + /** + * Top inset. + */ + top?: number; + + /** + * Left inset. + */ + left?: number; -declare class ItemTemplate { - childTemplates : Array; - events : Dictionary; - properties : Dictionary; } -declare class MovieSize { - height : number; - width : number; -} - -declare class CameraMediaItemType { - cropRect : CropRectType; - media : Ti.Blob; - mediaType : string; -} +/** + * A simple object for specifying the animation properties to use when inserting or deleting rows, or scrolling the table. + */ +interface TableViewAnimationProperties { + /** + * Whether this table change should be animated. Ignored if any `animationStyle` value is specified. + */ + animated?: boolean; + + /** + * Type of animation to use for row insertions and deletions. + */ + animationStyle?: number; + + /** + * Specifies what position to scroll the selected row to. + */ + position?: number; + +} -declare class HeadingResponse extends ErrorResponse { - heading : HeadingData; -} +/** + * A simple object that represents an index entry in a `TableView`. + */ +interface TableViewIndexEntry { + /** + * Title to display in the index bar for this item. + */ + title?: string; + + /** + * Row index associated with this item. + */ + index?: number; + +} -declare class ListViewEdgeInsets { - bottom : number; - left : number; - right : number; - top : number; -} - -declare class BoundaryIdentifier { - identifier : string; - point1 : Point; - point2 : Point; -} - -declare enum CloudEmailsResponse { - -} - -declare class GradientColorRef { - color : string; - offset : number; -} - -declare class Font { - fontFamily : string; - fontSize : any; - fontStyle : string; - fontWeight : string; - textStyle : string; -} - -declare class CloudPlacesResponse extends CloudResponse { - places : Array>; -} - -declare class EncodeNumberDict { - byteOrder : number; - dest : Ti.Buffer; - position : number; - source : number; - type : string; -} - -declare class showContactsParams { - animated : boolean; - cancel : (...args : any[]) => any; - fields : Array; - selectedPerson : (...args : any[]) => any; - selectedProperty : (...args : any[]) => any; -} - -declare class LocationProviderDict { - accuracy : number; - name : string; - power : number; -} - -declare class FacebookDialogResponsev1 { - cancelled : boolean; - error : string; - result : string; - success : boolean; -} - -declare class CloudFilesResponse extends CloudResponse { - files : Array>; -} - -declare class hideParams { - animated : boolean; -} - -declare class SecurityManagerProtocol { - connectionDelegateForUrl (url: any) : APSConnectionDelegate; - getKeyManagers (proxy: any) : Array; - getTrustManagers (proxy: any) : Array; - willHandleURL (url: any) : boolean; -} - -declare class openWindowParams { - activityEnterAnimation : number; - activityExitAnimation : number; - animated : boolean; - bottom : any; - fullscreen : boolean; - height : any; - left : any; - modal : boolean; - modalStyle : number; - modalTransitionStyle : number; - navBarHidden : boolean; - right : any; - top : any; - transition : number; - width : any; -} - -declare class Gradient { - backfillEnd : boolean; - backfillStart : boolean; - colors : any; - endPoint : Point; - endRadius : number; - startPoint : Point; - startRadius : number; - type : string; -} - -declare class showStatusBarParams { - animated : boolean; - animationStyle : number; -} - -declare class transitionAnimationParam { - duration : number; - tranistionTo : Ti.UI.Animation; - transitionFrom : Ti.UI.Animation; -} - -declare class MapPointType { - latitude : number; - longitude : number; -} - -declare class CloudKeyValuesResponse extends CloudResponse { - keyvalues : Array>; -} - -declare class TableViewEdgeInsets { - bottom : number; - left : number; - right : number; - top : number; -} - -declare class ReverseGeocodeResponse extends ErrorResponse { - places : Array; -} - -declare class contentOffsetOption { - animated : boolean; -} - -declare class Attribute { - range : Array; - type : number; - value : number; -} - -declare class PushNotificationSuccessArg { - deviceToken : string; - type : string; -} - -declare class PushNotificationData { - data : Dictionary; - inBackground : boolean; -} - -declare class closeWindowParams { - activityEnterAnimation : number; - activityExitAnimation : number; - animated : boolean; -} - -declare class CloudLikesResponse extends CloudResponse { - likes : Array>; -} - -declare class showParams { - animated : boolean; - rect : Dimension; - view : Ti.UI.View; -} - -declare class PreviewImageError { - message : string; -} - -declare class CloudMessagesResponse extends CloudResponse { - messages : Array>; -} - -declare class CloudPushNotificationsShowChannelResponse extends CloudResponse { - devices : Dictionary; -} - -declare class ImageAsCroppedDict { - height : number; - width : number; - x : number; - y : number; -} - -declare class UserNotificationSettings { - categories : Array; - types : Array; -} - -declare class TableViewAnimationProperties { - animated : boolean; - animationStyle : number; - position : number; -} - -declare enum MediaAuthorizationResponse { - -} +/** + * Optional parameter for [setContentInsets](Titanium.UI.TableView.setContentInsets) method. + */ +interface TableViewContentInsetOption { + /** + * Determines whether the table view's content inset change is animated. + */ + animated?: boolean; + + /** + * The duration in `milleseconds` for animation while the content inset is being changed. + */ + duration?: number; + +} + +/** + * The parameter for [setContentInsets](Titanium.UI.TableView.setContentInsets) method. + */ +interface TableViewEdgeInsets { + /** + * Value specifying the top insets for the enclosing scroll view of the table. + */ + top?: number; + + /** + * Value specifying the left insets for the enclosing scroll view of the table. + */ + left?: number; + + /** + * Value specifying the right insets for the enclosing scroll view of the table. + */ + right?: number; + + /** + * Value specifying the bottom insets for the enclosing scroll view of the table. + */ + bottom?: number; + +} + +/** + * Dictionary object of parameters for the event and property that describes + * position and length of the selected text. + */ +interface textAreaSelectedParams { + /** + * Starting position of selected text. + */ + location?: number; + + /** + * Number of characters selected. + */ + length?: number; + +} + +/** + * Dictionary object of parameters for the that describes the padding + */ +interface TextAreaPadding { + /** + * Left padding + */ + left?: number; + + /** + * Right padding + */ + right?: number; + + /** + * Top padding + */ + top?: number; + + /** + * Bottom padding + */ + bottom?: number; + +} + +/** + * Dictionary object of parameters for the property that describes + * position and length of the selected text. + */ +interface textFieldSelectedParams { + /** + * Starting position of selected text. + */ + location?: number; + + /** + * Number of characters selected. + */ + length?: number; + +} + +/** + * Dictionary object of parameters for the that describes the padding + */ +interface TextFieldPadding { + /** + * Left padding + */ + left?: number; + + /** + * Right padding + */ + right?: number; + + /** + * Top padding (Android only, since 6.1.0) + */ + top?: number; + + /** + * Bottom padding (Android only, since 6.1.0) + */ + bottom?: number; + +} + +/** + * A pair of coordinates used to describe the location of a . + */ +interface Point { + /** + * The x-axis coordinate of this point. + */ + x?: number | string; + + /** + * The y-axis coordinate of this point. + */ + y?: number | string; + +} + +/** + * A simple object defining a color gradient. + */ +interface Gradient { + /** + * Type of gradient, either 'linear' or 'radial'. + */ + type?: string; + + /** + * Start point for the gradient. + */ + startPoint?: Point; + + /** + * End point for the gradient. + */ + endPoint?: Point; + + /** + * For a radial gradient, the radius at the `startPoint`. + */ + startRadius?: number; + + /** + * For a radial gradient, the radius at the `endPoint`. + */ + endRadius?: number; + + /** + * An array of colors, as a color name or hex triplet. + */ + colors?: string[] | GradientColorRef[]; + + /** + * Set to `true` to continue filling with the starting color beyond the `startPoint`. + */ + backfillStart?: boolean; + + /** + * Set to `true` to continue filling with the final color beyond the `endPoint`. + */ + backfillEnd?: boolean; + +} + +/** + * A simple object consisting of a color and an offset. + */ +interface GradientColorRef { + /** + * Color value at this point in the gradient, as a color name or hex triplet. + */ + color?: string; + + /** + * The color's normalized position within the gradient, ranging from 0 (start) to 1 (end). + */ + offset?: number; + +} + +/** + * A simple object consisting of the position and size measurements. + */ +interface Dimension { + /** + * The height measurement. + */ + height?: number; + + /** + * The width measurement. + */ + width?: number; + + /** + * The x-axis coordinate of the position. + */ + x?: number; + + /** + * The y-axis coordinate of the position. + */ + y?: number; + +} + +/** + * Optional parameter to enable animation to [hide](Titanium.UI.View.hide) and [show](Titanium.UI.View.show). + */ +interface AnimationOption { + /** + * Determines whether to enable a circular reveal animation. + */ + animated?: boolean; + +} + +/** + * Dictionary of options for the method. + */ +interface openWindowParams { + /** + * Determines whether to use an animated effect when the window is shown. + */ + animated?: boolean; + + /** + * Window's bottom position, in platform-specific units. + */ + bottom?: number | string; + + /** + * Determines if the window is fullscreen. + */ + fullscreen?: boolean; + + /** + * Window's height, in platform-specific units. + */ + height?: number | string; + + /** + * Window's left position, in platform-specific units. + */ + left?: number | string; + + /** + * Determines whether to open the window modal in front of other windows. + */ + modal?: boolean; + + /** + * Presentation style of this modal window. + */ + modalStyle?: number; + + /** + * Transition style of this modal window. + */ + modalTransitionStyle?: number; + + /** + * For modal windows, hides the nav bar (`true`) or shows the nav bar (`false`). + */ + navBarHidden?: boolean; + + /** + * Window's right position, in platform-specific units. + */ + right?: number | string; + + /** + * Window's top position, in platform-specific units. + */ + top?: number | string; + + /** + * Transition style of this non-modal window. + */ + transition?: number; + + /** + * Window's width, in platform-specific units. + */ + width?: number | string; + + /** + * Animation resource to run on the activity (heavyweight window) being opened. + */ + activityEnterAnimation?: number; + + /** + * Animation resource to run on the activity that is being put in background as a heavyweight window is being opened above it. + */ + activityExitAnimation?: number; + +} + +/** + * Dictionary of options for the method. + */ +interface windowToolbarParam { + /** + * Defines if the toolbar is translucent. + */ + translucent?: boolean; + + /** + * Defines if the toolbar appearance is animated. + */ + animated?: boolean; + + /** + * Background color for the toolbar, as a color name or hex triplet. + */ + barColor?: string; + + /** + * The tintColor to apply to the tool bar. Applicable on iOS 7 and above. + */ + tintColor?: string; + +} + +/** + * Dictionary of options for the method. + */ +interface closeWindowParams { + /** + * Determines whether to use an animated effect when the window is closed. + */ + animated?: boolean; + + /** + * Animation resource to use for the incoming activity. + */ + activityEnterAnimation?: number; + + /** + * Animation resource to use for the outgoing activity (heavyweight window). + */ + activityExitAnimation?: number; + +} + +/** + * Dictionary of options for the property. + */ +interface titleAttributesParams { + /** + * Color of the window title, as a color name or hex triplet. + */ + color?: string; + + /** + * Font to use for the window title. + */ + font?: Font; + + /** + * Shadow color and offset for the window title. + */ + shadow?: shadowDict; + +} + +/** + * Dictionary describing the shadow effect for text. + */ +interface shadowDict { + /** + * Specifies the blur radius of the shadow. + */ + blurRadius?: number; + + /** + * Color name or hex triplet specifying the color of the shadow. + */ + color?: string; + + /** + * Dictionary with the properties `width` and `height` used as the horizontal + * and vertical offset of the shadow, respectively. + */ + offset?: any; + +} + +/** + * Object of options for . + */ +interface ShortcutParams { + /** + * The unique key for the application shortcut. + */ + itemtype: string; + + /** + * The title of the application shortcut. + */ + title: string; + + /** + * The subtitle displayed on the application shortcut. + */ + subtitle?: string; + + /** + * The icon to be displayed on the application shortcut. You can either use one of the constants like + * , a local image specified by the image path or a reference to a + * . + */ + icon?: number | string | Titanium.Contacts.Person; + + /** + * The userInfo of the application shortcut. + */ + userInfo?: any; + +} + +/** + * Dictionary to specify a boundary identifier for . + */ +interface BoundaryIdentifier { + /** + * Arbitrary identifier for the boundary + */ + identifier?: string; + + /** + * Start point for the boundary + */ + point1?: Point; + + /** + * End point for the boundary + */ + point2?: Point; + +} + +/** + * Dictionary to specify edge insets for . + */ +interface ReferenceInsets { + /** + * Top inset. + */ + top?: number; + + /** + * Left inset. + */ + left?: number; + + /** + * Right inset. + */ + right?: number; + + /** + * Bottom inset. + */ + bottom?: number; + +} + +/** + * Simple object for defining a single image in a cover flow view. + */ +interface CoverFlowImageType { + /** + * Image to use, as a local file URL, `Blob`, or `File`. + */ + image?: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Display width for the image, in Apple points. + */ + width?: number; + + /** + * Display height of the image, in Apple points. + */ + height?: number; + +} + +/** + * A simple object for specifying options when showing or dismissing a . + */ +interface DocumentViewerOptions { + /** + * Indicates whether to animate the transition. + */ + animated?: boolean; + + /** + * Anchors the options menu to the specified view. + */ + view?: Titanium.UI.View; + +} + +/** + * Dictionary of options for showing a menu popup with . + */ +interface MenuPopupShowParams { + /** + * The view where the menu pop is shown at. + */ + view: Titanium.UI.View; + + /** + * Determines whether the menu popup should be opened or closed animated. + */ + animated?: boolean; + + /** + * Indicates the arrow direction of the menu popup. + */ + arrowDirection?: number; + +} + +/** + * Dictionary of options for hiding a menu popup with . + */ +interface MenuPopupHideParams { + /** + * Determines whether the menu popup should be opened or closed animated. + */ + animated?: boolean; + +} + +/** + * Optional parameter for [setShowMasterInPortrait](Titanium.UI.iOS.SplitWindow.setShowMasterInPortrait) and + * [setMasterIsOverlayed](Titanium.UI.iOS.SplitWindow.setMasterIsOverlayed) methods. + */ +interface animationOption { + /** + * Determines whether the change is animated. + */ + animated?: boolean; + +} + +/** + * Object describing a button bar or tabbed bar item. + */ +interface BarItemType { + /** + * Button title, used if no `image` is specified. + */ + title?: string; + + /** + * Button icon. If specified, takes precedence over `title`. + */ + image?: string | Titanium.Blob | Titanium.Filesystem.File; + + /** + * Width for this button. + */ + width?: number; + + /** + * Whether the button is enabled initially. + */ + enabled?: boolean; + + /** + * A succint label associated with the bar item for the device's accessibility service. + */ + accessibilityLabel?: string; + +} + +/** + * Dictionary specifying the transition animation used with the method. + * Only supported on iOS 7 and later. + */ +interface transitionAnimationParam { + /** + * Length of the transition in milliseconds. + */ + duration?: number; + + /** + * Animation to hide the current window. + */ + transitionFrom?: Titanium.UI.Animation; + + /** + * Animation to show the new window. + */ + transitionTo?: Titanium.UI.Animation; + +} + +/** + * Dictionary of options for and . + */ +interface PopoverParams { + /** + * Indicates whether to animate showing or hiding the popover. + */ + animated?: boolean; + + /** + * Sets the arrow position of the popover relative to the attached view object's dimensions + * when showing the popover. + */ + rect?: Dimension; + + /** + * Attaches the popover to the specified view when showing the popover. + */ + view: Titanium.UI.View; + +} + +/** + * Dictionary of options for the method. + */ +interface hideStatusBarParams { + /** + * Determines whether to animate the dialog as it is hidden. + */ + animated?: boolean; + + /** + * Style of the animation. + */ + animationStyle?: number; + +} + +/** + * Dictionary of options for the method. + */ +interface showStatusBarParams { + /** + * Determines whether to animate the dialog as it is shown. + */ + animated?: boolean; + + /** + * Style of the animation. + */ + animationStyle?: number; + +} + +/** + * Reply message received from watch app. + */ +interface MessageReply { + /** + * Reply message from watchapp. + */ + message?: any; + + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + +} + +/** + * Properties passed to a yql callback to report a success or failure. + */ +interface YQLResponse { + /** + * Indicates if the operation succeeded. + */ + success?: boolean; + + /** + * Error message, if any returned. + */ + error?: string; + + /** + * Error code. Returns 0 if `success` is `true`. + */ + code?: number; + + /** + * Error message, if any returned. Use `error` instead + */ + message?: string; + + /** + * The data payload received from the YQL. + */ + data?: any; -declare class EncodeStringDict { - charset : string; - dest : Ti.Buffer; - destPosition : number; - source : string; - sourceLength : number; - sourcePosition : number; } diff --git a/types/titanium/titanium-tests.ts b/types/titanium/titanium-tests.ts index 9113f49835..bc5f4794c2 100644 --- a/types/titanium/titanium-tests.ts +++ b/types/titanium/titanium-tests.ts @@ -1,7 +1,5 @@ - - function test_window() { - var window: Ti.UI.Window = Ti.UI.createWindow({ + const window: Titanium.UI.Window = Ti.UI.createWindow({ title: 'Test', backgroundColor: 'white', borderRadius: 10 @@ -10,10 +8,10 @@ function test_window() { window.setBackgroundColor('blue'); window.opacity = 0.92; - var matrix = Ti.UI.create2DMatrix().scale(1.1, 1); + const matrix = Ti.UI.create2DMatrix().scale(1.1, 1); window.transform = matrix; - var label: Ti.UI.Label; + let label: Titanium.UI.Label; label = Ti.UI.createLabel({ color: '#900', text: 'Simple label' @@ -26,17 +24,17 @@ function test_window() { } function test_tableview() { - var data : Ti.UI.View[] = []; - for (var i = 0; i < 10; i++) { - var row = Ti.UI.createTableViewRow(); - var label = Ti.UI.createLabel({ + const data: Titanium.UI.TableViewRow[] = []; + for (let i = 0; i < 10; i++) { + const row = Ti.UI.createTableViewRow(); + const label = Ti.UI.createLabel({ left: 10, text: 'Row ' + (i + 1) }); - var image = Ti.UI.createImageView({ + const image = Ti.UI.createImageView({ url: 'KS_nav_ui.png' }); - var button = Ti.UI.createButton({ + const button = Ti.UI.createButton({ right: 10, height: 30, width: 80, @@ -47,19 +45,19 @@ function test_tableview() { row.add(button); data.push(row); } - var table = Ti.UI.createTableView({ - data: data, - style: Ti.UI.iPhone.TableViewStyle.PLAIN + const table = Ti.UI.createTableView({ + data, + style: Ti.UI.iOS.TableViewStyle.PLAIN }); } function test_fs() { - var imageDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + 'downloaded_images'); + let imageDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory + 'downloaded_images'); if (!imageDir.exists()) { imageDir.createDirectory(); } - var data: Ti.Blob; - var imageFile = Ti.Filesystem.getFile(imageDir.resolve() + 'image.jpg'); + let data: Titanium.Blob; // tslint:disable-line:prefer-const + let imageFile = Ti.Filesystem.getFile(imageDir.resolve() + 'image.jpg'); if (!imageFile.write(data)) { Ti.UI.createAlertDialog({ message: 'IO Error' @@ -70,17 +68,17 @@ function test_fs() { } function test_network() { - var url = "http://www.appcelerator.com"; - var client = Ti.Network.createHTTPClient({ + const url = "http://www.appcelerator.com"; + const client = Ti.Network.createHTTPClient({ // function called when the response data is available - onload : function(e: SuccessResponse) { + onload: (e: SuccessResponse) => { alert(this.responseText); }, // function called when an error occurs, including a timeout - onerror : function(e: FailureResponse) { + onerror: (e: FailureResponse) => { alert(e.error); }, - timeout : 5000 // in milliseconds + timeout: 5000 // in milliseconds }); // Prepare the connection. client.open('GET', url); @@ -89,8 +87,8 @@ function test_network() { } function test_map() { - var win = Ti.UI.createWindow(); - var mountainView = Ti.Map.createAnnotation({ + const win = Ti.UI.createWindow(); + const mountainView = Ti.Map.createAnnotation({ animate: true, leftButton: '../images/appcelerator_small.png', myid: 1 @@ -101,19 +99,20 @@ function test_map() { mountainView.setSubtitle('Mountain View, CA'); mountainView.setPincolor(Ti.Map.ANNOTATION_RED); - var mapview = Ti.Map.createView({ + const mapview = Ti.Map.createView({ mapType: Ti.Map.STANDARD_TYPE, region: { - latitude:37.390749, longitude:-122.081651, - latitudeDelta:0.01, longitudeDelta:0.01}, - animate:true, + latitude: 37.390749, longitude: -122.081651, + latitudeDelta: 0.01, longitudeDelta: 0.01 + }, + animate: true, }); mapview.regionFit = true; mapview.userLocation = true; mapview.annotations = [mountainView]; - mapview.addEventListener('click', function(evt?) { - if (evt.clicksource === 'leftButton' || evt.clicksource === 'leftPane') { - alert(evt.title + ' left button clicked'); + mapview.addEventListener('click', event => { + if (event.clicksource === 'leftButton' || event.clicksource === 'leftPane') { + alert(event.title + ' left button clicked'); } }); win.add(mapview); diff --git a/types/titanium/tsconfig.json b/types/titanium/tsconfig.json index 86e5902e63..815fb8c48b 100644 --- a/types/titanium/tsconfig.json +++ b/types/titanium/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6", - "dom" + "dom", + "es6" ], "noImplicitAny": true, "noImplicitThis": false, diff --git a/types/titanium/tslint.json b/types/titanium/tslint.json index a41bf5d19a..9a29b5bc8f 100644 --- a/types/titanium/tslint.json +++ b/types/titanium/tslint.json @@ -2,78 +2,12 @@ "extends": "dtslint/dt.json", "rules": { "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "max-line-length": false, + "unified-signatures": false } } From 3c228f9d1ed04042e9d090d583850baa27d72cd0 Mon Sep 17 00:00:00 2001 From: TeamworkGuy2 Date: Sun, 25 Mar 2018 02:53:12 +0000 Subject: [PATCH 31/97] [q] fix Promise not being assignable to IWhenable with strictFunctionTypes --- types/q/index.d.ts | 396 ++++++++++++++++++++++++++++++++---------- types/q/q-tests.ts | 110 ++++++------ types/q/tsconfig.json | 4 +- 3 files changed, 365 insertions(+), 145 deletions(-) diff --git a/types/q/index.d.ts b/types/q/index.d.ts index 724925d802..bdcd3c68ca 100644 --- a/types/q/index.d.ts +++ b/types/q/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for Q 1.0 +// Type definitions for Q 1.5 // Project: https://github.com/kriskowal/q // Definitions by: Barrie Nemetchek // Andrew Gaspar // John Reilly // Michel Boudreau +// TeamworkGuy2 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -28,74 +29,99 @@ declare namespace Q { export interface Deferred { promise: Promise; + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its + * fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ resolve(value?: IWhenable): void; + /** + * Calling reject with a reason causes promise to be rejected with that reason. + */ reject(reason?: any): void; + /** + * Calling notify with a value causes promise to be notified of progress with that value. That is, any onProgress + * handlers registered with promise or promises derived from promise will be called with the progress value. + */ notify(value: any): void; + /** + * Returns a function suitable for passing to a Node.js API. That is, it has a signature (err, result) and will + * reject deferred.promise with err if err is given, or fulfill it with result if that is given. + */ makeNodeResolver(): (reason: any, value: T) => void; } export interface Promise { /** - * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources - * regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. finally returns a promise, which will become - * resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise - * returned from callback is finished. + * The then method from the Promises/A+ specification, with an additional progress handler. */ - fin(finallyCallback: () => any): Promise; + then(onFulfill?: ((value: T) => IWhenable) | null, onReject?: ((error: any) => IWhenable) | null, onProgress?: ((progress: any) => any) | null): Promise; /** - * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful for collecting resources - * regardless of whether a job succeeded, like closing a database connection, shutting a server down, or deleting an unneeded key from an object. finally returns a promise, which will become - * resolved with the same fulfillment value or rejection reason as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed until the promise - * returned from callback is finished. + * Like a finally clause, allows you to observe either the fulfillment or rejection of a promise, but to do so + * without modifying the final value. This is useful for collecting resources regardless of whether a job succeeded, + * like closing a database connection, shutting a server down, or deleting an unneeded key from an object. + * finally returns a promise, which will become resolved with the same fulfillment value or rejection reason + * as promise. However, if callback returns a promise, the resolution of the returned promise will be delayed + * until the promise returned from callback is finished. Furthermore, if the returned promise rejects, that + * rejection will be passed down the chain instead of the previous result. */ finally(finallyCallback: () => any): Promise; /** - * The then method from the Promises/A+ specification, with an additional progress handler. + * Alias for finally() (for non-ES5 browsers) */ - then(onFulfill?: (value: T) => IWhenable, onReject?: (error: any) => IWhenable, onProgress?: (progress: any) => any): Promise; + fin(finallyCallback: () => any): Promise; /** - * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's - * rejection reason. - * + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are + * rejected, instead calls onRejected with the first rejected promise's rejection reason. * This is especially useful in conjunction with all */ spread(onFulfill: (...args: any[]) => IWhenable, onReject?: (reason: any) => IWhenable): Promise; - fail(onRejected: (reason: any) => IWhenable): Promise; - /** * A sugar method, equivalent to promise.then(undefined, onRejected). */ catch(onRejected: (reason: any) => IWhenable): Promise; + /** + * Alias for catch() (for non-ES5 browsers) + */ + fail(onRejected: (reason: any) => IWhenable): Promise; + /** * A sugar method, equivalent to promise.then(undefined, undefined, onProgress). */ progress(onProgress: (progress: any) => any): Promise; /** - * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, either because promise is rejected and no onRejected callback was provided, or - * because onFulfilled or onRejected threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a future turn of the event loop. - * - * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions thrown in then callbacks are consumed and transformed into rejections, - * exceptions at the end of the chain are easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the event loop, so that it won't be caught, it - * causes an onerror event on the browser window, or an uncaughtException event on Node.js's process object. - * - * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, exceptions will be delivered there instead of thrown in a future turn. - * - * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends with you, call done to terminate it. + * Much like then, but with different behavior around unhandled rejection. If there is an unhandled rejection, + * either because promise is rejected and no onRejected callback was provided, or because onFulfilled or onRejected + * threw an error or returned a rejected promise, the resulting rejection reason is thrown as an exception in a + * future turn of the event loop. + * This method should be used to terminate chains of promises that will not be passed elsewhere. Since exceptions + * thrown in then callbacks are consumed and transformed into rejections, exceptions at the end of the chain are + * easy to accidentally, silently ignore. By arranging for the exception to be thrown in a future turn of the + * event loop, so that it won't be caught, it causes an onerror event on the browser window, or an uncaughtException + * event on Node.js's process object. + * Exceptions thrown by done will have long stack traces, if Q.longStackSupport is set to true. If Q.onerror is set, + * exceptions will be delivered there instead of thrown in a future turn. + * The Golden Rule of done vs. then usage is: either return your promise to someone else, or if the chain ends + * with you, call done to terminate it. Terminating with catch is not sufficient because the catch handler may + * itself throw an error. */ - done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void; + done(onFulfilled?: ((value: T) => any) | null, onRejected?: ((reason: any) => any) | null, onProgress?: ((progress: any) => any) | null): void; /** - * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) when/if promise becomes rejected, or as callback(null, fulfillmentValue) - * when/if promise becomes fulfilled. If callback is not a function, simply returns promise. + * If callback is a function, assumes it's a Node.js-style callback, and calls it as either callback(rejectionReason) + * when/if promise becomes rejected, or as callback(null, fulfillmentValue) when/if promise becomes fulfilled. + * If callback is not a function, simply returns promise. */ nodeify(callback: (reason: any, value: any) => void): Promise; @@ -112,8 +138,8 @@ declare namespace Q { delete(propertyName: string): Promise; /** - * Returns a promise for the result of calling the named method of an object with the given array of arguments. The object itself is this in the function, just like a synchronous method call. - * Essentially equivalent to + * Returns a promise for the result of calling the named method of an object with the given array of arguments. + * The object itself is this in the function, just like a synchronous method call. Essentially equivalent to * * @example * promise.then(function (o) { return o[methodName].apply(o, args); }); @@ -121,14 +147,11 @@ declare namespace Q { post(methodName: string, args: any[]): Promise; /** - * Returns a promise for the result of calling the named method of an object with the given variadic arguments. The object itself is this in the function, just like a synchronous method call. + * Returns a promise for the result of calling the named method of an object with the given variadic arguments. + * The object itself is this in the function, just like a synchronous method call. */ invoke(methodName: string, ...args: any[]): Promise; - fapply(args: any[]): Promise; - - fcall(...args: any[]): Promise; - /** * Returns a promise for an array of the property names of an object. Essentially equivalent to * @@ -137,6 +160,35 @@ declare namespace Q { */ keys(): Promise; + /** + * Returns a promise for the result of calling a function, with the given array of arguments. Essentially equivalent to + * + * @example + * promise.then(function (f) { + * return f.apply(undefined, args); + * }); + */ + fapply(args: any[]): Promise; + + /** + * Returns a promise for the result of calling a function, with the given variadic arguments. Has the same return + * value/thrown exception translation as explained above for fbind. + * In its static form, it is aliased as Q.try, since it has semantics similar to a try block (but handling both + * synchronous exceptions and asynchronous rejections). This allows code like + * + * @example + * Q.try(function () { + * if (!isConnectedToCloud()) { + * throw new Error("The cloud is down!"); + * } + * return syncToCloud(); + * }) + * .catch(function (error) { + * console.error("Couldn't sync to the cloud", error); + * }); + */ + fcall(...args: any[]): Promise; + /** * A sugar method, equivalent to promise.then(function () { return value; }). */ @@ -148,30 +200,39 @@ declare namespace Q { thenReject(reason?: any): Promise; /** - * Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for that same value, perhaps deferred but not replaced by the promise returned - * by the onFulfilled handler. + * Attaches a handler that will observe the value of the promise when it becomes fulfilled, returning a promise for + * that same value, perhaps deferred but not replaced by the promise returned by the onFulfilled handler. */ tap(onFulfilled: (value: T) => any): Promise; + /** + * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected + * before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message + * is not supplied, the message will be "Timed out after " + ms + " ms". + */ timeout(ms: number, message?: string): Promise; /** - * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least ms milliseconds have passed. + * Returns a promise that will have the same result as promise, but will only be fulfilled or rejected after at least + * ms milliseconds have passed. */ delay(ms: number): Promise; /** - * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the result is always true. + * Returns whether a given promise is in the fulfilled state. When the static version is used on non-promises, the + * result is always true. */ isFulfilled(): boolean; /** - * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the result is always false. + * Returns whether a given promise is in the rejected state. When the static version is used on non-promises, the + * result is always false. */ isRejected(): boolean; /** - * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the result is always false. + * Returns whether a given promise is in the pending state. When the static version is used on non-promises, the + * result is always false. */ isPending(): boolean; @@ -193,6 +254,30 @@ declare namespace Q { reason?: any; } + /** + * Returns a "deferred" object with a: + * promise property + * resolve(value) method + * reject(reason) method + * notify(value) method + * makeNodeResolver() method + */ + export function defer(): Deferred; + + /** + * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its + * fulfillment value or rejected with its rejection reason (or staying pending forever, if the passed promise does). + * Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. + * Calling resolve with a fulfilled promise causes promise to be fulfilled with the passed promise's fulfillment value. + * Calling resolve with a non-promise value causes promise to be fulfilled with that value. + */ + export function resolve(object?: IWhenable): Promise; + + /** + * Returns a promise that is rejected with reason. + */ + export function reject(reason?: any): Promise; + // If no value provided, returned promise will be of void type export function when(): Promise; @@ -200,38 +285,168 @@ declare namespace Q { export function when(value: IWhenable): Promise; // If a non-promise value is provided, it will not reject or progress - export function when(value: IWhenable, onFulfilled: (val: T) => IWhenable, onRejected?: (reason: any) => IWhenable, onProgress?: (progress: any) => any): Promise; + export function when(value: IWhenable, onFulfilled: (val: T) => IWhenable, onRejected?: ((reason: any) => IWhenable) | null, onProgress?: ((progress: any) => any) | null): Promise; + /** + * (Deprecated) Returns a new function that calls a function asynchronously with the given variadic arguments, and returns a promise. + * Notably, any synchronous return values or thrown exceptions are transformed, respectively, into fulfillment values + * or rejection reasons for the promise returned by this new function. + * This method is especially useful in its static form for wrapping functions to ensure that they are always + * asynchronous, and that any thrown exceptions (intentional or accidental) are appropriately transformed into a + * returned rejected promise. For example: + * + * @example + * var getUserData = Q.fbind(function (userName) { + * if (!userName) { + * throw new Error("userName must be truthy!"); + * } + * if (localCache.has(userName)) { + * return localCache.get(userName); + * } + * return getUserFromCloud(userName); + * }); + */ export function fbind(method: (...args: any[]) => IWhenable, ...args: any[]): (...args: any[]) => Promise; + /** + * Returns a promise for the result of calling a function, with the given variadic arguments. Has the same return + * value/thrown exception translation as explained above for fbind. + * In its static form, it is aliased as Q.try, since it has semantics similar to a try block (but handling both synchronous + * exceptions and asynchronous rejections). This allows code like + * + * @example + * Q.try(function () { + * if (!isConnectedToCloud()) { + * throw new Error("The cloud is down!"); + * } + * return syncToCloud(); + * }) + * .catch(function (error) { + * console.error("Couldn't sync to the cloud", error); + * }); + */ export function fcall(method: (...args: any[]) => T, ...args: any[]): Promise; - // Try is an alias for fcall, but 'try' is a reserved word. This is the only way to get around this + // but 'try' is a reserved word. This is the only way to get around this + /** + * Alias for fcall() + */ export {fcall as try}; - export function send(obj: any, functionName: string, ...args: any[]): Promise; - + /** + * Returns a promise for the result of calling the named method of an object with the given variadic arguments. + * The object itself is this in the function, just like a synchronous method call. + */ export function invoke(obj: any, functionName: string, ...args: any[]): Promise; + /** + * Alias for invoke() + */ + export function send(obj: any, functionName: string, ...args: any[]): Promise; + + /** + * Alias for invoke() + */ export function mcall(obj: any, functionName: string, ...args: any[]): Promise; - export function denodeify(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; - - export function nbind(nodeFunction: (...args: any[]) => any, thisArg: any, ...args: any[]): (...args: any[]) => Promise; - + /** + * Creates a promise-returning function from a Node.js-style function, optionally binding it with the given + * variadic arguments. An example: + * + * @example + * var readFile = Q.nfbind(FS.readFile); + * readFile("foo.txt", "utf-8").done(function (text) { + * //... + * }); + * + * Note that if you have a method that uses the Node.js callback pattern, as opposed to just a function, you will + * need to bind its this value before passing it to nfbind, like so: + * + * @example + * var Kitty = mongoose.model("Kitty"); + * var findKitties = Q.nfbind(Kitty.find.bind(Kitty)); + * + * The better strategy for methods would be to use Q.nbind, as shown below. + */ export function nfbind(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; - export function nfcall(nodeFunction: (...args: any[]) => any, ...args: any[]): Promise; + /** + * Alias for nfbind() + */ + export function denodeify(nodeFunction: (...args: any[]) => any, ...args: any[]): (...args: any[]) => Promise; + /** + * Creates a promise-returning function from a Node.js-style method, optionally binding it with the given + * variadic arguments. An example: + * + * @example + * var Kitty = mongoose.model("Kitty"); + * var findKitties = Q.nbind(Kitty.find, Kitty); + * findKitties({ cute: true }).done(function (theKitties) { + * //... + * }); + */ + export function nbind(nodeFunction: (...args: any[]) => any, thisArg: any, ...args: any[]): (...args: any[]) => Promise; + + /** + * Calls a Node.js-style function with the given array of arguments, returning a promise that is fulfilled if the + * Node.js function calls back with a result, or rejected if it calls back with an error + * (or throws one synchronously). An example: + * + * @example + * Q.nfapply(FS.readFile, ["foo.txt", "utf-8"]).done(function (text) { + * }); + * + * Note that this example only works because FS.readFile is a function exported from a module, not a method on + * an object. For methods, e.g. redisClient.get, you must bind the method to an instance before passing it to + * Q.nfapply (or, generally, as an argument to any function call): + * + * @example + * Q.nfapply(redisClient.get.bind(redisClient), ["user:1:id"]).done(function (user) { + * }); + * + * The better strategy for methods would be to use Q.npost, as shown below. + */ export function nfapply(nodeFunction: (...args: any[]) => any, args: any[]): Promise; - export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Calls a Node.js-style function with the given variadic arguments, returning a promise that is fulfilled if the + * Node.js function calls back with a result, or rejected if it calls back with an error + * (or throws one synchronously). An example: + * + * @example + * Q.nfcall(FS.readFile, "foo.txt", "utf-8").done(function (text) { + * }); + * + * The same warning about functions vs. methods applies for nfcall as it does for nfapply. In this case, the better + * strategy would be to use Q.ninvoke. + */ + export function nfcall(nodeFunction: (...args: any[]) => any, ...args: any[]): Promise; + /** + * Calls a Node.js-style method with the given arguments array, returning a promise that is fulfilled if the method + * calls back with a result, or rejected if it calls back with an error (or throws one synchronously). An example: + * + * @example + * Q.npost(redisClient, "get", ["user:1:id"]).done(function (user) { + * }); + */ export function npost(nodeModule: any, functionName: string, args: any[]): Promise; - export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Calls a Node.js-style method with the given variadic arguments, returning a promise that is fulfilled if the + * method calls back with a result, or rejected if it calls back with an error (or throws one synchronously). An example: + * + * @example + * Q.ninvoke(redisClient, "get", "user:1:id").done(function (user) { + * }); + */ + export function ninvoke(nodeModule: any, functionName: string, ...args: any[]): Promise; - export function nmcall(nodeModule: any, functionName: string, ...args: any[]): Promise; + /** + * Alias for ninvoke() + */ + export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; /** * Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected. @@ -267,21 +482,27 @@ declare namespace Q { export function race(promises: Array>): Promise; /** - * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected. + * Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises + * have settled, i.e. become either fulfilled or rejected. */ export function allSettled(promises: IWhenable>>): Promise>>; + /** + * Deprecated Alias for allSettled() + */ export function allResolved(promises: IWhenable>>): Promise>>; /** - * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are rejected, instead calls onRejected with the first rejected promise's rejection - * reason. This is especially useful in conjunction with all. + * Like then, but "spreads" the array into a variadic fulfillment handler. If any of the promises in the array are + * rejected, instead calls onRejected with the first rejected promise's rejection reason. This is especially useful + * in conjunction with all. */ export function spread(promises: Array>, onFulfilled: (...args: T[]) => IWhenable, onRejected?: (reason: any) => IWhenable): Promise; /** - * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected before ms milliseconds, the returned promise will be rejected with an Error - * with the given message. If message is not supplied, the message will be "Timed out after " + ms + " ms". + * Returns a promise that will have the same result as promise, except that if promise is not fulfilled or rejected + * before ms milliseconds, the returned promise will be rejected with an Error with the given message. If message + * is not supplied, the message will be "Timed out after " + ms + " ms". */ export function timeout(promise: Promise, ms: number, message?: string): Promise; @@ -310,75 +531,64 @@ declare namespace Q { export function isPending(promiseOrObject: Promise | any): boolean; /** - * Returns a "deferred" object with a: - * promise property - * resolve(value) method - * reject(reason) method - * notify(value) method - * makeNodeResolver() method + * Synchronously calls resolver(resolve, reject, notify) and returns a promise whose state is controlled by the + * functions passed to resolver. This is an alternative promise-creation API that has the same power as the deferred + * concept, but without introducing another conceptual entity. + * If resolver throws an exception, the returned promise will be rejected with that thrown exception as the rejection reason. + * note: In the latest github, this method is called Q.Promise, but if you are using the npm package version 0.9.7 + * or below, the method is called Q.promise (lowercase vs uppercase p). */ - export function defer(): Deferred; - - /** - * Returns a promise that is rejected with reason. - */ - export function reject(reason?: any): Promise; - export function Promise(resolver: (resolve: (val?: IWhenable) => void, reject: (reason?: any) => void, notify: (progress: any) => void) => void): Promise; /** - * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their fulfillment values before calling the original func. The returned version - * also always returns a promise: if func does a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. - * - * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that the function always returns a promise even in the face of unintentional - * thrown exceptions. + * Creates a new version of func that accepts any combination of promise and non-promise values, converting them to their + * fulfillment values before calling the original func. The returned version also always returns a promise: if func does + * a return or throw, then Q.promised(func) will return fulfilled or rejected promise, respectively. + * This can be useful for creating functions that accept either promises or non-promise values, and for ensuring that + * the function always returns a promise even in the face of unintentional thrown exceptions. */ export function promised(callback: (...args: any[]) => T): (...args: any[]) => Promise; /** * Returns whether the given value is a Q promise. */ - export function isPromise(object: any): boolean; + export function isPromise(object: any): object is Promise; /** * Returns whether the given value is a promise (i.e. it's an object with a then function). */ - export function isPromiseAlike(object: any): boolean; + export function isPromiseAlike(object: any): object is IPromise; /** * If an object is not a promise, it is as "near" as possible. * If a promise is rejected, it is as "near" as possible too. - * If it’s a fulfilled promise, the fulfillment value is nearer. - * If it’s a deferred promise and the deferred has been resolved, the + * If it's a fulfilled promise, the fulfillment value is nearer. + * If it's a deferred promise and the deferred has been resolved, the * resolution is "nearer". */ export function nearer(promise: Promise): T; /** - * This is an experimental tool for converting a generator function into a deferred function. This has the potential of reducing nested callbacks in engines that support yield. + * This is an experimental tool for converting a generator function into a deferred function. This has the potential + * of reducing nested callbacks in engines that support yield. */ export function async(generatorFunction: any): (...args: any[]) => Promise; export function nextTick(callback: (...args: any[]) => any): void; /** - * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the event loop, usually as a result of done. Can be useful for getting the full + * A settable property that will intercept any uncaught errors that would otherwise be thrown in the next tick of the + * event loop, usually as a result of done. Can be useful for getting the full * stack trace of an error in browsers, which is not usually possible with window.onerror. */ export let onerror: (reason: any) => void; /** - * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked across asynchronous promise operations, so that if an uncaught error is thrown - * by done or a rejection reason's stack property is inspected in a rejection callback, a long stack trace is produced. + * A settable property that lets you turn on long stack trace support. If turned on, "stack jumps" will be tracked + * across asynchronous promise operations, so that if an uncaught error is thrown by done or a rejection reason's stack + * property is inspected in a rejection callback, a long stack trace is produced. */ export let longStackSupport: boolean; - /** - * Calling resolve with a pending promise causes promise to wait on the passed promise, becoming fulfilled with its fulfillment value or rejected with its rejection reason (or staying pending - * forever, if the passed promise does). Calling resolve with a rejected promise causes promise to be rejected with the passed promise's rejection reason. Calling resolve with a fulfilled promise - * causes promise to be fulfilled with the passed promise's fulfillment value. Calling resolve with a non-promise value causes promise to be fulfilled with that value. - */ - export function resolve(object?: IWhenable): Promise; - /** * Resets the global "Q" variable to the value it has before Q was loaded. * This will either be undefined if there was no version or the version of Q which was already loaded before. diff --git a/types/q/q-tests.ts b/types/q/q-tests.ts index c0c29d9642..226d86ced8 100644 --- a/types/q/q-tests.ts +++ b/types/q/q-tests.ts @@ -1,18 +1,20 @@ /// -import Q = require('q'); +import Q = require("q"); -Q(8).then(x => console.log(x.toExponential())); +const _when: Q.IWhenable = Q.resolve(0); // was an issue when strictFunctionTypes were enforced on all of DefinitelyTyped + +Q(8).then((x) => console.log(x.toExponential())); Q().then(() => console.log("nothing")); -const delay = (delay: number) => { +function delay(delay: number): Q.Promise { const d = Q.defer(); setTimeout(d.resolve, delay); return d.promise; -}; +} Q.when(delay(1000), (val) => { - console.log('Hello, World!'); + console.log("Hello, World!"); return; }); @@ -20,15 +22,15 @@ Q.when(delay(1000), (val) => { const otherPromise = Q.defer().promise; Q.defer().resolve(otherPromise); -Q.timeout(Q(new Date()), 1000, "My dates never arrived. :(").then(d => d.toJSON()); +Q.timeout(Q(new Date()), 1000, "My dates never arrived. :(").then((d) => d.toJSON()); -Q.delay(Q(8), 1000).then(x => x.toExponential()); -Q.delay(8, 1000).then(x => x.toExponential()); -Q.delay(Q("asdf"), 1000).then(x => x.length); -Q.delay("asdf", 1000).then(x => x.length); +Q.delay(Q(8), 1000).then((x) => x.toExponential()); +Q.delay(8, 1000).then((x) => x.toExponential()); +Q.delay(Q("asdf"), 1000).then((x) => x.length); +Q.delay("asdf", 1000).then((x) => x.length); -const eventualAdd = Q.promised((a?: number, b?: number) => a + b); -eventualAdd(Q(1), Q(2)).then(x => x.toExponential()); +const eventualAdd = Q.promised((a?: number, b?: number) => a + b); +eventualAdd(Q(1), Q(2)).then((x) => x.toExponential()); function eventually(eventually: T) { return Q.delay(eventually, 1000); @@ -36,6 +38,7 @@ function eventually(eventually: T) { const x = Q.all([1, 2, 3].map(eventually)); Q.when(x, (x) => { + const _x: number[] = x; console.log(x); }); @@ -81,10 +84,11 @@ Q.allResolved([]) Q(42) .tap(() => "hello") - .tap(x => { + .tap((x) => { console.log(x); }) - .then(x => { + .then((x) => { + const _x: number = x; console.log("42 == " + x); }); @@ -94,34 +98,34 @@ declare let stringPromise: Q.IPromise; declare function returnsNumPromise(text: string): Q.Promise; declare function returnsNumPromise(text: string): JQueryPromise; -Q(arrayPromise) // type specification required - .then(arr => arr.join(',')) - .then(returnsNumPromise) // requires specification - .then(num => num.toFixed()); +Q(arrayPromise) + .then((arr) => arr.join(',')) + .then(returnsNumPromise) // requires specification + .then((num) => num.toFixed()); declare let jPromise: JQueryPromise; // if jQuery promises definition supported generics, this could be more interesting example -Q(jPromise).then(str => str.split(',')); +Q(jPromise).then((str) => str.split(',')); jPromise.then(returnsNumPromise); // watch the typing flow through from jQueryPromise to Q.Promise -Q(jPromise).then(str => str.split(',')); +Q(jPromise).then((str) => str.split(',')); declare let promiseArray: Array>; -const qPromiseArray = promiseArray.map(p => { +const qPromiseArray = promiseArray.map((p) => { return Q(p); }); const myNums: any[] = [2, 3, Q(4), 5, Q(6), Q(7)]; -Q.all(promiseArray).then(nums => nums.map(num => num.toPrecision(2)).join(',')); +Q.all(promiseArray).then((nums) => nums.map((num) => num.toPrecision(2)).join(',')); -Q.all(myNums).then(nums => nums.map(Math.round)); +Q.all(myNums).then((nums) => nums.map(Math.round)); -Q.fbind((dateString?: string) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString()); +Q.fbind((dateString?: string) => new Date( dateString), "11/11/1991")().then((d) => d.toLocaleDateString()); -Q.when(8, num => num + "!"); -Q.when(Q(8), num => num + "!").then(str => str.split(',')); +Q.when(8, (num) => num + "!"); +Q.when(Q(8), (num) => num + "!").then((str) => str.split(',')); const voidPromise: Q.Promise = Q.when(); declare function saveToDisk(): Q.Promise; @@ -147,22 +151,27 @@ Q.nfapply(nodeStyle, ["foo"]).done((result: string) => { }); Q.nfcall(nodeStyle, "foo").done((result: string) => { }); -Q.denodeify(nodeStyle)('foo').done((result: string) => { +Q.denodeify(nodeStyle)("foo").done((result: string) => { }); -Q.nfbind(nodeStyle)('foo').done((result: string) => { +Q.nfbind(nodeStyle)("foo").done((result: string) => { }); +interface Kitty { + name: string; + cute: boolean; +} + class Repo { - private readonly items: any[] = [ - {name: 'Max', cute: false}, - {name: 'Annie', cute: true} + private readonly items: Kitty[] = [ + {name: "Max", cute: false}, + {name: "Annie", cute: true} ]; - find(options: any): Q.Promise { + find(options: {[K in keyof Kitty]: Kitty[K] }): Q.Promise { let result = this.items; for (const key in options) { - result = result.filter(i => i[key] === options[key]); + result = result.filter((i) => i[ key] === options[ key]); } return Q(result); @@ -170,7 +179,8 @@ class Repo { } const kitty = new Repo(); -Q.nbind(kitty.find, kitty)({cute: true}).done((kitties: any[]) => { +Q.nbind(kitty.find, kitty)({ cute: true }).done((kitties) => { + const _kitties: Kitty[] = kitties; }); /** @@ -194,10 +204,6 @@ function TestCanRethrowRejectedPromises() { .fail((error) => { console.log("Intermediate error handling"); - /* - * Cannot do this, because: - * error TS2322: Type 'Promise' is not assignable to type 'Promise' - */ return Q.reject(error); }); } @@ -206,10 +212,14 @@ function TestCanRethrowRejectedPromises() { .finally(() => { console.log("Cleanup"); }) - .done(); + .done((foo) => { + const _foo: Foo = foo; + }); } -// test Q.Promise.all +/** + * test Q.Promise.all + */ const y1 = Q().then(() => { const s = Q("hello"); const n = Q(1); @@ -222,9 +232,9 @@ const y2 = Q().then(() => { return <[typeof s, typeof n]> [s, n]; }); -const p2: Q.Promise<[string, number]> = y1.then(val => Q.all(val)); +const p2: Q.Promise<[string, number]> = y1.then((val) => Q.all(val)); const p3: Q.Promise<[string, number]> = Q.all(y1); -const p5: Q.Promise<[string, number]> = y2.then(val => Q.all(val)); +const p5: Q.Promise<[string, number]> = y2.then((val) => Q.all(val)); const p6: Q.Promise<[string, number]> = Q.all(y2); Q.try(() => { @@ -238,8 +248,8 @@ Q.try(() => { // thenReject, returning a Promise of the same type as the Promise it is called on function thenRejectSameType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } return Q.resolve(2); } @@ -248,10 +258,10 @@ function thenRejectSameType(arg: any): Q.Promise { // The generic type argument is specified. function thenRejectSpecificOtherType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } - return Q.resolve(''); + return Q.resolve(""); } // thenReject, returning a Promise of a different type to the Promise it is called on. @@ -262,9 +272,9 @@ function thenRejectSpecificOtherType(arg: any): Q.Promise { /* function thenRejectInferredOtherType(arg: any): Q.Promise { if (!arg) { - return returnsNumPromise('') - .thenReject(new Error('failed')); + return returnsNumPromise("") + .thenReject(new Error("failed")); } - return Q.resolve(''); + return Q.resolve(""); } */ diff --git a/types/q/tsconfig.json b/types/q/tsconfig.json index d78aa85a14..ba7c0d33d6 100644 --- a/types/q/tsconfig.json +++ b/types/q/tsconfig.json @@ -7,8 +7,8 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": false, + "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 010136012882e6409764cbda9d9a0a6d118480c0 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 25 Mar 2018 13:06:31 +0200 Subject: [PATCH 32/97] fix: `shebang` should be optional in `ParseOptions` --- types/uglify-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index cab53cb4db..12bcefa7af 100644 --- a/types/uglify-js/index.d.ts +++ b/types/uglify-js/index.d.ts @@ -10,7 +10,7 @@ export interface ParseOptions { bare_returns?: boolean; html5_comments?: boolean; /** Support `#!command` as the first line */ - shebang: boolean; + shebang?: boolean; } export interface CompressOptions { From d18f4a1d002538fd53a44d109c152879170f6f99 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Sun, 25 Mar 2018 13:16:16 +0200 Subject: [PATCH 33/97] fix: add `warnings` to `MinifyOutput` --- types/uglify-js/index.d.ts | 1 + types/uglify-js/uglify-js-tests.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index 12bcefa7af..eca756bd53 100644 --- a/types/uglify-js/index.d.ts +++ b/types/uglify-js/index.d.ts @@ -198,6 +198,7 @@ export interface MinifyOptions { export interface MinifyOutput { error?: Error; + warnings?: string[]; code: string; map: string; } diff --git a/types/uglify-js/uglify-js-tests.ts b/types/uglify-js/uglify-js-tests.ts index 6b146ab0e7..19c11dfdf1 100644 --- a/types/uglify-js/uglify-js-tests.ts +++ b/types/uglify-js/uglify-js-tests.ts @@ -20,7 +20,7 @@ minify(code, { } }); -minify(code, { +const output = minify(code, { warnings: 'verbose', mangle: { properties: { @@ -34,3 +34,7 @@ minify(code, { arguments: true } }); + +if (output.warnings) { + output.warnings.filter(x => x === 'Dropping unused variable'); +} From 8206cfa97338fa0cd0b9cf64cb6747738c96da81 Mon Sep 17 00:00:00 2001 From: Ricardo De Pena Date: Sun, 25 Mar 2018 21:40:12 -0400 Subject: [PATCH 34/97] Backed up v17 definitions to the v17 folder, moved v29 definitions to the index folder. --- types/openfin/index.d.ts | 3581 +++++++++++----------- types/openfin/openfin-tests.ts | 1472 ++++----- types/openfin/tsconfig.json | 9 +- types/openfin/tslint.json | 5 +- types/openfin/v17/index.d.ts | 1732 +++++++++++ types/openfin/v17/openfin-tests.ts | 721 +++++ types/openfin/{v29 => v17}/tsconfig.json | 9 +- types/openfin/v17/tslint.json | 6 + types/openfin/v29/index.d.ts | 1891 ------------ types/openfin/v29/openfin-tests.ts | 797 ----- types/openfin/v29/tslint.json | 3 - 11 files changed, 5113 insertions(+), 5113 deletions(-) create mode 100644 types/openfin/v17/index.d.ts create mode 100644 types/openfin/v17/openfin-tests.ts rename types/openfin/{v29 => v17}/tsconfig.json (77%) create mode 100644 types/openfin/v17/tslint.json delete mode 100644 types/openfin/v29/index.d.ts delete mode 100644 types/openfin/v29/openfin-tests.ts delete mode 100644 types/openfin/v29/tslint.json diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts index 30afded19b..3ddbdf2edd 100644 --- a/types/openfin/index.d.ts +++ b/types/openfin/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for OpenFin API 17.0 +// Type definitions for OpenFin API 29.0 // Project: https://openfin.co/ // Definitions by: Chris Barker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// based on v6.49.17.14 +// based on v8.56.29.51 // see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean /** @@ -18,1715 +18,1874 @@ * * Overview * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "documennt" objects. */ declare namespace fin { - const desktop: OpenFinDesktop; - - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - } - - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } - - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Passes in custom data that will be relayed to the RVM - */ - registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } - - interface SuccessObj { - httpResponseCode: number; - } - - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } - - interface ErrorInfo { - stack: string; - message: string; - } - - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } - - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, - }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right - monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate - } - - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } - - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } - - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } - - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } - - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } - - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } - - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } - - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } - - interface VirtualScreenCoordinates { - left: number; - top: number; - } - - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } - - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } - - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } - - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } - - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; - - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } - - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } - - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } - - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } - - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } - - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } - - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } - - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } - - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } - - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } - - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } - - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + Frame: OpenFinFrameStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Launches the given Application manifest. + */ + createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the system tray. + */ + getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Registers a username and an app name for licensing purposes. + */ + registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * The Application's uuid + */ + uuid: string; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: ExternalApplicationInfo) => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + + /** + * Download preload scripts from given URLs + */ + downloadPreloadScripts(scripts: Array, callback?: (downloadInfo: Array) => void, + errorCallback?: (reason: string) => void): void; + /** + * Downloads the given OpenFin Runtime. + */ + downloadRuntime(options: RuntimeDownloadOptions, onProgress?: (progress: RuntimeDownloadProgress) => void, onComplete?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Writes any unwritten cookies data to disk. + */ + flushCookieStore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the app asset. + */ + getAppAssetInfo(options: AppAssetOptions, callback?: (appAssetInfo: AppAssetInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Get additional info of cookies. + */ + getCookies(option: CookieOption, callback?: (info: Array) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns a hex encoded hash of the mac address and the currently logged in user name + */ + getDeviceUserId(callback?: (id: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns an Entity info object relating to the entity specified by the uuid and name passed in. The possible types are 'window', 'iframe', 'external connection' or 'unknown'. + */ + getEntityInfo(uuid: string, name: string, callback?: (info: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves currently focused window identity. + */ + getFocusedWindow(callback?: (focusedWindowIdentity: Identity) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the minimum (inclusive) logging level that is currently being written to the logs. + */ + getMinLogLevel(callback?: (logLevel: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + readRegistryValue(rootKey: string, subkey: string, value: string, callback?: (info: RegistryInfo) => void, + errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Set the minimum log level above which logs will be written to the OpenFin log + */ + setMinLogLevel(logLevel: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + mandatory?: boolean; + } + + interface AppAssetOptions { + alias: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface Identity { + uuid: string; + name: string; + } + + interface EntityInfo { + name: string; + uuid: string; + parent: Identity; + entityType: string; + } + + interface DownloadPreloadOption { + url: string; + } + + interface DownloadPreloadInfo { + success: boolean; + url?: string; + error: string; + } + + + interface CookieInfo { + name: string; + // expirationDate: Date; + domain: string; + path: string; + } + + interface CookieOption { + name: string; + } + + interface RegistryInfo { + data: any; + rootKey: string; + subkey: string; + type: string; + value: string; + } + + interface RuntimeDownloadOptions { + version: string; + } + + interface RuntimeDownloadProgress { + downloadedBytes: number; + totalBytes: number; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface OpenFinFrameStatic { + wrap(uuid: string, name: string): OpenFinFrame; + + getCurrent(): OpenFinFrame; + } + + interface OpenFinFrame { + name: string; + uuid: string; + + addEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + + getParentWindow(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + getInfo(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; + + removeEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; + } + monitorInfo: MonitorInfo + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface ExternalApplicationInfo { + parent: { + uuid: string; + name: string; + } + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; } diff --git a/types/openfin/openfin-tests.ts b/types/openfin/openfin-tests.ts index 61b819018f..2b5237c1e8 100644 --- a/types/openfin/openfin-tests.ts +++ b/types/openfin/openfin-tests.ts @@ -1,721 +1,797 @@ function test_application() { - let application: fin.OpenFinApplication; - // constructor - application = new fin.desktop.Application({ - url: "application.html", - uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", - name: "Application Name", - plugins: false, - mainWindowOptions: { - defaultHeight: 600, - defaultWidth: 800, - defaultTop: 300, - defaultLeft: 300, - autoShow: true - } - }, (successObj) => { - console.log("Application successfully created, HTTP response code:", successObj); - application.run(); - }, (error) => { - console.log("Error creating application:", error); - }); - // getCurrent - application = fin.desktop.Application.getCurrent(); - // wrap - application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); - // getWindow - application.getWindow(); - // addEventListener - application.addEventListener("closed", (event) => { - console.log("The application has closed"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure: " + reason); - }); - // close - application.close(); - // getChildWindows - application.getChildWindows(children => { - children.forEach(childWindow => { - console.log("Showing child: " + childWindow.name); - childWindow.show(); - }); - }); - // getGroups - application.getGroups(allGroups => { - console.log(`There are a total of ${allGroups.length} groups.`); + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + //createFromManifest + fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { + console.log(app.uuid); + }, err => console.log(err)); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); - let groupCounter = 1; - allGroups.forEach(windowGroup => { - console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); - ++groupCounter; - }); - }); - // getManifest - application.getManifest(manifest => { - console.log("Application manifest:"); - console.log(manifest); - }); - // getParentUuid - application.getParentUuid(parentUuid => { - console.log("UUID of parent application:"); - console.log(parentUuid); - }); - // getShortcuts - application.getShortcuts(config => { - console.log("Desktop shortcut is enabled: ", config.desktop); - console.log("Start Menu shortcut is enabled: ", config.startMenu); - console.log("System Startup shortcut is enabled: ", config.systemStartup); - }); - // getInfo - application.getInfo(info => { - console.log(`Launch mode: ${info.launchMode}`); - }); - // isRunning - application.isRunning(running => { - console.log("the application is", running ? "running" : "not running"); - }); - // registerCustomData - application.registerCustomData({ - someData: "this is custom" - }, () => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { - console.log("The unregistration was successful"); - }, err => { - console.log("failure:", err); - }); - // removeTrayIcon - application.removeTrayIcon(() => { - console.log("Removed the tray icon."); - }, err => { - console.log("failure:", err); - }); - // restart - application.restart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // schedule restart - application.scheduleRestart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // setShortcuts - application.setShortcuts({ - desktop: true, - startMenu: false, - systemStartup: true - }, () => { - console.log("Successfully set new shortcut states"); - }, error => { - console.log("Failed to set new shortcut states. Error: ", error); - }); - // setTrayIcon - application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { - console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); - }); - // terminate - application.terminate(); - // wait - application.addEventListener("not-responding", () => { - console.log("waiting for hung application"); - application.wait(); - }); + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // getTrayIconInfo + application.getTrayIconInfo(info => { + console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, + info.monitorInfo.type, info.monitorInfo.reason); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); + //uuid + let hasUuid = application.uuid; } function test_external_application() { - let externalApp: fin.OpenFinExternalApplication; - // wrap - externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); - // addEventListener - externalApp.addEventListener('connected', () => { - console.log('external app connected'); - }, () => { - console.log('The registration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - // removeEventListener - const previousCallback = () => { }; - externalApp.removeEventListener('connected', previousCallback, () => { - console.log('The unregistration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + + // getInfo + externalApp.getInfo(info => { + console.log(info.parent.uuid, info.parent.name); + }, err => console.log(err)); } function test_inter_application_bus() { - // addSubscribeListener - fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has subscribed to ${topic}`); - }); - // addUnsubscribeListener - fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has unsubscribed to ${topic}`); - }); - // removeSubscribeListener - const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; - fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); - // removeUnsubscribeListener - fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); - // publish - fin.desktop.InterApplicationBus.publish("a topic", { - field1: "value1", - field2: "value2" - }); - // send - fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { - field1: "value1", - field2: "value2" - }); - // subscribe - fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { - console.log(`The application ${uuid} sent this message: ${message}`); - }); - // unsubscribe - const aRegisteredMessageListener = (message: any, senderUuid: string) => { - console.log(message, senderUuid); - }; - fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); } function test_notification() { - let notification: fin.OpenFinNotification; - // getCurrent - notification = fin.desktop.Notification.getCurrent(); - // close - notification.close(); - // sendMessage - notification = new fin.desktop.Notification({ - duration: 10, - url: "http://localhost:5000/Account/Register", - message: "Hello", - onShow: () => { }, - // onClose: () => { }, - onDismiss: () => { }, - // onClick: () => { }, - onMessage: () => { }, - onError: () => { } - }); - // sendMessageToApplication - notification.sendMessageToApplication("some message"); + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); } function test_system() { - // addEventListener - fin.desktop.System.addEventListener('monitor-info-changed', event => { - console.log("The monitor information has changed to: ", event); - }, () => { - console.log("The registration was successful"); - }, err => { - console.log("failure: " + err); - }); - // clearCache - fin.desktop.System.clearCache({ - cache: true, - cookies: true, - localStorage: true, - appcache: true, - userData: true - }); - // deleteCacheOnExit - fin.desktop.System.deleteCacheOnExit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // downloadAsset - const dirAppAsset = { - src: 'http://local:8000/dir.zip', - alias: 'dirApp', - version: '1.23.24', - target: 'dir.bat', - args: '' - }; - fin.desktop.System.downloadAsset(dirAppAsset, progress => { - const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); - console.log(`Downloaded ${downloadedPercent}%`); - }, p => { - console.log(`Downlod complete, can be found on ${p.path}`); - // lets launch our application asset. - // launchDirApp(); - }, (reason, err) => { - console.log(reason, err); - }); - // exit - fin.desktop.System.exit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // getAllApplications - fin.desktop.System.getAllApplications(applicationInfoList => { - applicationInfoList.forEach(applicationInfo => { - console.log("Showing information for application with uuid: " - + applicationInfo.uuid); - console.log("isRunning: ", applicationInfo.isRunning); - }); - }); - // getAllExternalApplications - fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { - externalAppsInfoList.forEach(appInfo => { - console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); - }); - }); - // getAllWindows - fin.desktop.System.getAllWindows(windowInfoList => { - windowInfoList.forEach(windowInfo => { - console.log("Showing information for application with uuid: ", windowInfo.uuid); - console.log("Main window: ", windowInfo.mainWindow); - console.log("Child windows: ", windowInfo.childWindows); - }); - }); - // getCommandLineArguments - fin.desktop.System.getCommandLineArguments(args => { - console.log("The command line arguments are " + args); - }); - // getDeviceId - fin.desktop.System.getDeviceId(id => { - console.log("The id of the device is: " + id); - }); - // getEnvironmentVariable - fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { - console.log("this is the APPDATA value", variable); - }); - // getHostSpecs - fin.desktop.System.getHostSpecs(info => { - console.log(info); - }, error => { - console.log('There was an error:', error); - }); - // getLog - fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { - console.log(log); - }); - // getLogList - fin.desktop.System.getLogList(logList => { - logList.forEach(logInfo => { - console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); - }); - }); - // getMonitorInfo - fin.desktop.System.getMonitorInfo(monitorInfo => { - console.log("This object contains information about all monitors: ", monitorInfo); - }); - // getMousePosition - fin.desktop.System.getMousePosition(mousePosition => { - console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); - }); - // getProcessList - fin.desktop.System.getProcessList(list => { - list.forEach(process => { - console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); - }); - }); - // getProxySettings - fin.desktop.System.getProxySettings(proxy => { - console.log(proxy); - }); - // getRvmInfo - fin.desktop.System.getRvmInfo(rvmInfoObject => { - console.log("RVM version:", rvmInfoObject.version); - console.log("RVM has been running since:", rvmInfoObject["start-time"]); - }, err => { - console.log("Failed to get rvm info, error message:", err); - }); - // getVersion - fin.desktop.System.getVersion(version => { - console.log("The version is " + version); - }); - // launchExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - // Additionally note that the executable found in the zip file specified in appAssets - // will default to the one mentioned by appAssets.target - // If the the path below refers to a specific path it will override this default - alias: "myApp", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - alias: "myApp", - arguments: "e f g", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", - arguments: "--version", - certificate: { - trusted: true, - subject: 'O=OpenFin INC., L=New York, S=NY, C=US', - thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' - }, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // log - fin.desktop.System.log("info", "An example log message", () => { - console.log("message successfully logged"); - }, err => { - console.log(err); - }); - // monitorExternalProcess - fin.desktop.System.monitorExternalProcess({ - pid: 2508, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log("The process is now being monitored: ", payload.uuid); - }, error => { - console.log("Error:", error); - }); - // openUrlWithBrowser - fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // registerExternalConnection - fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { - console.log(args); - }); - // releaseExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // downloadRuntime + fin.desktop.System.downloadRuntime({ version: '9.61.31.56' }, progress => { + console.log(progress.downloadedBytes, progress.downloadedBytes); + }, () => console.log('download complete'), err => console.error(err)); + // downloadPreloadScript + const preloadScripts = [ + { url: 'http://whatever.com/script.js' } + ]; + fin.desktop.System.downloadPreloadScripts(preloadScripts, info => { + const downloadInfo = info[0]; + console.log(downloadInfo.success, downloadInfo.url, downloadInfo.error); + }, err => { + console.log(err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + //flushCookieStore + fin.desktop.System.flushCookieStore(() => { + console.log('successful'); + }, err => { + console.log('failure', err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getAppAssetInfo + fin.desktop.System.getAppAssetInfo({ alias: 'myAppAsset' }, info => { + console.log(info.alias, info.args, info.mandatory, info.src, info.target, info.version); + }, err => console.log(err)); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + //getCookieInfo + fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { + const cookie1 = cookies[0]; + console.log(cookie1.name, cookie1.domain, cookie1.path); + }, err => console.log(err)); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getDeviceUserId + fin.desktop.System.getDeviceUserId(id => console.log(id), err => console.error(err)); + // getEntityInfo + fin.desktop.System.getEntityInfo('uuid', 'name', info => { + console.log(info.entityType, info.name, info.uuid, info.parent.name, info.parent.uuid); + }, err => console.log(err)); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getFocusedWindow + fin.desktop.System.getFocusedWindow(win => { + console.log(win.uuid, win.name); + }, err => console.log(err)); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + //getMinLogLevel + fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // readRegistryValue + fin.desktop.System.readRegistryValue('HKEY_SOMETHING', 'HARDWARE\\SOMETHING', 'BootSomething', info => { + console.log(info.data, info.rootKey, info.subkey, info.type, info.value); + }, err => console.log(err)); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); - // release it. - fin.desktop.System.releaseExternalProcess(result.uuid, () => { - console.log("Process has been unmapped!"); - }, reason => { - console.log("failure: " + reason); - }); - }); - // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // showDeveloperTools - fin.desktop.System.showDeveloperTools("uuid", "name", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // terminateExternalProcess - fin.desktop.System.launchExternalProcess({ - // notepad is in the system's PATH - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + //setMinLogLevel + fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), err => console.error(err)); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); - // Attempt to close the process. Terminate after 4 seconds if it - // has not done so. - fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { - console.log("Termination result " + info.result); - }, reason => { - console.log("failure: " + reason); - }); - }); - // updateProxySettings - fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { - console.log('success'); - }, err => { - console.log(err); - }); + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); } function test_system_clipboard() { - // availableFormats - fin.desktop.System.Clipboard.availableFormats(null, formats => { - formats.forEach(format => console.log(`The format ${format} is available to read`)); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readHtml - fin.desktop.System.Clipboard.readHtml(null, html => { - console.log(`This is the html from the clipboard: ${html}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readRtf - fin.desktop.System.Clipboard.readRtf(null, rtf => { - console.log(`This is the rtf from the clipboard: ${rtf}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readText - fin.desktop.System.Clipboard.readText(null, text => { - console.log(`This is the text from the clipboard: ${text}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // write - fin.desktop.System.Clipboard.write({ - text: 'Hello Text!', - html: '

Hello Html

', - rtf: 'Hello Rtf' - }, null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeHtml - fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeRtf - fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeText - fin.desktop.System.Clipboard.writeText('Hello World', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

Hello Html

', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); } function test_window() { - let finWindow: fin.OpenFinWindow; - // constructor - finWindow = new fin.desktop.Window({ - name: "childWindow", - url: "child.html", - defaultWidth: 320, - defaultHeight: 320, - defaultTop: 10, - defaultLeft: 300, - frame: false, - resizable: false, - state: "normal" - }, () => { - const _win = finWindow.getNativeWindow(); - _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); - }, error => { - console.log("Error creating window:", error); - }); - // getCurrent - finWindow = fin.desktop.Window.getCurrent(); - // getNativeWindow - let nativeWindow: Window; - nativeWindow = finWindow.getNativeWindow(); - // getParentApplication - let parentApp: fin.OpenFinApplication; - parentApp = finWindow.getParentApplication(); - // getParentWindow - let parentFinWindow: fin.OpenFinWindow; - parentFinWindow = finWindow.getParentWindow(); - // wrap - finWindow = fin.desktop.Window.wrap("uuid", "name"); - // addEventListener - finWindow.addEventListener("bounds-changed", event => { - console.log("The window has been moved or resized"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure:" + reason); - }); - // animate - finWindow.animate({ - opacity: { - opacity: 0.15, - duration: 1000 - }, - position: { - left: 10, - top: 10, - duration: 3000 - } - }, { - interrupt: false - }, evt => { - // Callback will only fire after both "opacity" and "position" have finished animating. - }); - // authenticate - finWindow.addEventListener('auth-requested', evt => { - finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { - console.log("failure:", err); - }); - }); - // blur - finWindow.blur(); - // bringToFront - finWindow.bringToFront(); - // close - finWindow.close(); - // disableFrame - finWindow.disableFrame(); - // enableFrame - finWindow.enableFrame(); - // flash - finWindow.flash(); - // focus - finWindow.focus(); - // getBounds - finWindow.getBounds(bounds => { - console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); - }); - // getOptions - finWindow.getOptions(options => { - console.log(options); - }); - // getSnapshot - finWindow.getSnapshot(base64Snapshot => { - console.log("data:image/png;base64," + base64Snapshot); - }); - // getState - finWindow.getState(state => { - console.log("state: " + state); - }); - // getZoomLevel - finWindow.getZoomLevel(level => { - console.log("zoom level: " + level); - }, error => { - console.log('error:', error); - }); - // hide - finWindow.hide(); - // isShowing - finWindow.isShowing(showing => { - console.log("the window is " + (showing ? "showing" : "hidden")); - }); - // joinGroup - let secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When mainWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow); - }); - // leaveGroup - secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When finWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow, () => { - // once we are in the group, lets leave it. - secondWindow.leaveGroup(); - }); - }); - // maximize - finWindow.maximize(); - // mergeGroups - { - const finWindowOne = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowOne", - autoShow: true - }); - const finWindowTwo = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowTwo", - autoShow: true - }); - const finWindowThree = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowThree", - autoShow: true - }); - const finWindowFour = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowFour", - autoShow: true - }); - // When finWindowOne moves or is moved, finWindowTwo moves by the same amount - finWindowOne.joinGroup(finWindowTwo); - // When finWindowThree moves or is moved, finWindowFour moves by the same amount - finWindowThree.joinGroup(finWindowFour); - // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group - finWindowOne.mergeGroups(finWindowThree); - } - // minimize - finWindow.minimize(); - // moveBy - finWindow.moveBy(10, 10); - // moveTo - finWindow.moveTo(100, 200); - // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); - // resizeBy - finWindow.resizeBy(10, 10, "top-right"); - // resizeTo - finWindow.resizeTo(10, 10, "top-right"); - // restore - finWindow.restore(); - // setAsForeground - finWindow.setAsForeground(); - // setBounds - finWindow.setBounds(100, 200, 400, 400); - // setZoomLevel - finWindow.setZoomLevel(10); - // show - finWindow.show(); - // showAt - finWindow.showAt(10, 10, false); - // stopFlashing - finWindow.stopFlashing(); - // updateOptions - finWindow.updateOptions({ - frame: false, - maxWidth: 500 - }); + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} + +function test_frame() { + //wrap + const frame = fin.desktop.Frame.wrap('uuid', 'name'); + //getCurrent + const currentFrame = fin.desktop.Frame.getCurrent(); + // addEventlistener + frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + //removeEventListener + frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); + // getInfo + frame.getInfo(info => { + console.log(info.uuid, info.name, info.entityType, info.parent.uuid, info.parent.name); + }, err => console.error(err)); + // getParentWindow + frame.getParentWindow(parent => { + console.log(parent.uuid, parent.name, parent.entityType, parent.parent.uuid, parent.parent.name); + }, err => console.error(err)); } diff --git a/types/openfin/tsconfig.json b/types/openfin/tsconfig.json index fd3199ceb7..df2dae8b79 100644 --- a/types/openfin/tsconfig.json +++ b/types/openfin/tsconfig.json @@ -8,12 +8,17 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], + "paths": { + "openfin": [ + "openfin/v29" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -21,4 +26,4 @@ "index.d.ts", "openfin-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/openfin/tslint.json b/types/openfin/tslint.json index 64aace11d6..f93cf8562a 100644 --- a/types/openfin/tslint.json +++ b/types/openfin/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "max-line-length": false - } + "extends": "dtslint/dt.json" } diff --git a/types/openfin/v17/index.d.ts b/types/openfin/v17/index.d.ts new file mode 100644 index 0000000000..30afded19b --- /dev/null +++ b/types/openfin/v17/index.d.ts @@ -0,0 +1,1732 @@ +// Type definitions for OpenFin API 17.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.17.14 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, + * can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify + * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly + * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API + * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + */ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinApplicationEventType, + listener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Passes in custom data that will be relayed to the RVM + */ + registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinApplicationEventType, + previouslyRegisteredListener: (event: ApplicationBaseEvent + | TrayIconClickedEvent + | WindowEvent + | WindowAlertRequestedEvent + | WindowAuthRequested + | WindowNavigationRejectedEvent + | WindowEndLoadEvent) => any, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the application's icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. + * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to + * be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application + * to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + * Updatable + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the position from before the window was closed is used. + * This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. + * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + * Updatable + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + * Updatable + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + * Updatable + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + * Updatable + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. + * Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, + errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], + * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. + * A notification is typically used to alert the user of some important event which requires his or her attention. + * Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance + * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). + * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication. + * The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. + * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, + * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. + * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinSystemEventType, + listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?(result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }): void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + * @param options - The options of the window + * @param [callback] - Called if the window creation was successful + * @param [callback.successObj] - httpResponseCode + */ + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, + * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. + * The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, + * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the + * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. + * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window's frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. + * Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} diff --git a/types/openfin/v17/openfin-tests.ts b/types/openfin/v17/openfin-tests.ts new file mode 100644 index 0000000000..61b819018f --- /dev/null +++ b/types/openfin/v17/openfin-tests.ts @@ -0,0 +1,721 @@ +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, (successObj) => { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, (error) => { + console.log("Error creating application:", error); + }); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", (event) => { + console.log("The application has closed"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(children => { + children.forEach(childWindow => { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(allGroups => { + console.log(`There are a total of ${allGroups.length} groups.`); + + let groupCounter = 1; + allGroups.forEach(windowGroup => { + console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(manifest => { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(parentUuid => { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(config => { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); + // isRunning + application.isRunning(running => { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerCustomData({ + someData: "this is custom" + }, () => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // removeEventListener + const previousCallback = (event: fin.WindowEvent) => { }; + application.removeEventListener("closed", previousCallback, () => { + console.log("The unregistration was successful"); + }, err => { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(() => { + console.log("Removed the tray icon."); + }, err => { + console.log("failure:", err); + }); + // restart + application.restart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(() => { + console.log("You will not read this."); + }, err => { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, () => { + console.log("Successfully set new shortcut states"); + }, error => { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { + console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", () => { + console.log("waiting for hung application"); + application.wait(); + }); +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + const previousCallback = () => { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has subscribed to ${topic}`); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { + console.log(`The application ${uuid} has unsubscribed to ${topic}`); + }); + // removeSubscribeListener + const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { + console.log(`The application ${uuid} sent this message: ${message}`); + }); + // unsubscribe + const aRegisteredMessageListener = (message: any, senderUuid: string) => { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + // onClose: () => { }, + onDismiss: () => { }, + // onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', event => { + console.log("The monitor information has changed to: ", event); + }, () => { + console.log("The registration was successful"); + }, err => { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // downloadAsset + const dirAppAsset = { + src: 'http://local:8000/dir.zip', + alias: 'dirApp', + version: '1.23.24', + target: 'dir.bat', + args: '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + // lets launch our application asset. + // launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // exit + fin.desktop.System.exit(() => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(applicationInfoList => { + applicationInfoList.forEach(applicationInfo => { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(windowInfoList => { + windowInfoList.forEach(windowInfo => { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(args => { + console.log("The command line arguments are " + args); + }); + // getDeviceId + fin.desktop.System.getDeviceId(id => { + console.log("The id of the device is: " + id); + }); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { + console.log("this is the APPDATA value", variable); + }); + // getHostSpecs + fin.desktop.System.getHostSpecs(info => { + console.log(info); + }, error => { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(logList => { + logList.forEach(logInfo => { + console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); + }); + }); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(monitorInfo => { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(mousePosition => { + console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); + }); + // getProcessList + fin.desktop.System.getProcessList(list => { + list.forEach(process => { + console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(proxy => { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(rvmInfoObject => { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, err => { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(version => { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + // Additionally note that the executable found in the zip file specified in appAssets + // will default to the one mentioned by appAssets.target + // If the the path below refers to a specific path it will override this default + alias: "myApp", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log('Success:', payload.uuid); + }, error => { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", () => { + console.log("message successfully logged"); + }, err => { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener(result) { + console.log('the exit code', result.exitCode); + } + }, payload => { + console.log("The process is now being monitored: ", payload.uuid); + }, error => { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { + console.log(args); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // release it. + fin.desktop.System.releaseExternalProcess(result.uuid, () => { + console.log("Process has been unmapped!"); + }, reason => { + console.log("failure: " + reason); + }); + }); + // removeEventListener + const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", () => { + console.log("successful"); + }, err => { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system's PATH + path: "notepad", + arguments: "", + listener(result) { + console.log("The exit code", result.exitCode); + } + }, result => { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { + console.log("Termination result " + info.result); + }, reason => { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { + console.log('success'); + }, err => { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

Hello Html

', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, () => { + const _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); + }, error => { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", event => { + console.log("The window has been moved or resized"); + }, () => { + console.log("The registration was successful"); + }, reason => { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, evt => { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(bounds => { + console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); + }); + // getOptions + finWindow.getOptions(options => { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(base64Snapshot => { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(state => { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(level => { + console.log("zoom level: " + level); + }, error => { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(showing => { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, () => { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, () => { + // once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + const finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + const finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + const finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + const finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} diff --git a/types/openfin/v29/tsconfig.json b/types/openfin/v17/tsconfig.json similarity index 77% rename from types/openfin/v29/tsconfig.json rename to types/openfin/v17/tsconfig.json index df2dae8b79..fd3199ceb7 100644 --- a/types/openfin/v29/tsconfig.json +++ b/types/openfin/v17/tsconfig.json @@ -8,17 +8,12 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": true, + "strictFunctionTypes": false, "baseUrl": "../", "typeRoots": [ "../" ], "types": [], - "paths": { - "openfin": [ - "openfin/v29" - ] - }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -26,4 +21,4 @@ "index.d.ts", "openfin-tests.ts" ] -} +} \ No newline at end of file diff --git a/types/openfin/v17/tslint.json b/types/openfin/v17/tslint.json new file mode 100644 index 0000000000..64aace11d6 --- /dev/null +++ b/types/openfin/v17/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": false + } +} diff --git a/types/openfin/v29/index.d.ts b/types/openfin/v29/index.d.ts deleted file mode 100644 index 3ddbdf2edd..0000000000 --- a/types/openfin/v29/index.d.ts +++ /dev/null @@ -1,1891 +0,0 @@ -// Type definitions for OpenFin API 29.0 -// Project: https://openfin.co/ -// Definitions by: Chris Barker -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// based on v8.56.29.51 -// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean - -/** - * JavaScript API - * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, - * can communicate with other applications and has access to sandboxed system-level features. - * - * API Ready - * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify - * that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly - * after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. - * - * Overview - * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API - * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "documennt" objects. - */ -declare namespace fin { - const desktop: OpenFinDesktop; - - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - Frame: OpenFinFrameStatic; - } - - interface OpenFinApplicationStatic { - /** - * Creates a new Application. - * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. - */ - new ( - options: ApplicationOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; - /** - * Launches the given Application manifest. - */ - createFromManifest(manifestUrl: string, callback?: (app: OpenFinApplication) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } - - /** - * Application - * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. - */ - interface OpenFinApplication { - /** - * Returns an instance of the main Window of the application - */ - getWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinApplicationEventType, - listener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Closes the application and any child windows created by the application. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. - */ - getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. - */ - getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. - */ - getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. - */ - getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves current configuration of application's shortcuts. - */ - getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves information about the system tray. - */ - getTrayIconInfo(callback?: (trayInfo: TrayIconInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the application is currently running. - */ - isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Registers a username and an app name for licensing purposes. - */ - registerUser(userName: string, appName: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinApplicationEventType, - previouslyRegisteredListener: (event: ApplicationBaseEvent - | TrayIconClickedEvent - | WindowEvent - | WindowAlertRequestedEvent - | WindowAuthRequested - | WindowNavigationRejectedEvent - | WindowEndLoadEvent) => any, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the application's icon from the tray. - */ - removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restarts the application. - */ - restart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Runs the application. When the application is created, run must be called. - */ - run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * Tells the rvm to relaunch the main application once upon a complete shutdown - */ - scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets new shortcut configuration for current application. - * Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to - * be able to change shortcut states. - */ - setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Adds a customizable icon in the system tray and notifies the application when clicked. - */ - setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the application by terminating its process. - */ - terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application - * to continue and to generate another "not-responding" message after a certain period of time. - */ - wait(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * The Application's uuid - */ - uuid: string; - } - - interface ShortCutConfig { - /** - * application has a shortcut on the desktop - */ - desktop?: boolean; - /** - * application has no shortcut in the start menu - */ - startMenu?: boolean; - /** - * application will be launched on system startup - */ - systemStartup?: boolean; - } - - interface SuccessObj { - httpResponseCode: number; - } - - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } - - interface ErrorInfo { - stack: string; - message: string; - } - - interface ApplicationOptions { - /** - * The name of the application. - */ - name?: string; - /** - * The url to the application. - */ - url?: string; - /** - * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. - */ - uuid?: string; - /** - * Enable Flash at the application level. Default: false. - */ - plugins?: boolean; - /** - * The options of the main window of the application. - */ - mainWindowOptions?: WindowOptions; - } - - interface WindowOptions { - /** - * Enable keyboard shortcuts for devtools and zoom. Default: false for both. - */ - accelerator?: { - devtools?: boolean, - zoom?: boolean, - reload?: boolean, - reloadIgnoreCache?: boolean, - }; - /** - * A flag to always position the window at the top of the window stack. Default: false. - * Updatable - */ - alwaysOnTop?: boolean; - /** - * A flag to automatically show the Window when it is created. Default: false. - */ - autoShow?: boolean; - /** - * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true - * Updatable - */ - contextMenu?: boolean; - /** - * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. - * Updatable - */ - cornerRounding?: { - width?: number; - height?: number; - }; - /** - * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. - */ - customData?: any; - /** - * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the position from before the window was closed is used. - * This option overrides defaultLeft and defaultTop. Default: false. - */ - defaultCentered?: boolean; - /** - * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. - */ - defaultHeight?: number; - /** - * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. - */ - defaultWidth?: number; - /** - * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. - */ - defaultTop?: number; - /** - * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. - * When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. - */ - defaultLeft?: number; - /** - * A flag to show the frame. Default: true. - * Updatable - */ - frame?: boolean; - /** - * A flag to allow a window to be hidden when the close button is clicked.Default: false. - * Updatable - */ - hideOnClose?: boolean; - /** - * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. - * Updatable - */ - icon?: string; - /** - * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxHeight?: number; - /** - * A flag that lets the window be maximized.Default: true. - * Updatable - */ - maximizable?: boolean; - /** - * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. - * Updatable - */ - maxWidth?: number; - /** - * The minimum height of a window.Default: 0. - * Updatable - */ - minHeight?: number; - /** - * A flag that lets the window be minimized.Default: true. - */ - minimizable?: boolean; - /** - * The minimum width of a window.Default: 0. - */ - minWidth?: number; - /** - * The name for the window which must be unique within the context of the invoking Application. - */ - name?: string; - /** - * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. - * Updatable - */ - opacity?: number; - /** - * A flag to drop to allow the user to resize the window.Default: true. - * Updatable - */ - resizable?: boolean; - /** - * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. - * Updatable - */ - resizeRegion?: { - /** - * The size in pixels (Default: 2), - */ - size?: number; - /** - * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a - * frameless window. (Default: 4) - */ - bottomRightCorner?: number; - }; - /** - * A flag to show the Window's icon in the taskbar. Default: true. - */ - showTaskbarIcon?: boolean; - /** - * A flag to cache the location of the window or not. Default: true. - */ - saveWindowState?: boolean; - /** - * Specify a taskbar group for the window. Default: app's uuid. - */ - taskbarIconGroup?: string; - /** - * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". - */ - state?: string; - /** - * The URL of the window. Default: "about:blank". - */ - url?: string; - /** - * When set to false, the window will render before the "load" event is fired on the content's window. - * Caution, when false you will see an initial empty white window. Default: true. - */ - waitForPageLoad?: boolean; - } - - /** - * Clipboard - * Clipboard API allows reading and writting to the clipboard in multiple formats. - */ - interface OpenFinClipboard { - /** - * Reads available formats for the clipboard type - */ - availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Reads available formats for the clipboard type - */ - readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as Rtf - */ - readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Read the content of the clipboard as plain text - */ - readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard - */ - write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Html - */ - writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as Rtf - */ - writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Writes data into the clipboard as plain text - */ - writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - interface OpenFinExternalApplicationStatic { - /** - * Returns an External Application object that represents an existing external application. - */ - wrap(uuid: string): OpenFinExternalApplication; - } - /** - * ExternalApplication - * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. - */ - interface OpenFinExternalApplication { - /** - * Retrieves information about the application. - */ - getInfo(callback?: (info: ExternalApplicationInfo) => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinExternalApplicationEventType, - listener: () => void, - callback?: () => void, - errorCallback?: (reason: string, error: ErrorInfo) => void): void; - } - - /** - * InterApplicationBus - * A messaging bus that allows for pub/sub messaging between different applications. - */ - interface OpenFinInterApplicationBus { - /** - * Adds a listener that gets called when applications subscribe to the current application's messages. - */ - addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Adds a listener that gets called when applications unsubscribe to the current application's messages. - */ - addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered subscribe listener. - */ - removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Removes a previously registered unsubscribe listener. - */ - removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; - /** - * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. - */ - publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sends a message to a specific application on a specific topic. - */ - send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], - * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. - */ - subscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - subscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Unsubscribes to messages from the specified application on the specified topic. - */ - unsubscribe( - senderUuid: string, - name: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - unsubscribe( - senderUuid: string, - topic: string, - listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - } - - interface OpenFinNotificationStatic { - /** - * ctor - */ - new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; - /** - * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. - */ - getCurrent(): OpenFinNotification; - } - - /** - * Notification - * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. - * A notification is typically used to alert the user of some important event which requires his or her attention. - * Notifications are a child or your application that are controlled by the runtime. - */ - interface OpenFinNotification { - /** - * Closes the notification. - */ - close(callback?: () => void): void; - /** - * Sends a message to the notification. - */ - sendMessage(message: any, callback?: () => void): void; - /** - * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. - */ - sendMessageToApplication(message: any, callback?: () => void): void; - } - - interface NotificationOptions { - /** - * A boolean that will force dismissal even if the mouse is hovering over the notification - */ - ignoreMouseOver?: boolean; - /** - * A message of any primitive or composite-primitive type to be passed to the notification upon creation. - */ - message?: any; - /** - * The timeout for displaying a notification.Can be in milliseconds or "never". - */ - duration?: number | "never"; - /** - * The url of the notification - */ - url?: string; - /** - * A function that is called when a notification is clicked. - */ - onClick?(callback: () => void): void; - /** - * Invoked when the notification is closed via .close() method on the created notification instance - * or the by the notification itself via fin.desktop.Notification.getCurrent().close(). - * NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss - */ - onClose?(callback: () => void): void; - /** - * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. - */ - onDismiss?(callback: () => void): void; - /** - * A function that is called when an error occurs.The reason for the error is passed as an argument. - */ - onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; - /** - * The onMessage function will respond to messages sent from notification.sendMessageToApplication. - * The function is passed the message, which can be of any primitive or composite-primitive type. - */ - onMessage?(callback: (message: any) => void): void; - /** - * A function that is called when a notification is shown. - */ - onShow?(callback: (successObj: SuccessObj) => void): void; - } - - /** - * System - * An object representing the core of OpenFin Runtime. - * Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. - */ - interface OpenFinSystem { - Clipboard: OpenFinClipboard; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Clears cached data containing window state/positions, - * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. - */ - clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Clears all cached data when OpenFin Runtime exits. - */ - deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Downloads the given application asset - */ - downloadAsset( - assetObj: AppAssetInfo, - progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; - - /** - * Download preload scripts from given URLs - */ - downloadPreloadScripts(scripts: Array, callback?: (downloadInfo: Array) => void, - errorCallback?: (reason: string) => void): void; - /** - * Downloads the given OpenFin Runtime. - */ - downloadRuntime(options: RuntimeDownloadOptions, onProgress?: (progress: RuntimeDownloadProgress) => void, onComplete?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Exits the Runtime. - */ - exit(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Writes any unwritten cookies data to disk. - */ - flushCookieStore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all applications. - */ - getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data for all external applications. - */ - getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of data (name, ids, bounds) for all application windows. - */ - getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the app asset. - */ - getAppAssetInfo(options: AppAssetOptions, callback?: (appAssetInfo: AppAssetInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Get additional info of cookies. - */ - getCookies(option: CookieOption, callback?: (info: Array) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the command line argument string that started OpenFin Runtime. - */ - getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the configuration object that started the OpenFin Runtime. - */ - getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns a hex encoded hash of the mac address and the currently logged in user name - */ - getDeviceUserId(callback?: (id: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns an Entity info object relating to the entity specified by the uuid and name passed in. The possible types are 'window', 'iframe', 'external connection' or 'unknown'. - */ - getEntityInfo(uuid: string, name: string, callback?: (info: EntityInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the value of a given environment variable on the computer on which the runtime is installed. - */ - getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves currently focused window identity. - */ - getFocusedWindow(callback?: (focusedWindowIdentity: Identity) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves system information. - */ - getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the contents of the log with the specified filename. - */ - getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing information for each log file. - */ - getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the minimum (inclusive) logging level that is currently being written to the logs. - */ - getMinLogLevel(callback?: (logLevel: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. - */ - getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the mouse in virtual screen coordinates (left, top). - */ - getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array of all of the runtime processes that are currently running. - * Each element in the array is an object containing the uuid and the name of the application to which the process belongs. - */ - getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves the Proxy settings. - */ - getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns information about the running RVM in an object. - */ - getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. - */ - getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Runs an executable or batch file. - */ - launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Writes the passed message into both the log file and the console. - */ - log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Monitors a running process. - */ - monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Opens the passed URL in the default web browser. - */ - readRegistryValue(rootKey: string, subkey: string, value: string, callback?: (info: RegistryInfo) => void, - errorCallback?: (reason: string) => void): void; - /** - * This function call will register a unique id and produce a token. The token can be used to broker an external connection. - */ - registerExternalConnection( - uuid: string, - callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). - */ - releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinSystemEventType, - listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Set the minimum log level above which logs will be written to the OpenFin log - */ - setMinLogLevel(logLevel: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the Chrome Developer Tools for the specified window. - */ - showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. - */ - terminateExternalProcess( - processUuid: string, - timeout: number, - killTree: boolean, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - terminateExternalProcess( - processUuid: string, - timeout: number, - callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, - errorCallback?: (reason: string) => void): void; - /** - * Update the OpenFin Runtime Proxy settings. - */ - updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface CacheOptions { - cache?: boolean; - cookies?: boolean; - localStorage?: boolean; - appcache?: boolean; - userData?: boolean; - } - - interface AppAssetInfo { - src?: string; - alias?: string; - version?: string; - target?: string; - args?: string; - mandatory?: boolean; - } - - interface AppAssetOptions { - alias: string; - } - - interface ApplicationInfo { - /** - * true when the application is running. - */ - isRunning?: boolean; - /** - * uuid of the application. - */ - uuid?: string; - /** - * uuid of the application that launches this application. - */ - parentUuid?: string; - } - - interface Identity { - uuid: string; - name: string; - } - - interface EntityInfo { - name: string; - uuid: string; - parent: Identity; - entityType: string; - } - - interface DownloadPreloadOption { - url: string; - } - - interface DownloadPreloadInfo { - success: boolean; - url?: string; - error: string; - } - - - interface CookieInfo { - name: string; - // expirationDate: Date; - domain: string; - path: string; - } - - interface CookieOption { - name: string; - } - - interface RegistryInfo { - data: any; - rootKey: string; - subkey: string; - type: string; - value: string; - } - - interface RuntimeDownloadOptions { - version: string; - } - - interface RuntimeDownloadProgress { - downloadedBytes: number; - totalBytes: number; - } - - interface WindowDetails { - uuid?: string; - mainWindow?: WindowInfo; - childWindows?: WindowInfo[]; - } - - interface WindowInfo { - /** - * name of the child window - */ - name?: string; - /** - * top-most coordinate of the child window - */ - top?: number; - /** - * right-most coordinate of the child window - */ - right?: number; - /** - * bottom-most coordinate of the child window - */ - bottom?: number; - /** - * left-most coordinate of the child window - */ - left?: number; - } - - interface HostSpecInfo { - /** - * "x86" for 32-bit or "x86_64" for 64-bit - */ - arch: string; - /** - * Same payload as Node's os.cpus() - */ - cpus: NodeCpuInfo[]; - gpu: { - /** - * Graphics card name - */ - name: string; - }; - /** - * Same payload as Node's os.totalmem() - */ - memory: number; - /** - * OS name and version/edition - */ - name: string; - } - - interface NodeCpuInfo { - model: string; - /** - * in MHz - */ - speed: number; - times: { - /** - * The number of milliseconds the CPU has spent in user mode. - */ - user: number; - /** - * The number of milliseconds the CPU has spent in nice mode. - */ - nice: number; - /** - * The number of milliseconds the CPU has spent in sys mode. - */ - sys: number; - /** - * The number of milliseconds the CPU has spent in idle mode. - */ - idle: number; - /** - * The number of milliseconds the CPU has spent in irq mode. - */ - irq: number; - }; - } - - interface LogInfo { - /** - * the filename of the log - */ - name?: string; - /** - * the size of the log in bytes - */ - size?: number; - /** - * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" - */ - date?: string; - } - - interface ProcessInfo { - /** - * the percentage of total CPU usage - */ - cpuUsage?: number; - /** - * the application name - */ - name?: string; - /** - * the current nonpaged pool usage in bytes - */ - nonPagedPoolUsage?: number; - /** - * the number of page faults - */ - pageFaultCount?: number; - /** - * the current paged pool usage in bytes - */ - pagedPoolUsage?: number; - /** - * the total amount of memory in bytes that the memory manager has committed - */ - pagefileUsage?: number; - /** - * the peak nonpaged pool usage in bytes - */ - peakNonPagedPoolUsage?: number; - /** - * the peak paged pool usage in bytes - */ - peakPagedPoolUsage?: number; - /** - * the peak value in bytes of pagefileUsage during the lifetime of this process - */ - peakPagefileUsage?: number; - /** - * the peak working set size in bytes - */ - peakWorkingSetSize?: number; - /** - * the native process identifier - */ - processId?: number; - /** - * the application UUID - */ - uuid?: string; - /** - * the current working set size (both shared and private data) in bytes - */ - workingSetSize?: number; - } - - interface ProxyInfo { - /** - * the configured Proxy Address - */ - proxyAddress?: string; - /** - * the configured Proxy port - */ - proxyPort?: number; - /** - * Proxy Type - */ - type?: string; - } - - interface RvmInfo { - version?: string; - "start-time"?: string; - } - - interface ExternalProcessLaunchInfo { - path?: string; - /** - * Additionally note that the executable found in the zip file specified in appAssets - * will default to the one mentioned by appAssets.target - * If the the path below refers to a specific path it will override this default - */ - alias?: string; - /** - * When using alias; if no arguments are passed then the arguments (if any) - * are taken from the 'app.json' file, from the 'args' parameter - * of the 'appAssets' Object with the relevant 'alias'. - * If 'arguments' is passed as a parameter it takes precedence - * over any 'args' set in the 'app.json'. - */ - arguments?: string; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - certificate?: CertificationInfo; - } - - interface CertificationInfo { - /** - * A hex string with or without spaces - */ - serial?: string; - /** - * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields - */ - subject?: string; - /** - * A hex string with or without spaces - */ - publickey?: string; - /** - * A hex string with or without spaces - */ - thumbprint?: string; - /** - * A boolean indicating that the certificate is trusted and not revoked - */ - trusted?: boolean; - } - - interface ExternalProcessInfo { - pid?: number; - listener?(result: { - /** - * "Exited" Or "released" on a call to releaseExternalProcess - */ - topic?: string; - /** - * The mapped UUID which identifies the launched process - */ - uuid?: string; - /* - * Process exit code - */ - exitCode?: number; - }): void; - } - - interface OpenFinWindowStatic { - /** - * Class: Window - * - * new Window(options, callbackopt, errorCallbackopt) - * - * Creates a new OpenFin Window - * - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - * @param options - The options of the window - * @param [callback] - Called if the window creation was successful - * @param [callback.successObj] - httpResponseCode - */ - new ( - options: WindowOptions, - callback?: (successObj: { httpResponseCode: number }) => void, - errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; - /** - * Returns an instance of the current window. - * @returns Current window - */ - getCurrent(): OpenFinWindow; - /** - * Returns a Window object that wraps an existing window. - */ - wrap(appUuid: string, windowName: string): OpenFinWindow; - } - - /** - * Window - * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, - * maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. - * The new window appears in the same process as the parent window. - */ - interface OpenFinWindow { - /** - * Name of window - */ - name: string; - /** - * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, - * otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the - * contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. - * Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). - * @returns Native window - */ - getNativeWindow(): Window; - /** - * Gets the parent application. - * @returns Parent application - */ - getParentApplication(): OpenFinApplication; - /** - * Gets the parent window. - */ - getParentWindow(): OpenFinWindow; - /** - * Registers an event listener on the specified event. - */ - addEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Performs the specified window transitions - */ - animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; - /** - * Provides credentials to authentication requests - */ - authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; - /** - * Removes focus from the window. - */ - blur(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Brings the window to the front of the OpenFin window stack. - */ - bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Closes the window. - * @param Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. - */ - close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Prevents a user from changing a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-disabled' is generated when an enabled frame becomes disabled. - */ - disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Re-enables user changes to a window's size/position when using the window's frame. - * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. - * 'disabled-frame-bounds-changed' is generated after a user move/size operation. - * The events provide the bounds that would have been applied if the frame was enabled. - * 'frame-enabled' is generated when a disabled frame has becomes enabled. - */ - enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Flashes the window's frame and taskbar icon until the window is activated. - */ - flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gives focus to the window. - */ - focus(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current bounds (top, left, width, height) of the window. - */ - getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; - /** - * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. - * Please note that calling window is included in the result array. - */ - getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current settings of the window. - */ - getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets a base64 encoded PNG snapshot of the window. - */ - getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; - /** - * Gets the current state ("minimized", "maximized", or "restored") of the window. - */ - getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; - /** - * Returns the zoom level of the window. - */ - getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; - /** - * Hides the window. - */ - hide(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Determines if the window is currently showing. - */ - isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; - /** - * Joins the same window group as the specified window. - */ - joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Leaves the current window group so that the window can be move independently of those in the group. - */ - leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Maximizes the window. - */ - maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Merges the instance's window group with the same window group as the specified window - */ - mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Minimizes the window. - */ - minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window by a specified amount. - */ - moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Moves the window to a specified location. - */ - moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Removes a previously registered event listener from the specified event. - */ - removeEventListener( - type: OpenFinWindowEventType, - listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, - callback?: () => void, - errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Resizes the window by a specified amount. - */ - resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Restores the window to its normal state (i.e., unminimized, unmaximized). - */ - restore(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Will bring the window to the front of the entire stack and give it focus. - */ - setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the window's size and position - */ - setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Sets the zoom level of the window. - */ - setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden. - * @param Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. - */ - show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. - */ - showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Stops the taskbar icon from flashing. - */ - stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; - /** - * Updates the window using the passed options - */ - updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface OpenFinFrameStatic { - wrap(uuid: string, name: string): OpenFinFrame; - - getCurrent(): OpenFinFrame; - } - - interface OpenFinFrame { - name: string; - uuid: string; - - addEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - - getParentWindow(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; - - getInfo(callback?: (entityInfo: EntityInfo) => void, errorCallback?: (reason: string) => void): void; - - removeEventListener(type: string, listener: () => void, callback?: () => void, errorCallback?: (reason: string) => void): void; - } - - interface ApplicationBaseEvent { - topic: string; - type: OpenFinApplicationEventType; - uuid: string; - } - - interface TrayIconClickedEvent extends ApplicationBaseEvent { - button: number; // 0 for left, 1 for middle, 2 for right - monitorInfo: MonitorInfo; - x: number; // the cursor x coordinate - y: number; // the cursor y coordinate - } - - interface WindowEvent extends ApplicationBaseEvent { - name: string; - } - - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } - - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } - - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } - - interface MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } - - interface MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } - - interface TrayIconInfo { - x: number; - y: number; - bounds: { - x: number; - y: number; - width: number; - height: number; - } - monitorInfo: MonitorInfo - } - - interface MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } - - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } - - interface VirtualScreenCoordinates { - left: number; - top: number; - } - - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } - - interface DesktopIconClickedEvent { - mouse: { - /** - * the left virtual screen coordinate of the mouse - */ - left: number, - /** - * the top virtual screen coordinate of the mouse - */ - top: number - }; - /** - * the number of milliseconds that have elapsed since the system was started, - */ - tickCount: number; - topic: "system"; - type: "desktop-icon-clicked"; - } - - interface IdleStateChangedEvent { - /** - * How long in milliseconds since the user has been idle. - */ - elapsedTime: number; - /** - * true when the user is idle,false when the user has returned; - */ - isIdle: boolean; - topic: "system"; - type: "idle-state-changed"; - } - - interface WindowBaseEvent { - /** - * the name of the window - */ - name: string; - /** - * always window - */ - topic: "window"; - /** - * window event type - */ - type: OpenFinWindowEventType; - /** - * the UUID of the application the window belongs to - */ - uuid: string; - } - - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } - - interface WindowBoundsEvent extends WindowBaseEvent { - /** - * describes what kind of change occurred. - * 0 means a change in position. - * 1 means a change in size. - * 2 means a change in position and size. - */ - changeType: number; - /** - * true when pending changes have been applied to the window. - */ - deferred: boolean; - /** - * the new height of the window. - */ - height: number; - /** - * the left-most coordinate of the window. - */ - left: number; - /** - * the top-most coordinate of the window. - */ - top: number; - - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } - - interface WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } - - interface WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } - - interface WindowGroupChangedEvent extends WindowBaseEvent { - /** - * Which group array the window that the event listener was registered on is included in: - * 'source' The window is included in sourceGroup. - * 'target' The window is included in targetGroup. - * 'nothing' The window is not included in sourceGroup nor targetGroup. - */ - memberOf: "source" | "target" | "nothing"; - /** - * The reason this event was triggered. - * 'leave' A window has left the group due to a leave or merge with group. - * 'join' A window has joined the group. - * 'merge' Two groups have been merged together. - * 'disband' There are no other windows in the group. - */ - reason: "leave" | "join" | "merge" | "disband"; - /** - * All the windows in the group the sourceWindow originated from. - */ - sourceGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. - */ - sourceWindowAppUuid: string; - /** - * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. - */ - sourceWindowName: string; - /** - * All the windows in the group the targetWindow orginated from - */ - targetGroup: WindowOfGroupInfo[]; - /** - * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowAppUuid: string; - /** - * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). - */ - targetWindowName: string; - type: "group-changed"; - } - - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } - - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } - - interface Window_NavigationRejectedEvent { - name: string; - /** - * source of navigation window name - */ - sourceName: string; - topic: "navigation-rejected"; - /** - * Url that was not reached "http://blocked-content.url" - */ - url: string; - /** - * the UUID of the application the window belongs to. - */ - uuid: string; - } - - interface AnimationTransition { - opacity?: { - /** - * This value is clamped from 0.0 to 1.0 - */ - opacity?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'opacity' as absolute or as a delta. Defaults to false. - */ - relative?: boolean; - }; - position?: { - /** - * Defaults to the window's current left position in virtual screen coordinates. - */ - left?: number; - /** - * Defaults to the window's current top position in virtual screen coordinates. - */ - top?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - size?: { - /** - * Optional if height is present. Defaults to the window's current width. - */ - width?: number; - /** - * Optional if width is present. Defaults to the window's current height. - */ - height?: number; - /** - * The total time in milliseconds this transition should take. - */ - duration?: number; - /** - * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. - */ - relative?: boolean; - }; - } - - interface AnimationOptions { - /** - * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. - */ - interrupt?: boolean; - /** - * Transition effect. Defaults to 'ease-in-out'. - */ - tween?: OpenFinTweenType; - } - - interface WindowBounds { - /** - * the height of the window. - */ - height?: number; - /** - * left-most coordinate of the window. - */ - left?: number; - /** - * top-most coordinate of the window. - */ - top?: number; - /** - * the width of the window. - */ - width?: number; - } - - interface ExternalApplicationInfo { - parent: { - uuid: string; - name: string; - } - } - - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "session-changed"; - } - - interface LaunchInfo { - launchMode: "fin-protocol" - | "fins-protocol" - | "shortcut" - | "command-line" - | "adapter" - | "other" - | string; - } - - type OpenFinTweenType = "linear" - | "ease-in" - | "ease-out" - | "ease-in-out" - | "ease-in-quad" - | "ease-out-quad" - | "ease-in-out-quad" - | "ease-in-cubic" - | "ease-out-cubic" - | "ease-in-out-cubic" - | "ease-out-bounce" - | "ease-in-back" - | "ease-out-back" - | "ease-in-out-back" - | "ease-in-elastic" - | "ease-out-elastic" - | "ease-in-out-elastic"; - - type OpenFinApplicationEventType = "closed" - | "connected" - | "crashed" - | "initialized" - | "manifest-changed" - | "not-responding" - | "out-of-memory" - | "responding" - | "run-requested" - | "started" - | "tray-icon-clicked" - | "window-alert-requested" - | "window-auth-requested" - | "window-closed" - | "window-created" - | "window-end-load" - | "window-navigation-rejected" - | "window-show-requested" - | "window-start-load"; - - type OpenFinExternalApplicationEventType = "connected" - | "disconnected"; - - type OpenFinSystemEventType = "application-closed" - | "application-crashed" - | "application-created" - | "application-started" - | "desktop-icon-clicked" - | "idle-state-changed" - | "monitor-info-changed" - | "session-changed"; - - type OpenFinWindowEventType = "auth-requested" - | "blurred" - | "bounds-changed" - | "bounds-changing" - | "close-requested" - | "closed" - | "disabled-frame-bounds-changed" - | "disabled-frame-bounds-changing" - | "embedded" - | "external-process-exited" - | "external-process-started" - | "focused" - | "frame-disabled" - | "frame-enabled" - | "group-changed" - | "hidden" - | "initialized" - | "maximized" - | "minimized" - | "navigation-rejected" - | "restored" - | "show-requested" - | "shown"; - - type OpenFinAnchor = "top-left" - | "top-right" - | "bottom-left" - | "bottom-right"; -} diff --git a/types/openfin/v29/openfin-tests.ts b/types/openfin/v29/openfin-tests.ts deleted file mode 100644 index 2b5237c1e8..0000000000 --- a/types/openfin/v29/openfin-tests.ts +++ /dev/null @@ -1,797 +0,0 @@ -function test_application() { - let application: fin.OpenFinApplication; - // constructor - application = new fin.desktop.Application({ - url: "application.html", - uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", - name: "Application Name", - plugins: false, - mainWindowOptions: { - defaultHeight: 600, - defaultWidth: 800, - defaultTop: 300, - defaultLeft: 300, - autoShow: true - } - }, (successObj) => { - console.log("Application successfully created, HTTP response code:", successObj); - application.run(); - }, (error) => { - console.log("Error creating application:", error); - }); - //createFromManifest - fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { - console.log(app.uuid); - }, err => console.log(err)); - // getCurrent - application = fin.desktop.Application.getCurrent(); - // wrap - application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); - // getWindow - application.getWindow(); - // addEventListener - application.addEventListener("closed", (event) => { - console.log("The application has closed"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure: " + reason); - }); - // close - application.close(); - // getChildWindows - application.getChildWindows(children => { - children.forEach(childWindow => { - console.log("Showing child: " + childWindow.name); - childWindow.show(); - }); - }); - // getGroups - application.getGroups(allGroups => { - console.log(`There are a total of ${allGroups.length} groups.`); - - let groupCounter = 1; - allGroups.forEach(windowGroup => { - console.log(`Group ${groupCounter} contains ${windowGroup.length} windows.`); - ++groupCounter; - }); - }); - // getManifest - application.getManifest(manifest => { - console.log("Application manifest:"); - console.log(manifest); - }); - // getParentUuid - application.getParentUuid(parentUuid => { - console.log("UUID of parent application:"); - console.log(parentUuid); - }); - // getShortcuts - application.getShortcuts(config => { - console.log("Desktop shortcut is enabled: ", config.desktop); - console.log("Start Menu shortcut is enabled: ", config.startMenu); - console.log("System Startup shortcut is enabled: ", config.systemStartup); - }); - // getInfo - application.getInfo(info => { - console.log(`Launch mode: ${info.launchMode}`); - }); - // getTrayIconInfo - application.getTrayIconInfo(info => { - console.log(info.x, info.y, info.bounds.x, info.bounds.y, info.bounds.height, info.bounds.width, - info.monitorInfo.type, info.monitorInfo.reason); - }); - // isRunning - application.isRunning(running => { - console.log("the application is", running ? "running" : "not running"); - }); - // registerCustomData - application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); - // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { - console.log("The unregistration was successful"); - }, err => { - console.log("failure:", err); - }); - // removeTrayIcon - application.removeTrayIcon(() => { - console.log("Removed the tray icon."); - }, err => { - console.log("failure:", err); - }); - // restart - application.restart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // schedule restart - application.scheduleRestart(() => { - console.log("You will not read this."); - }, err => { - console.log("failure:", err); - }); - // setShortcuts - application.setShortcuts({ - desktop: true, - startMenu: false, - systemStartup: true - }, () => { - console.log("Successfully set new shortcut states"); - }, error => { - console.log("Failed to set new shortcut states. Error: ", error); - }); - // setTrayIcon - application.setTrayIcon("https://developer.openf.in/download/openfin.png", clickInfo => { - console.log(`The mouse has clicked at (${clickInfo.x}, ${clickInfo.y})`); - }); - // terminate - application.terminate(); - // wait - application.addEventListener("not-responding", () => { - console.log("waiting for hung application"); - application.wait(); - }); - //uuid - let hasUuid = application.uuid; -} - -function test_external_application() { - let externalApp: fin.OpenFinExternalApplication; - // wrap - externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); - // addEventListener - externalApp.addEventListener('connected', () => { - console.log('external app connected'); - }, () => { - console.log('The registration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - // removeEventListener - const previousCallback = () => { }; - externalApp.removeEventListener('connected', previousCallback, () => { - console.log('The unregistration was successful'); - }, (reason, err) => { - console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); - }); - - // getInfo - externalApp.getInfo(info => { - console.log(info.parent.uuid, info.parent.name); - }, err => console.log(err)); -} - -function test_inter_application_bus() { - // addSubscribeListener - fin.desktop.InterApplicationBus.addSubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has subscribed to ${topic}`); - }); - // addUnsubscribeListener - fin.desktop.InterApplicationBus.addUnsubscribeListener((uuid, topic, name) => { - console.log(`The application ${uuid} has unsubscribed to ${topic}`); - }); - // removeSubscribeListener - const aRegisteredListener = (uuid: string, topic: string, name: string) => { }; - fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); - // removeUnsubscribeListener - fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); - // publish - fin.desktop.InterApplicationBus.publish("a topic", { - field1: "value1", - field2: "value2" - }); - // send - fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { - field1: "value1", - field2: "value2" - }); - // subscribe - fin.desktop.InterApplicationBus.subscribe("*", "a topic", (message, uuid, name) => { - console.log(`The application ${uuid} sent this message: ${message}`); - }); - // unsubscribe - const aRegisteredMessageListener = (message: any, senderUuid: string) => { - console.log(message, senderUuid); - }; - fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); -} - -function test_notification() { - let notification: fin.OpenFinNotification; - // getCurrent - notification = fin.desktop.Notification.getCurrent(); - // close - notification.close(); - // sendMessage - notification = new fin.desktop.Notification({ - duration: 10, - url: "http://localhost:5000/Account/Register", - message: "Hello", - onShow: () => { }, - // onClose: () => { }, - onDismiss: () => { }, - // onClick: () => { }, - onMessage: () => { }, - onError: () => { } - }); - // sendMessageToApplication - notification.sendMessageToApplication("some message"); -} - -function test_system() { - // addEventListener - fin.desktop.System.addEventListener('monitor-info-changed', event => { - console.log("The monitor information has changed to: ", event); - }, () => { - console.log("The registration was successful"); - }, err => { - console.log("failure: " + err); - }); - // clearCache - fin.desktop.System.clearCache({ - cache: true, - cookies: true, - localStorage: true, - appcache: true, - userData: true - }); - // deleteCacheOnExit - fin.desktop.System.deleteCacheOnExit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // downloadAsset - const dirAppAsset = { - src: 'http://local:8000/dir.zip', - alias: 'dirApp', - version: '1.23.24', - target: 'dir.bat', - args: '' - }; - fin.desktop.System.downloadAsset(dirAppAsset, progress => { - const downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); - console.log(`Downloaded ${downloadedPercent}%`); - }, p => { - console.log(`Downlod complete, can be found on ${p.path}`); - // lets launch our application asset. - // launchDirApp(); - }, (reason, err) => { - console.log(reason, err); - }); - // downloadRuntime - fin.desktop.System.downloadRuntime({ version: '9.61.31.56' }, progress => { - console.log(progress.downloadedBytes, progress.downloadedBytes); - }, () => console.log('download complete'), err => console.error(err)); - // downloadPreloadScript - const preloadScripts = [ - { url: 'http://whatever.com/script.js' } - ]; - fin.desktop.System.downloadPreloadScripts(preloadScripts, info => { - const downloadInfo = info[0]; - console.log(downloadInfo.success, downloadInfo.url, downloadInfo.error); - }, err => { - console.log(err); - }); - // exit - fin.desktop.System.exit(() => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - //flushCookieStore - fin.desktop.System.flushCookieStore(() => { - console.log('successful'); - }, err => { - console.log('failure', err); - }); - // getAllApplications - fin.desktop.System.getAllApplications(applicationInfoList => { - applicationInfoList.forEach(applicationInfo => { - console.log("Showing information for application with uuid: " - + applicationInfo.uuid); - console.log("isRunning: ", applicationInfo.isRunning); - }); - }); - // getAllExternalApplications - fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { - externalAppsInfoList.forEach(appInfo => { - console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); - }); - }); - // getAllWindows - fin.desktop.System.getAllWindows(windowInfoList => { - windowInfoList.forEach(windowInfo => { - console.log("Showing information for application with uuid: ", windowInfo.uuid); - console.log("Main window: ", windowInfo.mainWindow); - console.log("Child windows: ", windowInfo.childWindows); - }); - }); - // getAppAssetInfo - fin.desktop.System.getAppAssetInfo({ alias: 'myAppAsset' }, info => { - console.log(info.alias, info.args, info.mandatory, info.src, info.target, info.version); - }, err => console.log(err)); - // getCommandLineArguments - fin.desktop.System.getCommandLineArguments(args => { - console.log("The command line arguments are " + args); - }); - //getCookieInfo - fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { - const cookie1 = cookies[0]; - console.log(cookie1.name, cookie1.domain, cookie1.path); - }, err => console.log(err)); - // getDeviceId - fin.desktop.System.getDeviceId(id => { - console.log("The id of the device is: " + id); - }); - // getDeviceUserId - fin.desktop.System.getDeviceUserId(id => console.log(id), err => console.error(err)); - // getEntityInfo - fin.desktop.System.getEntityInfo('uuid', 'name', info => { - console.log(info.entityType, info.name, info.uuid, info.parent.name, info.parent.uuid); - }, err => console.log(err)); - // getEnvironmentVariable - fin.desktop.System.getEnvironmentVariable("APPDATA", variable => { - console.log("this is the APPDATA value", variable); - }); - // getFocusedWindow - fin.desktop.System.getFocusedWindow(win => { - console.log(win.uuid, win.name); - }, err => console.log(err)); - // getHostSpecs - fin.desktop.System.getHostSpecs(info => { - console.log(info); - }, error => { - console.log('There was an error:', error); - }); - // getLog - fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', log => { - console.log(log); - }); - // getLogList - fin.desktop.System.getLogList(logList => { - logList.forEach(logInfo => { - console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); - }); - }); - //getMinLogLevel - fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); - // getMonitorInfo - fin.desktop.System.getMonitorInfo(monitorInfo => { - console.log("This object contains information about all monitors: ", monitorInfo); - }); - // getMousePosition - fin.desktop.System.getMousePosition(mousePosition => { - console.log(`The mouse is located at left: ${mousePosition.left}, top: ${mousePosition.top}`); - }); - // getProcessList - fin.desktop.System.getProcessList(list => { - list.forEach(process => { - console.log(`UUID: ${process.uuid}, Application Name: ${process.name}`); - }); - }); - // getProxySettings - fin.desktop.System.getProxySettings(proxy => { - console.log(proxy); - }); - // getRvmInfo - fin.desktop.System.getRvmInfo(rvmInfoObject => { - console.log("RVM version:", rvmInfoObject.version); - console.log("RVM has been running since:", rvmInfoObject["start-time"]); - }, err => { - console.log("Failed to get rvm info, error message:", err); - }); - // getVersion - fin.desktop.System.getVersion(version => { - console.log("The version is " + version); - }); - // launchExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - // Additionally note that the executable found in the zip file specified in appAssets - // will default to the one mentioned by appAssets.target - // If the the path below refers to a specific path it will override this default - alias: "myApp", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - alias: "myApp", - arguments: "e f g", - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // - fin.desktop.System.launchExternalProcess({ - path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", - arguments: "--version", - certificate: { - trusted: true, - subject: 'O=OpenFin INC., L=New York, S=NY, C=US', - thumbprint: '3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' - }, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log('Success:', payload.uuid); - }, error => { - console.log('Error:', error); - }); - // log - fin.desktop.System.log("info", "An example log message", () => { - console.log("message successfully logged"); - }, err => { - console.log(err); - }); - // monitorExternalProcess - fin.desktop.System.monitorExternalProcess({ - pid: 2508, - listener(result) { - console.log('the exit code', result.exitCode); - } - }, payload => { - console.log("The process is now being monitored: ", payload.uuid); - }, error => { - console.log("Error:", error); - }); - // openUrlWithBrowser - fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // readRegistryValue - fin.desktop.System.readRegistryValue('HKEY_SOMETHING', 'HARDWARE\\SOMETHING', 'BootSomething', info => { - console.log(info.data, info.rootKey, info.subkey, info.type, info.value); - }, err => console.log(err)); - // registerExternalConnection - fin.desktop.System.registerExternalConnection("remote-connection-uuid", (...args: any[]) => { - console.log(args); - }); - // releaseExternalProcess - fin.desktop.System.launchExternalProcess({ - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // release it. - fin.desktop.System.releaseExternalProcess(result.uuid, () => { - console.log("Process has been unmapped!"); - }, reason => { - console.log("failure: " + reason); - }); - }); - // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - //setMinLogLevel - fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), err => console.error(err)); - // showDeveloperTools - fin.desktop.System.showDeveloperTools("uuid", "name", () => { - console.log("successful"); - }, err => { - console.log("failure: " + err); - }); - // terminateExternalProcess - fin.desktop.System.launchExternalProcess({ - // notepad is in the system's PATH - path: "notepad", - arguments: "", - listener(result) { - console.log("The exit code", result.exitCode); - } - }, result => { - console.log("Result UUID is " + result.uuid); - - // Attempt to close the process. Terminate after 4 seconds if it - // has not done so. - fin.desktop.System.terminateExternalProcess(result.uuid, 4000, info => { - console.log("Termination result " + info.result); - }, reason => { - console.log("failure: " + reason); - }); - }); - // updateProxySettings - fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, () => { - console.log('success'); - }, err => { - console.log(err); - }); -} - -function test_system_clipboard() { - // availableFormats - fin.desktop.System.Clipboard.availableFormats(null, formats => { - formats.forEach(format => console.log(`The format ${format} is available to read`)); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readHtml - fin.desktop.System.Clipboard.readHtml(null, html => { - console.log(`This is the html from the clipboard: ${html}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readRtf - fin.desktop.System.Clipboard.readRtf(null, rtf => { - console.log(`This is the rtf from the clipboard: ${rtf}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // readText - fin.desktop.System.Clipboard.readText(null, text => { - console.log(`This is the text from the clipboard: ${text}`); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // write - fin.desktop.System.Clipboard.write({ - text: 'Hello Text!', - html: '

Hello Html

', - rtf: 'Hello Rtf' - }, null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeHtml - fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeRtf - fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); - // writeText - fin.desktop.System.Clipboard.writeText('Hello World', null, () => { - console.log('Success!!'); - }, (reason, err) => { - console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); - }); -} - -function test_window() { - let finWindow: fin.OpenFinWindow; - // constructor - finWindow = new fin.desktop.Window({ - name: "childWindow", - url: "child.html", - defaultWidth: 320, - defaultHeight: 320, - defaultTop: 10, - defaultLeft: 300, - frame: false, - resizable: false, - state: "normal" - }, () => { - const _win = finWindow.getNativeWindow(); - _win.addEventListener("DOMContentLoaded", () => { finWindow.show(); }); - }, error => { - console.log("Error creating window:", error); - }); - // getCurrent - finWindow = fin.desktop.Window.getCurrent(); - // getNativeWindow - let nativeWindow: Window; - nativeWindow = finWindow.getNativeWindow(); - // getParentApplication - let parentApp: fin.OpenFinApplication; - parentApp = finWindow.getParentApplication(); - // getParentWindow - let parentFinWindow: fin.OpenFinWindow; - parentFinWindow = finWindow.getParentWindow(); - // wrap - finWindow = fin.desktop.Window.wrap("uuid", "name"); - // addEventListener - finWindow.addEventListener("bounds-changed", event => { - console.log("The window has been moved or resized"); - }, () => { - console.log("The registration was successful"); - }, reason => { - console.log("failure:" + reason); - }); - // animate - finWindow.animate({ - opacity: { - opacity: 0.15, - duration: 1000 - }, - position: { - left: 10, - top: 10, - duration: 3000 - } - }, { - interrupt: false - }, evt => { - // Callback will only fire after both "opacity" and "position" have finished animating. - }); - // authenticate - finWindow.addEventListener('auth-requested', evt => { - finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { - console.log("failure:", err); - }); - }); - // blur - finWindow.blur(); - // bringToFront - finWindow.bringToFront(); - // close - finWindow.close(); - // disableFrame - finWindow.disableFrame(); - // enableFrame - finWindow.enableFrame(); - // flash - finWindow.flash(); - // focus - finWindow.focus(); - // getBounds - finWindow.getBounds(bounds => { - console.log(`top: ${bounds.top} left: ${bounds.left} height: ${bounds.height} width: ${bounds.width}`); - }); - // getOptions - finWindow.getOptions(options => { - console.log(options); - }); - // getSnapshot - finWindow.getSnapshot(base64Snapshot => { - console.log("data:image/png;base64," + base64Snapshot); - }); - // getState - finWindow.getState(state => { - console.log("state: " + state); - }); - // getZoomLevel - finWindow.getZoomLevel(level => { - console.log("zoom level: " + level); - }, error => { - console.log('error:', error); - }); - // hide - finWindow.hide(); - // isShowing - finWindow.isShowing(showing => { - console.log("the window is " + (showing ? "showing" : "hidden")); - }); - // joinGroup - let secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When mainWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow); - }); - // leaveGroup - secondWindow = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "secondWindow", - autoShow: true - }, () => { - // When finWindow moves or is moved, secondWindow moves by the same amount - secondWindow.joinGroup(finWindow, () => { - // once we are in the group, lets leave it. - secondWindow.leaveGroup(); - }); - }); - // maximize - finWindow.maximize(); - // mergeGroups - { - const finWindowOne = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowOne", - autoShow: true - }); - const finWindowTwo = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowTwo", - autoShow: true - }); - const finWindowThree = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowThree", - autoShow: true - }); - const finWindowFour = new fin.desktop.Window({ - url: "http://www.openfin.co", - name: "finWindowFour", - autoShow: true - }); - // When finWindowOne moves or is moved, finWindowTwo moves by the same amount - finWindowOne.joinGroup(finWindowTwo); - // When finWindowThree moves or is moved, finWindowFour moves by the same amount - finWindowThree.joinGroup(finWindowFour); - // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group - finWindowOne.mergeGroups(finWindowThree); - } - // minimize - finWindow.minimize(); - // moveBy - finWindow.moveBy(10, 10); - // moveTo - finWindow.moveTo(100, 200); - // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); - // resizeBy - finWindow.resizeBy(10, 10, "top-right"); - // resizeTo - finWindow.resizeTo(10, 10, "top-right"); - // restore - finWindow.restore(); - // setAsForeground - finWindow.setAsForeground(); - // setBounds - finWindow.setBounds(100, 200, 400, 400); - // setZoomLevel - finWindow.setZoomLevel(10); - // show - finWindow.show(); - // showAt - finWindow.showAt(10, 10, false); - // stopFlashing - finWindow.stopFlashing(); - // updateOptions - finWindow.updateOptions({ - frame: false, - maxWidth: 500 - }); -} - -function test_frame() { - //wrap - const frame = fin.desktop.Frame.wrap('uuid', 'name'); - //getCurrent - const currentFrame = fin.desktop.Frame.getCurrent(); - // addEventlistener - frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); - //removeEventListener - frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); - // getInfo - frame.getInfo(info => { - console.log(info.uuid, info.name, info.entityType, info.parent.uuid, info.parent.name); - }, err => console.error(err)); - // getParentWindow - frame.getParentWindow(parent => { - console.log(parent.uuid, parent.name, parent.entityType, parent.parent.uuid, parent.parent.name); - }, err => console.error(err)); -} diff --git a/types/openfin/v29/tslint.json b/types/openfin/v29/tslint.json deleted file mode 100644 index f93cf8562a..0000000000 --- a/types/openfin/v29/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "dtslint/dt.json" -} From 5e0d0d49a3573bc0aab9b245b30fe6c431f147c4 Mon Sep 17 00:00:00 2001 From: Firede Date: Mon, 26 Mar 2018 21:35:59 +0800 Subject: [PATCH 35/97] info.fieldName is readonly, see https://github.com/graphql/graphql-js/blob/v0.13.2/src/type/definition.js#L808 --- types/graphql-relay/graphql-relay-tests.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/graphql-relay/graphql-relay-tests.ts b/types/graphql-relay/graphql-relay-tests.ts index 6cc1f0f5ce..cebc90e2ca 100644 --- a/types/graphql-relay/graphql-relay-tests.ts +++ b/types/graphql-relay/graphql-relay-tests.ts @@ -44,7 +44,7 @@ backwardConnectionArgs.before = "b"; backwardConnectionArgs.last = 10; // connectionDefinitions returns a connectionType and its associated edgeType, given a node type. const resolve: GraphQLFieldResolver = (source, args, context, info) => { - info.fieldName = "f"; + context.flag = "f"; }; const fields: GraphQLFieldConfigMap = {}; let t: GraphQLObjectType; @@ -118,10 +118,10 @@ const resolver: GraphQLTypeResolver = () => { fields: {}, }); }; -const idFetcher = (id: string, context: number, info: GraphQLResolveInfo) => { - info.fieldName = "f"; +const idFetcher = (id: string, context: any, info: GraphQLResolveInfo) => { + context.flag = "f"; }; -const nodeDef = nodeDefinitions(idFetcher, resolver); +const nodeDef = nodeDefinitions(idFetcher, resolver); const nodeFieldConfig: GraphQLFieldConfig = nodeDef.nodeField; const nodesFieldConfig: GraphQLFieldConfig = nodeDef.nodesField; const interfaceType: GraphQLInterfaceType = nodeDef.nodeInterface; @@ -183,10 +183,10 @@ mutationWithClientMutationId({ inputFields: gifcm, mutateAndGetPayload: ( object: any, - ctx: any, + context: any, info: GraphQLResolveInfo) => { return new Promise((resolve) => { - resolve(info.fieldName); + resolve(context.flag); }); }, outputFields: gfcm, From d111b8e278658bc2772931bca46f345daea2e7e4 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 09:08:59 +0800 Subject: [PATCH 36/97] Update index.d.ts Not all events have the same args. --- types/datatables.net/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index 7941d0586f..f0d1b123fe 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -221,7 +221,7 @@ declare namespace DataTables { * @param event Event name to remove. * @param callback Specific callback function to remove if you want to unbind a single event listener. */ - off(event: string, callback?: ((e: Event, settings: Settings, json: any) => void)): Api; + off(event: string, callback?: ((e: Event, ...args: any[]) => void)): Api; /** * Table events listener. @@ -229,7 +229,7 @@ declare namespace DataTables { * @param event Event to listen for. * @param callback Specific callback function to remove if you want to unbind a single event listener. */ - on(event: string, callback: ((e: Event, settings: Settings, json: any) => void)): Api; + on(event: string, callback: ((e: Event, ...args: any[]) => void)): Api; /** * Listen for a table event once and then remove the listener. @@ -237,7 +237,7 @@ declare namespace DataTables { * @param event Event to listen for. * @param callback Specific callback function to remove if you want to unbind a single event listener. */ - one(event: string, callback: ((e: Event, settings: Settings, json: any) => void)): Api; + one(event: string, callback: ((e: Event, ...args: any[]) => void)): Api; /** * Page Methods / object From 934a9f1ba2f17bf20322feb0bfb5d70b49bd2851 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 09:12:08 +0800 Subject: [PATCH 37/97] Update index.d.ts Add api interface for select extension --- types/datatables.net-select/index.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index aa68f64969..c242027069 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -59,4 +59,26 @@ declare namespace DataTables { style(s: "api" | "single" | "multi" | "os"): Api; } } + + interface RowMethods { + /** + * Select a row + */ + select(): Api; + /** + * Deselect a row + */ + deselect: Api; + } + + interface RowsMethods { + /** + * Select multiple rows + */ + select(): Api; + /** + * Deselect a row + */ + deselect(): Api; + } } From d1cff7a8ff8a8dc30249d50163c8739fe696bd93 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 09:16:54 +0800 Subject: [PATCH 38/97] Update index.d.ts --- types/datatables.net-select/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index c242027069..a48cfe989b 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -68,7 +68,7 @@ declare namespace DataTables { /** * Deselect a row */ - deselect: Api; + deselect(): Api; } interface RowsMethods { From 357df72d924b2e3fdc76bb125c61b24eaeb682f2 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 11:12:01 +0800 Subject: [PATCH 39/97] Update index.d.ts Datatables api should be array-like, and accessable with index like array --- types/datatables.net/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index f0d1b123fe..6bbc2e1137 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -28,6 +28,10 @@ declare namespace DataTables { } interface Api extends CoreMethods { + /** + * API should be array-like + */ + [key: number]: any; /** * Returns DataTables API instance * From f0c93f3a89e7670953d927660c5d1f1d304df0f3 Mon Sep 17 00:00:00 2001 From: Andy Ma Date: Tue, 27 Mar 2018 17:59:11 +0800 Subject: [PATCH 40/97] Add typing for ColReorder extension --- .../datatables.net-colreorder-tests.ts | 12 ++++ types/datatables.net-colreorder/index.d.ts | 64 +++++++++++++++++++ types/datatables.net-colreorder/tsconfig.json | 24 +++++++ types/datatables.net-colreorder/tslint.json | 1 + 4 files changed, 101 insertions(+) create mode 100644 types/datatables.net-colreorder/datatables.net-colreorder-tests.ts create mode 100644 types/datatables.net-colreorder/index.d.ts create mode 100644 types/datatables.net-colreorder/tsconfig.json create mode 100644 types/datatables.net-colreorder/tslint.json diff --git a/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts new file mode 100644 index 0000000000..9b73f3f0e0 --- /dev/null +++ b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts @@ -0,0 +1,12 @@ +$(document).ready(() => { + const config: DataTables.Settings = { + // ColReorder extension options + colReorder: { + fixedColumnsLeft: 0, + fixedColumnsRight: 0, + order: [1,2,3], + realtime: true, + reorderCallback: ()=>{}, + } + }; +}); diff --git a/types/datatables.net-colreorder/index.d.ts b/types/datatables.net-colreorder/index.d.ts new file mode 100644 index 0000000000..80a9fa4e41 --- /dev/null +++ b/types/datatables.net-colreorder/index.d.ts @@ -0,0 +1,64 @@ +// Type definitions for datatables.net-colReorder 1.4 +// Project: https://datatables.net/extensions/colreorder/ +// Definitions by: Andy Ma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /* + * colReorder extension options + */ + colReorder?: boolean | ColReorderSettings; + } + + interface ColReorderSettings { + /* + * Number of columns (counting from the left) to disallow reordering of, '0' in default + */ + fixedColumnsLeft?: number; + + /* + * Number of columns (counting from the right) to disallow reordering of, '0' in default + */ + fixedColumnsRight?: number; + + /* + * Set a default order for the columns in the table + */ + order?: number[]; + + /* + * Enable / disable live reordering of columns during a drag, 'true' in default + */ + realtime?: boolean; + /* + * Callback after reorder + */ + reorderCallback: Function; + } + + interface Api { + colReorder: { + /* + * Programmatically reorder columns + */ + move(from: number, to: number, drop: boolean, invalidate: boolean): Api; + /* + * Get / set column order + */ + order(newOrder?: number[], originalIndexes?: boolean): Api; + /* + * Restore the loaded column order + */ + reset(): Api; + /* + * Convert one or more column indexes to and from current and original indexes + */ + transpose(idx?: number | number[], direction?: "toCurrent" | "toOriginal" | "fromOriginal" | "fromCurrent"): Api; + } + } +} \ No newline at end of file diff --git a/types/datatables.net-colreorder/tsconfig.json b/types/datatables.net-colreorder/tsconfig.json new file mode 100644 index 0000000000..97ef7b2fc0 --- /dev/null +++ b/types/datatables.net-colreorder/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datatables.net-colreorder-tests.ts" + ] +} \ No newline at end of file diff --git a/types/datatables.net-colreorder/tslint.json b/types/datatables.net-colreorder/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-colreorder/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a36ed3e3f1e9b078d734f367d36cd7d83d0eaa26 Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 21:35:01 +0800 Subject: [PATCH 41/97] Update index.d.ts Add new line at the end of file --- types/datatables.net-colreorder/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/datatables.net-colreorder/index.d.ts b/types/datatables.net-colreorder/index.d.ts index 80a9fa4e41..3aad7a3050 100644 --- a/types/datatables.net-colreorder/index.d.ts +++ b/types/datatables.net-colreorder/index.d.ts @@ -61,4 +61,4 @@ declare namespace DataTables { transpose(idx?: number | number[], direction?: "toCurrent" | "toOriginal" | "fromOriginal" | "fromCurrent"): Api; } } -} \ No newline at end of file +} From f15c95af975405503bc17137a3c7ad78e701da0c Mon Sep 17 00:00:00 2001 From: Andyma <66229754@qq.com> Date: Tue, 27 Mar 2018 21:35:30 +0800 Subject: [PATCH 42/97] Update tsconfig.json Add new line at the end of file --- types/datatables.net-colreorder/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/datatables.net-colreorder/tsconfig.json b/types/datatables.net-colreorder/tsconfig.json index 97ef7b2fc0..ec5e47bb49 100644 --- a/types/datatables.net-colreorder/tsconfig.json +++ b/types/datatables.net-colreorder/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "datatables.net-colreorder-tests.ts" ] -} \ No newline at end of file +} From 5a64d54d733c4ae65806980bd0d36c68aadc260f Mon Sep 17 00:00:00 2001 From: ikokostya Date: Tue, 27 Mar 2018 17:54:26 +0300 Subject: [PATCH 43/97] @types/node: Add url.domainToASCII, url.domainToUnicode --- types/node/index.d.ts | 3 +++ types/node/node-tests.ts | 5 +++++ types/node/v7/index.d.ts | 3 +++ types/node/v7/node-tests.ts | 5 +++++ types/node/v8/index.d.ts | 3 +++ types/node/v8/node-tests.ts | 5 +++++ 6 files changed, 24 insertions(+) diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 0994982b41..2e31fff6e6 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -2361,6 +2361,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; diff --git a/types/node/node-tests.ts b/types/node/node-tests.ts index 08dbb68b8a..89d87578d9 100644 --- a/types/node/node-tests.ts +++ b/types/node/node-tests.ts @@ -635,6 +635,11 @@ namespace url_tests { } } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 748f932d80..62e30f0f09 100644 --- a/types/node/v7/index.d.ts +++ b/types/node/v7/index.d.ts @@ -2024,6 +2024,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; diff --git a/types/node/v7/node-tests.ts b/types/node/v7/node-tests.ts index eb25e01f10..cc46b1f8e4 100644 --- a/types/node/v7/node-tests.ts +++ b/types/node/v7/node-tests.ts @@ -475,6 +475,11 @@ namespace url_tests { assert.equal(helloUrl.query.hello, 'world'); } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index 1697093de7..fd1f5cafae 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -2350,6 +2350,9 @@ declare module "url" { export function format(urlObject: UrlObject | string): string; export function resolve(from: string, to: string): string; + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + export interface URLFormatOptions { auth?: boolean; fragment?: boolean; diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index b63d494fbd..58c1319261 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -609,6 +609,11 @@ namespace url_tests { } } + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + { let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); assert.equal(myURL.hash, '#bar'); From fbe95c0b1a1d99de3309fbc4e49c752113ee94d0 Mon Sep 17 00:00:00 2001 From: Erik Moldtmann Date: Tue, 27 Mar 2018 17:24:14 +0200 Subject: [PATCH 44/97] allow JS strings and string arrays where Git.Strarray is required, because nodegit can automatically convert it to Git.Strarray --- types/nodegit/checkout-options.d.ts | 2 +- types/nodegit/diff-options.d.ts | 2 +- types/nodegit/fetch-options.d.ts | 2 +- types/nodegit/index_.d.ts | 6 +++--- types/nodegit/path-spec.d.ts | 2 +- types/nodegit/push-options.d.ts | 2 +- types/nodegit/remote.d.ts | 2 +- types/nodegit/reset.d.ts | 2 +- types/nodegit/status-options.d.ts | 2 +- types/nodegit/tag.d.ts | 2 +- types/nodegit/transport.d.ts | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/types/nodegit/checkout-options.d.ts b/types/nodegit/checkout-options.d.ts index d711ae7ba9..6971f59f3a 100644 --- a/types/nodegit/checkout-options.d.ts +++ b/types/nodegit/checkout-options.d.ts @@ -14,7 +14,7 @@ export class CheckoutOptions { notifyPayload?: undefined; progressCb?: any; progressPayload?: undefined; - paths?: Strarray; + paths?: Strarray | string | string[]; baseline?: Tree; baselineIndex?: Index; targetDirectory?: string; diff --git a/types/nodegit/diff-options.d.ts b/types/nodegit/diff-options.d.ts index 408a0530e1..3925f5c70c 100644 --- a/types/nodegit/diff-options.d.ts +++ b/types/nodegit/diff-options.d.ts @@ -4,7 +4,7 @@ export interface DiffOptions { version?: number; flags?: number; ignoreSubmodules?: number; - pathspec?: Strarray; + pathspec?: Strarray | string | string[]; notifyCb?: Function; contextLines?: number; interhunkLines?: number; diff --git a/types/nodegit/fetch-options.d.ts b/types/nodegit/fetch-options.d.ts index 77b5a9586c..6907db6bca 100644 --- a/types/nodegit/fetch-options.d.ts +++ b/types/nodegit/fetch-options.d.ts @@ -7,7 +7,7 @@ export interface FetchOptions { prune?: number; updateFetchhead?: number; downloadTags?: number; - customHeaders?: Strarray; + customHeaders?: Strarray | string | string[]; proxyOpts?: any; [key: string]: any; } diff --git a/types/nodegit/index_.d.ts b/types/nodegit/index_.d.ts index 3bf55c229d..aeea3c9b5a 100644 --- a/types/nodegit/index_.d.ts +++ b/types/nodegit/index_.d.ts @@ -26,7 +26,7 @@ export class Index { static open(indexPath: string): Promise; add(sourceEntry: IndexEntry): number; - addAll(pathspec: Strarray, flags: number, callback?: Function): Promise; + addAll(pathspec: Strarray | string | string[], flags: number, callback?: Function): Promise; addByPath(path: string): Promise; caps(): number; checksum(): Oid; @@ -44,11 +44,11 @@ export class Index { read(force: number): number; readTree(tree: Tree): number; remove(path: string, stage: number): number; - removeAll(pathspec: Strarray, callback?: Function): Promise; + removeAll(pathspec: Strarray | string | string[], callback?: Function): Promise; removeByPath(path: string): Promise; removeDirectory(dir: string, stage: number): number; setCaps(caps: number): number; - updateAll(pathspec: Strarray, callback?: Function): Promise; + updateAll(pathspec: Strarray | string | string[], callback?: Function): Promise; write(): number; writeTree(): Promise; writeTreeTo(repo: Repository): Promise; diff --git a/types/nodegit/path-spec.d.ts b/types/nodegit/path-spec.d.ts index 99435d5e0d..31b58f0149 100644 --- a/types/nodegit/path-spec.d.ts +++ b/types/nodegit/path-spec.d.ts @@ -23,7 +23,7 @@ export class Pathspec { static matchListEntrycount(m: any): number; static matchListFailedEntry(m: any, pos: number): string; static matchListFailedEntrycount(m: any): number; - static create(pathspec: Strarray): Pathspec; + static create(pathspec: Strarray | string | string[]): Pathspec; free(): void; matchDiff(diff: Diff, flags: number): Promise; diff --git a/types/nodegit/push-options.d.ts b/types/nodegit/push-options.d.ts index b736325f91..5f7625db2e 100644 --- a/types/nodegit/push-options.d.ts +++ b/types/nodegit/push-options.d.ts @@ -6,7 +6,7 @@ export interface PushOptions { version?: number; pbParallelism?: number; callbacks?: RemoteCallbacks; - customHeaders?: Strarray; + customHeaders?: Strarray | string | string[]; proxyOpts?: ProxyOptions; [key: string]: any; } diff --git a/types/nodegit/remote.d.ts b/types/nodegit/remote.d.ts index 61fdc63d1c..8a77f4ea69 100644 --- a/types/nodegit/remote.d.ts +++ b/types/nodegit/remote.d.ts @@ -62,7 +62,7 @@ export class Remote { stop(): void; updateTips(callbacks: RemoteCallbacks, updateFetchhead: number, downloadTags: number, reflogMessage: string): number; - upload(refspecs: Strarray, opts?: PushOptions): number; + upload(refspecs: Strarray | string | string[], opts?: PushOptions): number; url(): string; /** * Lists advertised references from a remote. You must connect to the remote before using referenceList. diff --git a/types/nodegit/reset.d.ts b/types/nodegit/reset.d.ts index 800ad34434..9051fa693b 100644 --- a/types/nodegit/reset.d.ts +++ b/types/nodegit/reset.d.ts @@ -20,7 +20,7 @@ export class Reset { /** * Look up a refs's commit. */ - static default(repo: Repository, target: Object, pathspecs: Strarray): Promise; + static default(repo: Repository, target: Object, pathspecs: Strarray | string | string[]): Promise; /** * Sets the current head to the specified commit oid and optionally resets the index and working tree to match. * This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages. diff --git a/types/nodegit/status-options.d.ts b/types/nodegit/status-options.d.ts index 363dcd1fbb..f0189706bd 100644 --- a/types/nodegit/status-options.d.ts +++ b/types/nodegit/status-options.d.ts @@ -4,6 +4,6 @@ export interface StatusOptions { version?: number; show?: number; flags?: number; - pathspec?: Strarray; + pathspec?: Strarray | string | string[]; [key: string]: any; } diff --git a/types/nodegit/tag.d.ts b/types/nodegit/tag.d.ts index 3f6b5aa836..08d25859d2 100644 --- a/types/nodegit/tag.d.ts +++ b/types/nodegit/tag.d.ts @@ -10,7 +10,7 @@ export class Tag { static createLightweight(repo: Repository, tagName: string, target: Object, force: number): Promise; static delete(repo: Repository, tagName: string): Promise; static list(repo: Repository): Promise; - static listMatch(tagNames: Strarray, pattern: string, repo: Repository): number; + static listMatch(tagNames: Strarray | string | string[], pattern: string, repo: Repository): number; /** * Retrieves the tag pointed to by the oid * diff --git a/types/nodegit/transport.d.ts b/types/nodegit/transport.d.ts index 4cdd39f400..f4f4721333 100644 --- a/types/nodegit/transport.d.ts +++ b/types/nodegit/transport.d.ts @@ -9,7 +9,7 @@ export namespace Transport { } export class Transport { - static sshWithPaths(owner: Remote, payload: Strarray): Promise; + static sshWithPaths(owner: Remote, payload: Strarray | string | string[]): Promise; static unregister(prefix: string): number; init(version: number): number; smartCertificateCheck(cert: Cert, valid: number, hostName: string): number; From 6eb449c46ddc7499c8394ba443265eb1bfeb4061 Mon Sep 17 00:00:00 2001 From: krauseStefan Date: Tue, 27 Mar 2018 23:23:55 +0200 Subject: [PATCH 45/97] Added uiGridConstants.scrollbars.WHEN_NEEDED The option is documented here: http://ui-grid.info/docs/#!/api/ui.grid.service:uiGridConstants#properties_scrollbars --- types/ui-grid/index.d.ts | 7 ++++--- types/ui-grid/ui-grid-tests.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/types/ui-grid/index.d.ts b/types/ui-grid/index.d.ts index 748dda3bf9..683c906087 100644 --- a/types/ui-grid/index.d.ts +++ b/types/ui-grid/index.d.ts @@ -127,6 +127,7 @@ declare namespace uiGrid { scrollbars: { NEVER: number; ALWAYS: number; + WHEN_NEEDED: number; }; } export type IGridInstance = IGridInstanceOf; @@ -627,7 +628,7 @@ declare namespace uiGrid { enableGridMenu?: boolean; /** * uiGridConstants.scrollbars.ALWAYS by default. This settings controls the horizontal scrollbar for the grid. - * Supported values: uiGridConstants.scrollbars.ALWAYS, uiGridConstants.scrollbars.NEVER + * Supported values: uiGridConstants.scrollbars.ALWAYS, uiGridConstants.scrollbars.NEVER, uiGridConstants.scrollbars.WHEN_NEEDED * @default 1 */ enableHorizontalScrollbar?: boolean | number; @@ -660,7 +661,7 @@ declare namespace uiGrid { enableSorting?: boolean; /** * uiGridConstants.scrollbars.ALWAYS by default. This settings controls the vertical scrollbar for the grid. - * Supported values: uiGridConstants.scrollbars.ALWAYS, uiGridConstants.scrollbars.NEVER + * Supported values: uiGridConstants.scrollbars.ALWAYS, uiGridConstants.scrollbars.NEVER, uiGridConstants.scrollbars.WHEN_NEEDED * @default 1 */ enableVerticalScrollbar?: boolean | number; @@ -897,7 +898,7 @@ declare namespace uiGrid { * which is provided when you want to remove an item. The id should be unique. */ - addToGridMenu(grid: IGridInstanceOf, items: Array): void; + addToGridMenu(grid: IGridInstanceOf, items: Array): void; /** * Clears all filters and optionally refreshes the visible rows. * @param {boolean} [refreshRows=true] Defaults to true. diff --git a/types/ui-grid/ui-grid-tests.ts b/types/ui-grid/ui-grid-tests.ts index e1d49a481d..1e424985fb 100644 --- a/types/ui-grid/ui-grid-tests.ts +++ b/types/ui-grid/ui-grid-tests.ts @@ -98,7 +98,7 @@ columnDef.sort = { priority: 1 }; columnDef.sortCellFiltered = false; -columnDef.sortDirectionCycle = [null, 'asc' , 'desc']; +columnDef.sortDirectionCycle = [null, 'asc', 'desc']; columnDef.sortingAlgorithm = (a: any, b: any, rowA: uiGrid.IGridRowOf, rowB: uiGrid.IGridRowOf, direction: string) => { return -1; }; @@ -113,6 +113,7 @@ var gridApi: uiGrid.IGridApiOf; var gridInstance: uiGrid.IGridInstanceOf; var menuItem: uiGrid.IMenuItem; var colProcessor: uiGrid.IColumnProcessor; +var uiGridConstants: uiGrid.IUiGridConstants; gridApi.core.clearAllFilters(true); gridApi.core.addToGridMenu(gridInstance, [menuItem]); @@ -131,6 +132,12 @@ var gridOptions: uiGrid.IGridOptionsOf = { } }; gridOptions.isRowSelectable = () => true; +gridOptions.enableVerticalScrollbar = uiGridConstants.scrollbars.ALWAYS; +gridOptions.enableVerticalScrollbar = uiGridConstants.scrollbars.WHEN_NEEDED; +gridOptions.enableVerticalScrollbar = uiGridConstants.scrollbars.NEVER; +gridOptions.enableHorizontalScrollbar = uiGridConstants.scrollbars.ALWAYS; +gridOptions.enableHorizontalScrollbar = uiGridConstants.scrollbars.WHEN_NEEDED; +gridOptions.enableHorizontalScrollbar = uiGridConstants.scrollbars.NEVER; interface IAnotherEntity { anObject: string From 1539c6a98b9a343b8c2bcf003c0f06da16fd019f Mon Sep 17 00:00:00 2001 From: Andy Ma Date: Wed, 28 Mar 2018 09:43:46 +0800 Subject: [PATCH 46/97] Fix build errors. --- .../datatables.net-colreorder-tests.ts | 4 ++-- types/datatables.net-colreorder/index.d.ts | 4 ++-- types/datatables.net-select/index.d.ts | 14 +++++++------- types/datatables.net/datatables.net-tests.ts | 2 +- types/datatables.net/index.d.ts | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts index 9b73f3f0e0..a6126baf44 100644 --- a/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts +++ b/types/datatables.net-colreorder/datatables.net-colreorder-tests.ts @@ -4,9 +4,9 @@ $(document).ready(() => { colReorder: { fixedColumnsLeft: 0, fixedColumnsRight: 0, - order: [1,2,3], + order: [1, 2, 3], realtime: true, - reorderCallback: ()=>{}, + reorderCallback: () => {}, } }; }); diff --git a/types/datatables.net-colreorder/index.d.ts b/types/datatables.net-colreorder/index.d.ts index 3aad7a3050..8254cd71dc 100644 --- a/types/datatables.net-colreorder/index.d.ts +++ b/types/datatables.net-colreorder/index.d.ts @@ -38,7 +38,7 @@ declare namespace DataTables { /* * Callback after reorder */ - reorderCallback: Function; + reorderCallback: () => void; } interface Api { @@ -59,6 +59,6 @@ declare namespace DataTables { * Convert one or more column indexes to and from current and original indexes */ transpose(idx?: number | number[], direction?: "toCurrent" | "toOriginal" | "fromOriginal" | "fromCurrent"): Api; - } + }; } } diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index a48cfe989b..563a51fc25 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -46,7 +46,7 @@ declare namespace DataTables { */ style?: "api" | "single" | "multi" | "os" | "multi+shift"; } - + interface Api { select: { /* @@ -57,17 +57,17 @@ declare namespace DataTables { * Set the table's selection style */ style(s: "api" | "single" | "multi" | "os"): Api; - } + }; } - + interface RowMethods { /** * Select a row */ select(): Api; /** - * Deselect a row - */ + * Deselect a row + */ deselect(): Api; } @@ -77,8 +77,8 @@ declare namespace DataTables { */ select(): Api; /** - * Deselect a row - */ + * Deselect a row + */ deselect(): Api; } } diff --git a/types/datatables.net/datatables.net-tests.ts b/types/datatables.net/datatables.net-tests.ts index e5cb5184fd..0c9f3db3cc 100644 --- a/types/datatables.net/datatables.net-tests.ts +++ b/types/datatables.net/datatables.net-tests.ts @@ -225,7 +225,7 @@ let config: DataTables.Settings = { ], // Data ajax: "url", - data: {}, + data: [], // Features autoWidth: true, deferRender: true, diff --git a/types/datatables.net/index.d.ts b/types/datatables.net/index.d.ts index 6bbc2e1137..c0a37145ab 100644 --- a/types/datatables.net/index.d.ts +++ b/types/datatables.net/index.d.ts @@ -1301,7 +1301,7 @@ declare namespace DataTables { /** * Data to use as the display data for the table. Since: 1.10 */ - data?: Object[]; + data?: any[]; //#endregion "Data" From be1c86fffe1cf5e375f939795b9288f57d28c872 Mon Sep 17 00:00:00 2001 From: ckboyjiy Date: Wed, 28 Mar 2018 11:08:51 +0900 Subject: [PATCH 47/97] Modified submodules --- types/navermaps/index.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/types/navermaps/index.d.ts b/types/navermaps/index.d.ts index 92409a44b0..aa36578e63 100644 --- a/types/navermaps/index.d.ts +++ b/types/navermaps/index.d.ts @@ -1082,6 +1082,7 @@ declare namespace naver.maps { } // Sub module: drawing + function drawing(): void; namespace drawing { interface DrawingOptions { map?: Map; @@ -1149,6 +1150,7 @@ declare namespace naver.maps { } // Sub module: visualization + function visualization(): void; namespace visualization { interface DotMapOptions { map: Map; @@ -1218,6 +1220,7 @@ declare namespace naver.maps { } // Sub module: geocoder + function Service(): void; namespace Service { interface ServiceOptions { encoding?: any; @@ -1274,6 +1277,7 @@ declare namespace naver.maps { callback?: (status: Status, response: ReverseGeocodeResponse) => void): void; } + function TransCoord(): void; namespace TransCoord { function fromEPSG3857ToLatLng(coord: Point): LatLng; function fromEPSG3857ToNaver(coord: Point): Point; @@ -1297,6 +1301,7 @@ declare namespace naver.maps { function fromUTMKToTM128(utmk: Point): Point; } + function Event(): void; namespace Event { function addDOMListener(element: HTMLElement, eventName: string, listener: () => any): void; function addListener(target: any, eventName: string, listener: () => any): MapEventListener; @@ -1314,6 +1319,7 @@ declare namespace naver.maps { } // Projection + function EPSG3857(): void; namespace EPSG3857 { // implements Projection function fromCoordToPoint(coord: Coord): Point; function fromLatLngToPoint(latlng: LatLng): Point; @@ -1322,6 +1328,8 @@ declare namespace naver.maps { function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; function getDistance(latlng1: LatLng, latlng2: LatLng): number; } + + function UTMK(): void; namespace UTMK { let name: string; let pointPerMeter: number; @@ -1338,6 +1346,8 @@ declare namespace naver.maps { function getDestinationCoord(fromLatLng: LatLng, angle: number, meter: number): LatLng; function getDistance(latlng1: LatLng, latlng2: LatLng): number; } + + function UTMK_NAVER(): void; namespace UTMK_NAVER { // extends UTMK let name: string; let pointPerMeter: number; @@ -1350,6 +1360,8 @@ declare namespace naver.maps { function fromPointToNaver(point: Point): Point; function fromUTMKToNaver(utmk: Point): Point; } + + function EPSG3857Coord(): void; namespace EPSG3857Coord { function fromCoordToLatLng(coord: Point): LatLng; function fromCoordToPoint(coord: Point): Point; @@ -1360,10 +1372,14 @@ declare namespace naver.maps { function fromPointToCoord(point: Point): Point; function fromPointToEPSG3857(point: Point): Point; } + + function TM128(): void; namespace TM128 { // extends TM128Coord function fromCoordToPoint(latlng: Coord): Point; function fromPointToCoord(point: Point): LatLng; } + + function TM128Coord(): void; namespace TM128Coord { // extends UTMK function fromCoordToLatLng(tm128: Point): LatLng; function fromCoordToPoint(tm128: Point): Point; @@ -1376,12 +1392,16 @@ declare namespace naver.maps { function fromTM128ToUTMK(tm128: Point): Point; function fromUTMKToTM128(utmk: Point): Point; } + + function UTMK_NAVERCoord(): void; namespace UTMK_NAVERCoord { // extends UTMK_NAVER function fromCoordToLatLng(n: Point): LatLng; function fromCoordToPoint(n: Point): Point; function fromLatLngToCoord(latlng: Coord): Point; function fromPointToCoord(point: Point): Point; } + + function UTMKCoord(): void; namespace UTMKCoord { // extends UTMK function fromCoordToLatLng(utmk: Point): LatLng; function fromCoordToPoint(utmk: Point): Point; From 353076277e69d0b2f98fdcd2e3d0738b46b32aed Mon Sep 17 00:00:00 2001 From: Andy Ma Date: Wed, 28 Mar 2018 11:01:17 +0800 Subject: [PATCH 48/97] Add types for AutoFill extension --- .../datatables.net-autofill-tests.ts | 7 +++++ types/datatables.net-autofill/index.d.ts | 30 +++++++++++++++++++ types/datatables.net-autofill/tsconfig.json | 23 ++++++++++++++ types/datatables.net-autofill/tslint.json | 1 + 4 files changed, 61 insertions(+) create mode 100644 types/datatables.net-autofill/datatables.net-autofill-tests.ts create mode 100644 types/datatables.net-autofill/index.d.ts create mode 100644 types/datatables.net-autofill/tsconfig.json create mode 100644 types/datatables.net-autofill/tslint.json diff --git a/types/datatables.net-autofill/datatables.net-autofill-tests.ts b/types/datatables.net-autofill/datatables.net-autofill-tests.ts new file mode 100644 index 0000000000..50c178c6c5 --- /dev/null +++ b/types/datatables.net-autofill/datatables.net-autofill-tests.ts @@ -0,0 +1,7 @@ +const config: DataTables.Settings = { + // AutoFill extension options + autoFill: { + alwaysAsk: true, + enable: true + } +}; diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts new file mode 100644 index 0000000000..e037c8dc47 --- /dev/null +++ b/types/datatables.net-autofill/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for datatables.net-autofill 2.2 +// Project: https://datatables.net +// Definitions by: Andy Ma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// +/// + +declare namespace DataTables { + interface Settings { + /* + * autoFill extension options + */ + autoFill?: boolean | AutoFillSettings; + } + + interface AutoFillSettings { + /* + * Always ask the end user if an action should be taken or not + */ + alwaysAsk?: boolean; + + /* + * + * Initial enablement state of AutoFill + */ + enable?: boolean; + } +} diff --git a/types/datatables.net-autofill/tsconfig.json b/types/datatables.net-autofill/tsconfig.json new file mode 100644 index 0000000000..e17d5de5da --- /dev/null +++ b/types/datatables.net-autofill/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datatables.net-autofill-tests.ts" + ] +} diff --git a/types/datatables.net-autofill/tslint.json b/types/datatables.net-autofill/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/datatables.net-autofill/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d1b4a4aa93ca5ddfe329bfd146613945e1ff5b10 Mon Sep 17 00:00:00 2001 From: andy-maca <66229754@qq.com> Date: Wed, 28 Mar 2018 11:09:31 +0800 Subject: [PATCH 49/97] Add new property --- .../datatables.net-autofill/datatables.net-autofill-tests.ts | 3 ++- types/datatables.net-autofill/index.d.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/datatables.net-autofill/datatables.net-autofill-tests.ts b/types/datatables.net-autofill/datatables.net-autofill-tests.ts index 50c178c6c5..0ad00b4395 100644 --- a/types/datatables.net-autofill/datatables.net-autofill-tests.ts +++ b/types/datatables.net-autofill/datatables.net-autofill-tests.ts @@ -2,6 +2,7 @@ const config: DataTables.Settings = { // AutoFill extension options autoFill: { alwaysAsk: true, - enable: true + enable: true, + columns: [1, 2] } }; diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts index e037c8dc47..2d7eb0d856 100644 --- a/types/datatables.net-autofill/index.d.ts +++ b/types/datatables.net-autofill/index.d.ts @@ -20,7 +20,10 @@ declare namespace DataTables { * Always ask the end user if an action should be taken or not */ alwaysAsk?: boolean; - + /* + * Always ask the end user if an action should be taken or not + */ + columns: string | number[]; /* * * Initial enablement state of AutoFill From 4794a91ac5a35d67616d2a2426a8d3429c3ad5f4 Mon Sep 17 00:00:00 2001 From: andy-maca <66229754@qq.com> Date: Wed, 28 Mar 2018 11:28:11 +0800 Subject: [PATCH 50/97] Add property 'editor' --- types/datatables.net-autofill/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts index 2d7eb0d856..68075be5ca 100644 --- a/types/datatables.net-autofill/index.d.ts +++ b/types/datatables.net-autofill/index.d.ts @@ -21,9 +21,13 @@ declare namespace DataTables { */ alwaysAsk?: boolean; /* - * Always ask the end user if an action should be taken or not + * Select the columns that can be auto filled */ columns: string | number[]; + /* + * Attach an Editor instance for database updating + */ + editor: Object; /* * * Initial enablement state of AutoFill From 6ed5c800004cd6a5275056e137dcbb13a683edee Mon Sep 17 00:00:00 2001 From: Ke Zhang Date: Tue, 27 Mar 2018 21:06:48 -0700 Subject: [PATCH 51/97] Add proper type for AccessToken.token. --- types/simple-oauth2/index.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index 499f39e56e..c1eb324348 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -44,8 +44,12 @@ export interface ModuleOptions { export type TokenType = "access_token" | "refresh_token"; +export interface Token { + [x: string]: any; +} + export interface AccessToken { - token: {}; + token: Token; /** Check if the access token is expired or not */ expired(): boolean; @@ -56,9 +60,6 @@ export interface AccessToken { revoke(tokenType: TokenType, callback?: (error: any) => void): Bluebird; } -export interface Token { - [x: string]: any; -} export type AuthorizationCode = string; export interface AuthorizationTokenConfig { code: AuthorizationCode; From 454e0ecd2826835f90963ccc24168fb15fe35eff Mon Sep 17 00:00:00 2001 From: Ke Zhang Date: Tue, 27 Mar 2018 21:29:18 -0700 Subject: [PATCH 52/97] Update package version of @type/simple-oauth2 --- types/simple-oauth2/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/simple-oauth2/index.d.ts b/types/simple-oauth2/index.d.ts index c1eb324348..b93bbc229f 100644 --- a/types/simple-oauth2/index.d.ts +++ b/types/simple-oauth2/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for simple-oauth2 1.0 +// Type definitions for simple-oauth2 1.1 // Project: https://github.com/lelylan/simple-oauth2 // Definitions by: [Michael Müller] // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 8988aee224efd4df06a9a70b543e6938a68f4302 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 14:39:26 +0800 Subject: [PATCH 53/97] Reformat all files using prettier. prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 \ --write --print-width 120 \ types/express-graphql/*.ts related: #24552 --- .../express-graphql/express-graphql-tests.ts | 22 +++++++++---------- types/express-graphql/index.d.ts | 8 +++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index 1557c4c0ac..958be4f5ff 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -1,7 +1,7 @@ -import express = require('express'); -import 'express-session'; -import graphqlHTTP = require('express-graphql'); -import { GraphQLSchema } from 'graphql/type/schema'; +import express = require("express"); +import "express-session"; +import graphqlHTTP = require("express-graphql"); +import { GraphQLSchema } from "graphql/type/schema"; const app = express(); const schema: GraphQLSchema = { @@ -20,10 +20,10 @@ const graphqlOption: graphqlHTTP.OptionsData = { graphiql: true, schema, formatError: (error: Error) => ({ - message: error.message + message: error.message, }), validationRules: [() => false, () => true], - extensions: ({ document, variables, operationName, result }) => ({ key: "value", key2: "value"}), + extensions: ({ document, variables, operationName, result }) => ({ key: "value", key2: "value" }), }; const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsData => ({ @@ -38,15 +38,15 @@ const graphqlOptionRequestAsync = async (request: express.Request): Promise { }, + extensions: async args => {}, validationRules: [() => false, () => true], }; }; -app.use('/graphql1', graphqlHTTP(graphqlOption)); +app.use("/graphql1", graphqlHTTP(graphqlOption)); -app.use('/graphql2', graphqlHTTP(graphqlOptionRequest)); +app.use("/graphql2", graphqlHTTP(graphqlOptionRequest)); -app.use('/graphqlasync', graphqlHTTP(graphqlOptionRequestAsync)); +app.use("/graphqlasync", graphqlHTTP(graphqlOptionRequestAsync)); -app.listen(8080, () => console.log('GraphQL Server running on localhost:8080')); +app.listen(8080, () => console.log("GraphQL Server running on localhost:8080")); diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index 4b2d10c99b..b00259e158 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -9,7 +9,7 @@ // TypeScript Version: 2.3 import { Request, Response } from "express"; -import { DocumentNode, GraphQLSchema, GraphQLError } from 'graphql'; +import { DocumentNode, GraphQLSchema, GraphQLError } from "graphql"; export = graphqlHTTP; declare namespace graphqlHTTP { @@ -17,9 +17,9 @@ declare namespace graphqlHTTP { * Used to configure the graphQLHTTP middleware by providing a schema * and other configuration options. */ - export type Options = ((request: Request, - response: Response, - params?: GraphQLParams) => OptionsResult) | OptionsResult; + export type Options = + | ((request: Request, response: Response, params?: GraphQLParams) => OptionsResult) + | OptionsResult; export type OptionsResult = OptionsData | Promise; export interface OptionsData { /** From 08716e9683a4c86ad8ea0bd9143d8387337156a7 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 28 Mar 2018 08:47:59 +0200 Subject: [PATCH 54/97] Replace forEach with for...of in tests --- types/activex-wia/activex-wia-tests.ts | 39 ++++++++++++++------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts index c33385af14..8fc7dcfd2e 100644 --- a/types/activex-wia/activex-wia-tests.ts +++ b/types/activex-wia/activex-wia-tests.ts @@ -11,6 +11,9 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { return results; }; +WScript.Echo('Hello, world'); +WScript.Quit(); + // source -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms630826(v=vs.85).aspx { const cd = new ActiveXObject('WIA.CommonDialog'); @@ -51,7 +54,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Properties).forEach(p => { + for (const p of collectionToArray(dev.Properties)) { let s = `${p.Name} (${p.PropertyID}) = `; if (p.IsVector) { s += '[vector of data]'; @@ -84,7 +87,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { } WScript.Echo(s); - }); + } } } @@ -112,7 +115,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { { const img = cd.ShowAcquireImage(); if (img) { - collectionToArray(img.Properties).forEach(p => { + for (const p of collectionToArray(img.Properties)) { let contents = ''; if (p.IsVector) { contents = '[vector data not emitted]'; @@ -124,7 +127,7 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { contents = p.Value; } WScript.Echo(`${p.Name} (${p.PropertyID}) = ${contents}`); - }); + } } } @@ -133,12 +136,12 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => { const dev = cd.ShowSelectDevice(); if (dev) { const actionEvent = WIA.WiaEventFlag.ActionEvent; - collectionToArray(dev.Events).forEach(e => { + for (const e of collectionToArray(dev.Events)) { const msg = (e.Type & actionEvent) === actionEvent ? `${e.Name} is an Action event` : `${e.Name} is not an Action event`; WScript.Echo(msg); - }); + } } } @@ -208,14 +211,14 @@ Frame count = ${img.FrameCount}} // Create an imageprocess object and enumerate filters { const ip = new ActiveXObject('WIA.ImageProcess'); - collectionToArray(ip.FilterInfos).forEach(fi => { + for (const fi of collectionToArray(ip.FilterInfos)) { const s = [ fi.Name, new Array(51).join('='), fi.Description ].join('\n'); WScript.Echo(s); - }); + } } // Create an imageprocess object and create one of each available filter @@ -269,11 +272,11 @@ Frame count = ${img.FrameCount}} WScript.Echo(s); }; - collectionToArray(ip.FilterInfos).forEach(fi => { + for (const fi of collectionToArray(ip.FilterInfos)) { ip.Filters.Add(fi.FilterID); listProperties(ip.Filters(1)); ip.Filters.Remove(1); - }); + } } // List the supported transfer formats @@ -308,14 +311,14 @@ Frame count = ${img.FrameCount}} { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Items).forEach(item => { + for (const item of collectionToArray(dev.Items)) { let s: string = item.Properties("Item Name").Value; if (item.Properties.Exists("Item Time Stamp")) { const v: WIA.Vector = item.Properties("Item Time Stamp").Value; if (v.Count === 8) { s += ` (${v.Date})`; } } WScript.Echo(s); - }); + } } } @@ -340,16 +343,16 @@ Frame count = ${img.FrameCount}} } // List all available devices by name and deviceid - collectionToArray(dm.DeviceInfos).forEach(di => { + for (const di of collectionToArray(dm.DeviceInfos)) { const name: string = di.Properties("Name").Value; WScript.Echo(`${name} (${di.DeviceID})`); - }); + } // Display all the properties for the selected device { const dev = cd.ShowSelectDevice(); if (dev) { - collectionToArray(dev.Properties).forEach(p => { + for (const p of collectionToArray(dev.Properties)) { const name = `${p.Name} (${p.PropertyID})`; let contents: string; if (p.IsVector) { @@ -360,7 +363,7 @@ Frame count = ${img.FrameCount}} contents = p.Value; } WScript.Echo(`${name} = ${contents}`); - }); + } } } @@ -430,7 +433,7 @@ Frame count = ${img.FrameCount}} if (args[0] === 'connect') { const deviceID = args[1].substr(12); const device = dm.DeviceInfos(deviceID).Connect(); - collectionToArray(device.Items).forEach(item => { + for (const item of collectionToArray(device.Items)) { const img = item.Transfer(); img.SaveFile(`C:\\${item.Properties('Item Name').Value}.${img.FileExtension}`); @@ -445,7 +448,7 @@ Frame count = ${img.FrameCount}} WScript.Echo(error); } } - }); + } WScript.Quit(); } break; From 73c777a74a44cb85e5be44e19d0afde8a94c44d8 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 14:49:05 +0800 Subject: [PATCH 55/97] Fixed the definition of some optional fields. `express-graphql` version: 0.6.12 --- types/express-graphql/index.d.ts | 34 ++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index b00259e158..78c988204f 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -5,6 +5,7 @@ // Daniel Fader // Ehsan Ziya // Margus Lamp +// Firede // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -14,8 +15,11 @@ export = graphqlHTTP; declare namespace graphqlHTTP { /** - * Used to configure the graphQLHTTP middleware by providing a schema + * Used to configure the graphqlHTTP middleware by providing a schema * and other configuration options. + * + * Options can be provided as an Object, a Promise for an Object, or a Function + * that returns an Object or a Promise for an Object. */ export type Options = | ((request: Request, response: Response, params?: GraphQLParams) => OptionsResult) @@ -40,20 +44,20 @@ declare namespace graphqlHTTP { /** * A boolean to configure whether the output should be pretty-printed. */ - pretty?: boolean; + pretty?: boolean | null; /** * An optional function which will be used to format any errors produced by * fulfilling a GraphQL operation. If no function is provided, GraphQL's * default spec-compliant `formatError` function will be used. */ - formatError?: (error: GraphQLError) => any; + formatError?: ((error: GraphQLError) => any) | null; /** * An optional array of validation rules that will be applied on the document * in additional to those defined by the GraphQL spec. */ - validationRules?: any[]; + validationRules?: any[] | null; /** * An optional function for adding additional metadata to the GraphQL response @@ -65,12 +69,12 @@ declare namespace graphqlHTTP { * * This function may be async. */ - extensions?: (info: RequestInfo) => { [key: string]: any }; + extensions?: ((info: RequestInfo) => { [key: string]: any }) | null; /** * A boolean to optionally enable GraphiQL mode. */ - graphiql?: boolean; + graphiql?: boolean | null; } /** @@ -80,32 +84,32 @@ declare namespace graphqlHTTP { /** * The parsed GraphQL document. */ - document?: DocumentNode; + document: DocumentNode | null | undefined; /** * The variable values used at runtime. */ - variables?: { [name: string]: any }; + variables: { [name: string]: any } | null | undefined; /** * The (optional) operation name requested. */ - operationName?: string; + operationName: string | null | undefined; /** * The result of executing the operation. */ - result?: any; + result: any; } export interface GraphQLParams { - query?: string; - variables?: { [name: string]: any }; - operationName?: string; - raw?: boolean; + query: string | null | undefined; + variables: { [name: string]: any } | null | undefined; + operationName: string | null | undefined; + raw: boolean | null | undefined; } - type Middleware = (request: Request, response: Response) => void; + type Middleware = (request: Request, response: Response) => Promise; } /** From 3e6f8de9dc2724547d1e938787051a4d000ff8c7 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 28 Mar 2018 09:04:28 +0200 Subject: [PATCH 56/97] Use ReadonlyArray --- types/activex-wia/activex-wia-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts index 8fc7dcfd2e..1effbe99ee 100644 --- a/types/activex-wia/activex-wia-tests.ts +++ b/types/activex-wia/activex-wia-tests.ts @@ -1,6 +1,6 @@ // Note -- running these tests under cscript requires some ES5 polyfills -const collectionToArray = (col: { Item(key: any): T }): T[] => { +const collectionToArray = (col: { Item(key: any): T }): ReadonlyArray => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); From f7255883d0126c51a61a1bc874bf5de4b437c396 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 28 Mar 2018 09:05:30 +0200 Subject: [PATCH 57/97] Undo ReadonlyArray --- types/activex-wia/activex-wia-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts index 1effbe99ee..8fc7dcfd2e 100644 --- a/types/activex-wia/activex-wia-tests.ts +++ b/types/activex-wia/activex-wia-tests.ts @@ -1,6 +1,6 @@ // Note -- running these tests under cscript requires some ES5 polyfills -const collectionToArray = (col: { Item(key: any): T }): ReadonlyArray => { +const collectionToArray = (col: { Item(key: any): T }): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); From ac6eb13e40e93553c1d9743924a5aa408d548cf0 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 15:25:04 +0800 Subject: [PATCH 58/97] Defining `schema` the right way. Otherwise, it will cause the new version `@types/graphql` test to fail. Related: #24566 --- types/express-graphql/express-graphql-tests.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index 958be4f5ff..52071cea07 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -1,20 +1,10 @@ import express = require("express"); import "express-session"; import graphqlHTTP = require("express-graphql"); -import { GraphQLSchema } from "graphql/type/schema"; +import { buildSchema } from "graphql"; const app = express(); -const schema: GraphQLSchema = { - getQueryType: null, - getMutationType: null, - getSubscriptionType: null, - getTypeMap: null, - getType: null, - getPossibleTypes: null, - isPossibleType: null, - getDirective: null, - getDirectives: null, -}; +const schema = buildSchema(`type Query { hello: String }`); const graphqlOption: graphqlHTTP.OptionsData = { graphiql: true, From cd800800a9ef8c060ac209ae6b88604fc1d5d6f2 Mon Sep 17 00:00:00 2001 From: Firede Date: Wed, 28 Mar 2018 16:05:34 +0800 Subject: [PATCH 59/97] Rewrite tests. `GraphQLResolveInfo` is usually generated internally by graphql. --- .../graphql-list-fields-tests.ts | 62 ++++++++----------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/types/graphql-list-fields/graphql-list-fields-tests.ts b/types/graphql-list-fields/graphql-list-fields-tests.ts index ee9bcc6851..e90d609f1d 100644 --- a/types/graphql-list-fields/graphql-list-fields-tests.ts +++ b/types/graphql-list-fields/graphql-list-fields-tests.ts @@ -1,41 +1,31 @@ import getFieldNames = require("graphql-list-fields"); -import { - GraphQLID, - GraphQLObjectType, - GraphQLResolveInfo, - GraphQLSchema, - GraphQLString -} from "graphql"; +import { GraphQLID, GraphQLObjectType, GraphQLSchema, GraphQLString } from "graphql"; -const sampleGraphQLResolveInfo: GraphQLResolveInfo = { - fieldName: "", - fieldNodes: [], - returnType: GraphQLString, - parentType: new GraphQLObjectType({ - name: "Sample", +const schema = new GraphQLSchema({ + query: new GraphQLObjectType({ + name: "SampleType", fields: { - name: { type: GraphQLString } - } + scalarField: { + type: GraphQLString, + resolve(source, args, context, info) { + const fieldNames: string[] = getFieldNames(info); + }, + }, + someType: { + type: new GraphQLObjectType({ + name: "SomeType", + fields: { + a: { type: GraphQLID }, + b: { type: GraphQLString }, + c: { type: GraphQLString }, + d: { type: GraphQLString }, + }, + }), + resolve(source, args, context, info) { + const fieldNames: string[] = getFieldNames(info); + }, + }, + }, }), - path: undefined, - schema: new GraphQLSchema({ - query: new GraphQLObjectType({ - name: "SampleType", - fields: {} - }) - }), - fragments: {}, - rootValue: null, - operation: { - kind: "OperationDefinition", - operation: "query", - selectionSet: { - kind: "SelectionSet", - selections: [] - } - }, - variableValues: {} -}; - -const fieldNames: string[] = getFieldNames(sampleGraphQLResolveInfo); +}); From 026dc969c2cf6077a21271d37cc3c912fa43be89 Mon Sep 17 00:00:00 2001 From: Mykolas Kairys Date: Wed, 28 Mar 2018 11:24:08 +0300 Subject: [PATCH 60/97] updated react-router-redux createMatchSelector definition to not have generic --- types/react-router-redux/index.d.ts | 2 +- types/react-router-redux/tslint.json | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/types/react-router-redux/index.d.ts b/types/react-router-redux/index.d.ts index 89ef136014..7c8d78ccc9 100644 --- a/types/react-router-redux/index.d.ts +++ b/types/react-router-redux/index.d.ts @@ -80,4 +80,4 @@ export interface LocationChangeAction { export function routerMiddleware(history: History): Middleware; -export function createMatchSelector(path: string): (state: State) => match | null; +export function createMatchSelector(path: string): (state: { router: RouterState }) => match<{}> | null; diff --git a/types/react-router-redux/tslint.json b/types/react-router-redux/tslint.json index 71ee04c4e1..f93cf8562a 100644 --- a/types/react-router-redux/tslint.json +++ b/types/react-router-redux/tslint.json @@ -1,6 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "no-unnecessary-generics": false - } + "extends": "dtslint/dt.json" } From cd12005ec0bd6bd4fb06aeb69b9b58aa1db259f7 Mon Sep 17 00:00:00 2001 From: Juan Jimenez-Anca Date: Wed, 28 Mar 2018 10:14:40 +0100 Subject: [PATCH 61/97] add Uint8Array for browsers --- types/ethereumjs-util/index.d.ts | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/types/ethereumjs-util/index.d.ts b/types/ethereumjs-util/index.d.ts index 7a29b38ff5..eb47d3a6a9 100644 --- a/types/ethereumjs-util/index.d.ts +++ b/types/ethereumjs-util/index.d.ts @@ -20,64 +20,64 @@ export function addHexPrefix(str: string): string; export function arrayContainsArray(superset: any, subset: any, some: any): any; -export function baToJSON(ba: Buffer | string[]): Buffer | string[]; +export function baToJSON(ba: Buffer | Uint8Array | string[]): Buffer | Uint8Array | string[]; -export function bufferToHex(buf: Buffer): string; +export function bufferToHex(buf: Buffer | Uint8Array): string; -export function bufferToInt(buf: Buffer): string; +export function bufferToInt(buf: Buffer | Uint8Array): string; export function defineProperties(self: {[k: string]: any}, fields: string[], data: {[k: string]: any}): {[k: string]: any}; -export function ecrecover(msgHash: Buffer, v: number, r: Buffer, s: Buffer): Buffer; +export function ecrecover(msgHash: Buffer | Uint8Array, v: number, r: Buffer | Uint8Array, s: Buffer | Uint8Array): Buffer | Uint8Array; -export function ecsign(msgHash: Buffer, privateKey: Buffer): {[k: string]: any}; +export function ecsign(msgHash: Buffer | Uint8Array, privateKey: Buffer | Uint8Array): {[k: string]: any}; export function fromRpcSig(sig: string): {[k: string]: any}; -export function fromSigned(num: Buffer): any; +export function fromSigned(num: Buffer | Uint8Array): any; -export function generateAddress(from: Buffer, nonce: Buffer): Buffer; +export function generateAddress(from: Buffer | Uint8Array, nonce: Buffer | Uint8Array): Buffer | Uint8Array; -export function hashPersonalMessage(message: string): Buffer; +export function hashPersonalMessage(message: string): Buffer | Uint8Array; -export function importPublic(publicKey: Buffer): Buffer; +export function importPublic(publicKey: Buffer | Uint8Array): Buffer | Uint8Array; export function isValidAddress(address: string): boolean; -export function isValidChecksumAddress(address: Buffer): boolean; +export function isValidChecksumAddress(address: Buffer | Uint8Array): boolean; -export function isValidPrivate(privateKey: Buffer): boolean; +export function isValidPrivate(privateKey: Buffer | Uint8Array): boolean; -export function isValidPublic(publicKey: Buffer, sanitize?: boolean): any; +export function isValidPublic(publicKey: Buffer | Uint8Array, sanitize?: boolean): any; -export function isValidSignature(v: Buffer, r: Buffer, s: Buffer, homestead?: boolean): boolean; +export function isValidSignature(v: Buffer | Uint8Array, r: Buffer | Uint8Array, s: Buffer | Uint8Array, homestead?: boolean): boolean; -export function privateToAddress(privateKey: Buffer): Buffer; +export function privateToAddress(privateKey: Buffer | Uint8Array): Buffer | Uint8Array; -export function privateToPublic(privateKey: Buffer): Buffer; +export function privateToPublic(privateKey: Buffer | Uint8Array): Buffer | Uint8Array; -export function pubToAddress(pubKey: Buffer, sanitize: boolean): Buffer; +export function pubToAddress(pubKey: Buffer | Uint8Array, sanitize: boolean): Buffer | Uint8Array; -export function ripemd160(a: Buffer | any[] | string | number, padded: boolean): Buffer; +export function ripemd160(a: Buffer | Uint8Array | any[] | string | number, padded: boolean): Buffer | Uint8Array; -export function rlphash(a: Buffer | any[] | string | number): Buffer; +export function rlphash(a: Buffer | Uint8Array | any[] | string | number): Buffer | Uint8Array; -export function setLengthLeft(msg: Buffer | any[], length: number, right?: boolean): Buffer | any[]; +export function setLengthLeft(msg: Buffer | Uint8Array | any[], length: number, right?: boolean): Buffer | Uint8Array | any[]; -export function setLengthRight(msg: Buffer | any[], length: number): Buffer | any[]; +export function setLengthRight(msg: Buffer | Uint8Array | any[], length: number): Buffer | Uint8Array | any[]; -export function sha256(a: Buffer | any[] | string | number): Buffer; +export function sha256(a: Buffer | Uint8Array | any[] | string | number): Buffer | Uint8Array; -export function sha3(a: Buffer | any[] | string | number, bits?: number): Buffer; +export function sha3(a: Buffer | Uint8Array | any[] | string | number, bits?: number): Buffer | Uint8Array; -export function toBuffer(v: any): Buffer; +export function toBuffer(v: any): Buffer | Uint8Array; export function toChecksumAddress(address: string): string; -export function toRpcSig(v: number, r: Buffer, s: Buffer): string; +export function toRpcSig(v: number, r: Buffer | Uint8Array, s: Buffer | Uint8Array): string; -export function toUnsigned(num: any): Buffer; +export function toUnsigned(num: any): Buffer | Uint8Array; -export function unpad(a: T): T; +export function unpad(a: T): T; -export function zeros(bytes: number): Buffer; +export function zeros(bytes: number): Buffer | Uint8Array; From 7addf7ae18cfc3f62fe74dd3a8a813606eb05029 Mon Sep 17 00:00:00 2001 From: Timur Amirov Date: Wed, 28 Mar 2018 13:14:26 +0200 Subject: [PATCH 62/97] Update typing for circuit-breaker-js --- types/circuit-breaker-js/circuit-breaker-js-tests.ts | 8 ++++++++ types/circuit-breaker-js/index.d.ts | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/types/circuit-breaker-js/circuit-breaker-js-tests.ts b/types/circuit-breaker-js/circuit-breaker-js-tests.ts index 1436e13e90..b9a3c70a63 100644 --- a/types/circuit-breaker-js/circuit-breaker-js-tests.ts +++ b/types/circuit-breaker-js/circuit-breaker-js-tests.ts @@ -10,3 +10,11 @@ status = CircuitBreaker.OPEN; breaker.forceOpen(); breaker.forceClose(); + +breaker.run((success, failure) => { + if (Math.random() > 0.5) { + success(); + } else { + failure(); + } +}); diff --git a/types/circuit-breaker-js/index.d.ts b/types/circuit-breaker-js/index.d.ts index 6fc58bd40d..7b6854e61f 100644 --- a/types/circuit-breaker-js/index.d.ts +++ b/types/circuit-breaker-js/index.d.ts @@ -30,7 +30,13 @@ declare class CircuitBreaker { static CLOSED: 2; constructor(options?: CircuitBreaker.Options); - run(command: () => void, fallback?: () => void): void; + run( + command: ( + success: () => void, + failure: () => void, + ) => void, + fallback?: () => void + ): void; forceClose(): void; forceOpen(): void; unforce(): void; From 19341e612be15bc974a94371d51f4b3e312e675c Mon Sep 17 00:00:00 2001 From: Andrija Dvorski Date: Wed, 28 Mar 2018 15:00:03 +0200 Subject: [PATCH 63/97] Added types for command-line-usage package --- .../command-line-usage-tests.ts | 24 ++++++++++ types/command-line-usage/index.d.ts | 48 +++++++++++++++++++ types/command-line-usage/tsconfig.json | 23 +++++++++ types/command-line-usage/tslint.json | 1 + 4 files changed, 96 insertions(+) create mode 100644 types/command-line-usage/command-line-usage-tests.ts create mode 100644 types/command-line-usage/index.d.ts create mode 100644 types/command-line-usage/tsconfig.json create mode 100644 types/command-line-usage/tslint.json diff --git a/types/command-line-usage/command-line-usage-tests.ts b/types/command-line-usage/command-line-usage-tests.ts new file mode 100644 index 0000000000..c4dd127cea --- /dev/null +++ b/types/command-line-usage/command-line-usage-tests.ts @@ -0,0 +1,24 @@ +import * as commandLineUsage from "command-line-usage"; + +const sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Options', + optionList: [ + { + name: 'input', + typeLabel: '{underline file}', + description: 'The input to process.' + }, + { + name: 'help', + description: 'Print this usage guide.' + } + ] + } +]; + +const usage = commandLineUsage(sections); diff --git a/types/command-line-usage/index.d.ts b/types/command-line-usage/index.d.ts new file mode 100644 index 0000000000..ac4f1d7606 --- /dev/null +++ b/types/command-line-usage/index.d.ts @@ -0,0 +1,48 @@ +// Type definitions for command-line-usage 5.0 +// Project: https://github.com/75lb/command-line-usage#readme +// Definitions by: Andrija Dvorski +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +declare namespace commandLineUsage { + interface Section { + list: string[]; + + add(content: object): void; + emptyLine(): void; + header(text: string): void; + toString(): string; + } + + interface SectionData { + optionList?: OptionListData[]; + hide?: string[]; + group?: string[]; + header?: string; + reverseNameOrder?: boolean; + tableOptions?: any; + } + + interface OptionListData extends SectionData { + name: string; + typeLabel?: string; + description?: string; + } + + interface ContentSectionData extends SectionData { + content: string; + raw?: boolean; + } + + type CommandLineUsageInput = + SectionData + | SectionData[] + | OptionListData + | OptionListData[] + | ContentSectionData + | ContentSectionData[]; +} + +declare function commandLineUsage(sections: commandLineUsage.CommandLineUsageInput): string | undefined | commandLineUsage.Section; + +export = commandLineUsage; diff --git a/types/command-line-usage/tsconfig.json b/types/command-line-usage/tsconfig.json new file mode 100644 index 0000000000..9deee9ab63 --- /dev/null +++ b/types/command-line-usage/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "command-line-usage-tests.ts" + ] +} diff --git a/types/command-line-usage/tslint.json b/types/command-line-usage/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/command-line-usage/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 6623a7ee2549759ee82486e6f15159ed94bdcd00 Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Wed, 28 Mar 2018 15:16:59 +0200 Subject: [PATCH 64/97] feat(types): add typings for bell --- types/bell/bell-tests.ts | 110 ++++++++++++++++ types/bell/index.d.ts | 273 +++++++++++++++++++++++++++++++++++++++ types/bell/tsconfig.json | 23 ++++ types/bell/tslint.json | 6 + 4 files changed, 412 insertions(+) create mode 100644 types/bell/bell-tests.ts create mode 100644 types/bell/index.d.ts create mode 100644 types/bell/tsconfig.json create mode 100644 types/bell/tslint.json diff --git a/types/bell/bell-tests.ts b/types/bell/bell-tests.ts new file mode 100644 index 0000000000..f8821f22ad --- /dev/null +++ b/types/bell/bell-tests.ts @@ -0,0 +1,110 @@ +import { RequestQuery, Server } from 'hapi'; +import * as bell from 'bell'; + +async function run() { + const server = new Server({ port: 8000 }); + await server.register(bell); + + // You'll need to go to https://developers.arcgis.com/en/applications and set up an application to get started + // Once you create your app you will get your ClientID and Client Secret. + // Also be sure to set redirect URL as well at the bottom of the screen in Redirect URIs section. + + server.auth.strategy('arcgisonline', 'bell', { + provider: 'twitter', + password: 'some cookie password', + location: 'http://example.com/oauth', + clientId: '', + clientSecret: '', + scope(request) { + const scopes = ['public_profile', 'email']; + if (( request.query).wantsSharePermission) { + scopes.push('publish_actions'); + } + return scopes; + } + }); + + const providers: bell.BellOptions[] = [{ + provider: 'discord', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: () => '', + }, + { + provider: 'facebook', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: server.info.uri + }, + { + provider: 'google', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + location: server.info.uri + }, + { + provider: 'linkedin', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + providerParams: { + redirect_uri: server.info.uri + '/bell/door' + } + }, + { + provider: 'meetup', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + scope: ['basic', 'ageless', 'group_edit', 'reporting'], + }, + { + provider: 'nest', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '' + }, + { + provider: 'office365', + clientId: '', + clientSecret: '', + password: 'cookie_encryption_password_secure', + providerParams: { + response_type: 'code' + }, + scope: ['openid', 'offline_access', 'profile'] + }, + { + provider: 'okta', + config: { uri: 'https://your-organization.okta.com' }, + password: 'cookie_encryption_password_secure', + isSecure: false, + location: 'http://127.0.0.1:8000', + clientId: '', + clientSecret: '' + }, + { + provider: 'slack', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '' + }, + { + provider: 'twitch', + password: 'cookie_encryption_password_secure', + isSecure: false, + clientId: '', + clientSecret: '', + scope: ['user_read', 'channel_read'] + }]; +} diff --git a/types/bell/index.d.ts b/types/bell/index.d.ts new file mode 100644 index 0000000000..2af331b2b9 --- /dev/null +++ b/types/bell/index.d.ts @@ -0,0 +1,273 @@ +// Type definitions for bell 9.1 +// Project: https://github.com/hapijs/bell +// Definitions by: Simon Schick +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import { Server, Request, Plugin, AuthCredentials } from 'hapi'; + +declare module 'hapi' { + interface ServerAuth { + strategy(name: string, scheme: 'bell', options: BellOptions): void; + strategy( + name: string, + scheme: 'bell', + mode: boolean | 'required' | 'optional' | 'try', + options: BellOptions, + ): void; + } +} + +export interface StringLikeMap { + [key: string]: string | number; +} +export type Provider = + 'arcgisonline' | + 'auth0' | + 'azuread' | + 'bitbucket' | + 'digitalocean' | + 'discord' | + 'dropbox' | + 'dropboxV2' | + 'facebook' | + 'fitbit' | + 'foursquare' | + 'github' | + 'gitlab' | + 'google' | + 'googleplus' | + 'instagram' | + 'linkedin' | + 'live' | + 'medium' | + 'meetup' | + 'mixer' | + 'nest' | + 'office365' | + 'okta' | + 'phabricator' | + 'pingfed' | + 'pinterest' | + 'reddit' | + 'salesforce' | + 'slack' | + 'spotify' | + 'stripe' | + 'trakt' | + 'tumblr' | + 'twitch' | + 'twitter' | + 'vk' | + 'wordpress' | + 'yahoo'; + +export type RequestPassThrough = ( + request: Request, + next: (err: Error | null, credentials: AuthCredentials) => void, +) => void; + +export interface OptionalOptions { + /** + * the name of the cookie used to manage the temporary state. + * Defaults to 'bell-provider' where 'provider' is the provider name (or 'custom' for custom providers). + * For example, the Twitter cookie name defaults to 'bell-twitter'. + */ + cookie?: string; + /** + * sets the cookie secure flag. + * Defaults to true. + */ + isSecure?: boolean; + /** + * sets the cookie HTTP only flag. + * Defaults to true. + */ + isHttpOnly?: boolean; + /** + * cookie time-to-live in milliseconds. + * Defaults to null (session time-life - cookies are deleted when the browser is closed). + */ + ttl?: number; + /** + * the domain scope. + * Defaults to null (no domain). + */ + domain?: string; + /** + * provider-specific query parameters for the authentication endpoint. + * It may be passed either as an object to merge into the query string, + * or a function which takes the client's request and returns an object. + * Each provider supports its own set of parameters which customize the user's login experience. + * For example: + * * Facebook supports `display` ('page', 'popup', or 'touch'), `auth_type`, `auth_nonce`. + * * Google supports `access_type`, `approval_prompt`, `prompt`, `login_hint`, `user_id`, `hd`. + * * Twitter supports `force_login`, `screen_name`. + * * Linkedin supports `fields`. + */ + providerParams?: StringLikeMap | ((request: Request) => StringLikeMap); + /** + * allows passing query parameters from a bell protected endpoint to the auth request. + * It will merge the query params you pass along with the providerParams and any other predefined ones. + * Be aware that this will override predefined query parameters! + * Default to false. + */ + allowRuntimeProviderParams?: StringLikeMap | boolean; + /** + * Each built-in vendor comes with the required scope for basic profile information. + * Use scope to specify a different scope as required by your application. + * It may be passed either as an object to merge into the query string, + * or a function which takes the client's request and returns an object. + * Consult the provider for their specific supported scopes. + */ + scope?: string[] | ((request: Request) => string[]); + /** + * skips obtaining a user profile from the provider. + * Useful if you need specific scopes, + * but not the user profile. + * Defaults to false. + */ + skipProfile?: boolean; + /** + * a configuration object used to customize the provider settings. + * The built-in 'twitter' provider accepts the `extendedProfile` & `getMethod` options. + * option which allows disabling the extra profile request when the provider + * returns the user information in the callback (defaults to true). + * The built-in 'github' and 'phabricator' providers accept the uri + * option which allows pointing to a private enterprise installation (e.g. 'https://vpn.example.com'). + * See Providers documentation for more information. + */ + config?: { extendedProfile?: boolean; getMethod?: string } | { uri?: string }; + /** + * an object of key-value pairs that specify additional + * URL query parameters to send with the profile request to the provider. + * The built-in facebook provider, + * for example, could have fields specified to determine the fields returned from the user's graph, + * which would then be available to you in the auth.credentials.profile.raw object. + */ + profileParams?: StringLikeMap; + /** + * allows passing additional OAuth state from initial request. + * This must be a function returning a string, + * which will be appended to the bell internal state parameter for OAuth code flow. + */ + runtimeStateCallback?(req: Request): string; + + // THESE ARE IN THE *REQUIRED* section but are actually not... + /** + * A boolean indicating whether or not you want the redirect_uri to be forced to https. + * Useful if your hapi application runs as http, but is accessed through https. + */ + forceHttps?: boolean; + /** + * Set the base redirect_uri manually if it cannot be inferred properly from server settings. + * Useful to override port, protocol, and host if proxied or forwarded. + */ + location?: string | ((req: Request) => string); +} + +export interface RequiredProviderOptions { + /** + * the cookie encryption password. + * Used to encrypt the temporary state cookie used by the module in + * between the authorization protocol steps. + */ + password: string; + /** + * the OAuth client identifier (consumer key). + */ + clientId: string; + /** + * the OAuth client secret (consumer secret) + */ + clientSecret: string; +} + +export interface KnownProviderOptions extends RequiredProviderOptions, OptionalOptions { + provider: Provider; +} + +/** + * @param uri the requested resource URI (bell will add the token or authentication header as needed). + * @param params any URI query parameters (cannot include them in the URI due to signature requirements). + */ +export type AuthedRequest = (uri: string, params: { [key: string]: string } | null) => Promise; + +export interface CustomProtocol { + /** + * the authorization protocol used. + */ + protocol: 'oauth' | 'oauth2'; + /** + * the OAuth signature method (OAuth 1.0a only). Must be one of: + * * 'HMAC-SHA1' - default + * * 'RSA-SHA1' - in that case, the clientSecret is your RSA private key + */ + signatureMethod?: 'HMAC-SHA1' | 'RSA-SHA1'; + /** + * the temporary credentials (request token) endpoint (OAuth 1.0a only). + */ + temporary?: string; + /** + * boolean that determines if OAuth client id and client secret will be sent + * as parameters as opposed to an Authorization header (OAuth 2.0 only). + * Defaults to false. + */ + useParamsAuth?: boolean; + /** + * the authorization endpoint URI. + */ + auth: string; + /** + * the access token endpoint URI. + */ + token: string; + /** + * the OAuth version. + */ + version?: string; + /** + * an array of scope strings (OAuth 2.0 only). + */ + scope?: string[] | ((query: StringLikeMap) => string[]); + /** + * the scope separator character (OAuth 2.0 only). Only required when a provider has a broken OAuth 2.0 implementation. Defaults to space (Facebook and GitHub default to comma). + */ + scopeSeparator?: string; + /** + * a headers object with additional headers required by the provider + * (e.g. GitHub required the 'User-Agent' header which is set by default). + */ + headers?: { + [key: string]: string; + }; + /** + * a function used to obtain user profile information and normalize it. + * @param credentials the credentials object. + * Change the object directly within the function (profile information is typically stored under credentials.profile). + * @param params the parsed information received from the provider (e.g. token, secret, and other custom fields). + * @param get an OAuth helper function to make authenticated requests using the credentials received. + */ + profile(credentials: any, params: { [key: string]: string }, get: AuthedRequest): Promise; +} + +export interface CustomProviderOptions extends RequiredProviderOptions, OptionalOptions { + provider: CustomProtocol; +} + +export type BellOptions = CustomProviderOptions | KnownProviderOptions; + +export const plugin: Plugin; +/* + * [See docs](https://github.com/hapijs/bell/blob/master/API.md#simulated-authentication) + */ + +/** + * Enables simulation mode. + */ +export function simulate(credentialsFunc: RequestPassThrough): void; +/** + * [See docs](https://github.com/hapijs/bell/blob/master/API.md#simulated-authentication) + * Disables simulation mode + */ +export function simulate(state: false): void; diff --git a/types/bell/tsconfig.json b/types/bell/tsconfig.json new file mode 100644 index 0000000000..4db30822b8 --- /dev/null +++ b/types/bell/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "strictFunctionTypes": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bell-tests.ts" + ] +} diff --git a/types/bell/tslint.json b/types/bell/tslint.json new file mode 100644 index 0000000000..843d627f89 --- /dev/null +++ b/types/bell/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "unified-signatures": false // Disabling as it prevents me from using overloaded doctags + } +} From c1fa2b114c40bcc7c84b0209cd18709694897950 Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Wed, 28 Mar 2018 15:28:45 +0200 Subject: [PATCH 65/97] fixup! feat(types): add typings for bell --- types/bell/bell-tests.ts | 4 ---- types/bell/index.d.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/types/bell/bell-tests.ts b/types/bell/bell-tests.ts index f8821f22ad..65b3e5f4d5 100644 --- a/types/bell/bell-tests.ts +++ b/types/bell/bell-tests.ts @@ -5,10 +5,6 @@ async function run() { const server = new Server({ port: 8000 }); await server.register(bell); - // You'll need to go to https://developers.arcgis.com/en/applications and set up an application to get started - // Once you create your app you will get your ClientID and Client Secret. - // Also be sure to set redirect URL as well at the bottom of the screen in Redirect URIs section. - server.auth.strategy('arcgisonline', 'bell', { provider: 'twitter', password: 'some cookie password', diff --git a/types/bell/index.d.ts b/types/bell/index.d.ts index 2af331b2b9..14cdc65cb9 100644 --- a/types/bell/index.d.ts +++ b/types/bell/index.d.ts @@ -258,10 +258,6 @@ export interface CustomProviderOptions extends RequiredProviderOptions, Optional export type BellOptions = CustomProviderOptions | KnownProviderOptions; export const plugin: Plugin; -/* - * [See docs](https://github.com/hapijs/bell/blob/master/API.md#simulated-authentication) - */ - /** * Enables simulation mode. */ From d87aadbf306bb63f210d4e33c99d11bab45f567b Mon Sep 17 00:00:00 2001 From: Christian Rackerseder Date: Wed, 28 Mar 2018 15:37:13 +0200 Subject: [PATCH 66/97] Added types for enquire.js --- types/enquire.js/enquire.js-tests.ts | 17 +++++++++++ types/enquire.js/index.d.ts | 43 ++++++++++++++++++++++++++++ types/enquire.js/tsconfig.json | 23 +++++++++++++++ types/enquire.js/tslint.json | 1 + 4 files changed, 84 insertions(+) create mode 100644 types/enquire.js/enquire.js-tests.ts create mode 100644 types/enquire.js/index.d.ts create mode 100644 types/enquire.js/tsconfig.json create mode 100644 types/enquire.js/tslint.json diff --git a/types/enquire.js/enquire.js-tests.ts b/types/enquire.js/enquire.js-tests.ts new file mode 100644 index 0000000000..7fce0dd571 --- /dev/null +++ b/types/enquire.js/enquire.js-tests.ts @@ -0,0 +1,17 @@ +import * as enquire from 'enquire.js'; + +enquire + .register('(min-width: 300px) and (max-width: 600px)', { + deferSetup: true, + match: () => {}, + unmatch: () => {}, + setup: () => {}, + destroy: () => {} + }) + .register('(min-width: 300px) and (max-width: 600px)', {}); + +enquire.register('(min-width: 300px) and (max-width: 600px)', [{}, {}], true); + +enquire.register('(min-width: 300px) and (max-width: 600px)', () => {}, true); + +enquire.unregister('(min-width: 300px) and (max-width: 600px)'); diff --git a/types/enquire.js/index.d.ts b/types/enquire.js/index.d.ts new file mode 100644 index 0000000000..d7dcafdc30 --- /dev/null +++ b/types/enquire.js/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for enquire.js 2.1 +// Project: https://github.com/WickyNilliams/enquire.js/ +// Definitions by: Christian Rackerseder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +interface Options { + /** + * If set to true, defers execution of the setup function until the first time the media query is matched + */ + deferSetup?: boolean; + /** + * If supplied, triggered when a media query matches. + */ + match?(): void; + /** + * If supplied, triggered when the media query transitions from a matched state to an unmatched state. + */ + unmatch?(): void; + /** + * If supplied, triggered once, when the handler is registered. + */ + setup?(): void; + + /** + * If supplied, triggered when handler is unregistered. Place cleanup code here + */ + destroy?(): void; +} + +type Callback = () => void; + +interface EnquireJs { + register( + mediaQuery: string, + options: Options | Options[] | Callback, + shouldDegrade?: boolean, + ): EnquireJs; + unregister(mediaQuery: string, handler?: Callback | Options): void; +} + +declare const enquire: EnquireJs; +export = enquire; diff --git a/types/enquire.js/tsconfig.json b/types/enquire.js/tsconfig.json new file mode 100644 index 0000000000..ffbd13d6e2 --- /dev/null +++ b/types/enquire.js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "enquire.js-tests.ts" + ] +} diff --git a/types/enquire.js/tslint.json b/types/enquire.js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/enquire.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From bf57bd768bcc45f01356c4f5816a4ab5a2a6f06c Mon Sep 17 00:00:00 2001 From: Feirell Date: Wed, 28 Mar 2018 17:03:24 +0200 Subject: [PATCH 67/97] Added PlaneHelper in three-core.d.ts --- types/three/three-core.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 5317e38396..8d153a65bc 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -7442,6 +7442,15 @@ export class VertexNormalsHelper extends LineSegments { update(object?: Object3D): void; } +export class PlaneHelper extends LineSegments { + constructor(plane: Plane, size?: number, hex?: number); + + plane: Plane; + size: number; + + updateMatrixWorld(force: boolean): void; +} + /** * @deprecated Use {@link WireframeGeometry THREE.WireframeGeometry} instead. */ From f5da07c596079918095a5b3af7d104488fe05f81 Mon Sep 17 00:00:00 2001 From: Christian Rackerseder Date: Wed, 28 Mar 2018 19:49:44 +0200 Subject: [PATCH 68/97] Fixed import in test --- types/enquire.js/enquire.js-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/enquire.js/enquire.js-tests.ts b/types/enquire.js/enquire.js-tests.ts index 7fce0dd571..a11ba053c2 100644 --- a/types/enquire.js/enquire.js-tests.ts +++ b/types/enquire.js/enquire.js-tests.ts @@ -1,4 +1,4 @@ -import * as enquire from 'enquire.js'; +import enquire = require('enquire.js'); enquire .register('(min-width: 300px) and (max-width: 600px)', { From cc06c0bd237623a251bbd41fe4696321533e7a3b Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 28 Mar 2018 11:13:16 -0700 Subject: [PATCH 69/97] Update react-flatpickr with flatpickr's new exports It switched to a default export that contains nested-nested types. --- types/react-flatpickr/index.d.ts | 6 +++--- types/react-flatpickr/react-flatpickr-tests.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/react-flatpickr/index.d.ts b/types/react-flatpickr/index.d.ts index 68d79a2b6c..9683835e32 100644 --- a/types/react-flatpickr/index.d.ts +++ b/types/react-flatpickr/index.d.ts @@ -5,12 +5,12 @@ // TypeScript Version: 2.6 import { Component } from 'react'; -import { Options } from 'flatpickr'; +import flatpickr from 'flatpickr'; export interface DateTimePickerProps { defaultValue?: string; - options?: Options.Options; - onChange?: Options.Hook; + options?: flatpickr.Options.Options; + onChange?: flatpickr.Options.Hook; value?: string; } diff --git a/types/react-flatpickr/react-flatpickr-tests.tsx b/types/react-flatpickr/react-flatpickr-tests.tsx index c3dc0f4adc..fbbb6f45a7 100644 --- a/types/react-flatpickr/react-flatpickr-tests.tsx +++ b/types/react-flatpickr/react-flatpickr-tests.tsx @@ -1,4 +1,4 @@ -import { Instance } from 'flatpickr'; +import flatpickr from 'flatpickr'; import * as React from 'react'; import DatePicker from 'react-flatpickr'; @@ -12,7 +12,7 @@ const options = { const optionsElement = ; const onChange = ( - selectedDates: Date[], dateStr: string, instance: Instance, + selectedDates: Date[], dateStr: string, instance: flatpickr.Instance, elem: HTMLElement ) => null; const onChangeElement = ; From 5c35553087fe172fbef3c1c5b10378c731e14d41 Mon Sep 17 00:00:00 2001 From: bmartinson Date: Wed, 28 Mar 2018 12:36:52 -0700 Subject: [PATCH 70/97] Add getActiveObjects Definition for fabric.Canvas --- types/fabric/fabric-impl.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 397ea8984a..31509435a5 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1427,6 +1427,11 @@ export class Canvas { * @return active object */ getActiveObject(): Object; + /** + * Returns an array with the current selected objects + * @return {Object[]} array of active objects + */ + getActiveObjects(): Object[]; /** * Returns pointer coordinates relative to canvas. * @return object with "x" and "y" number values From 083f4fcee8e23b6f3c692ea21490a75aedd0c400 Mon Sep 17 00:00:00 2001 From: Ricardo de pena Date: Wed, 28 Mar 2018 15:52:15 -0400 Subject: [PATCH 71/97] Fixed lint issues --- types/openfin/index.d.ts | 74 ++++++++++++++++----------------- types/openfin/openfin-tests.ts | 41 +++++++++--------- types/openfin/tsconfig.json | 5 --- types/openfin/v17/tsconfig.json | 7 +++- 4 files changed, 65 insertions(+), 62 deletions(-) diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts index 3ddbdf2edd..9428247938 100644 --- a/types/openfin/index.d.ts +++ b/types/openfin/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for OpenFin API 29.0 // Project: https://openfin.co/ // Definitions by: Chris Barker +// Ricardo de Pena // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // based on v8.56.29.51 @@ -641,8 +642,8 @@ declare namespace fin { /** * Download preload scripts from given URLs */ - downloadPreloadScripts(scripts: Array, callback?: (downloadInfo: Array) => void, - errorCallback?: (reason: string) => void): void; + downloadPreloadScripts(scripts: DownloadPreloadOption[], callback?: (downloadInfo: DownloadPreloadInfo[]) => void, + errorCallback?: (reason: string) => void): void; /** * Downloads the given OpenFin Runtime. */ @@ -674,7 +675,7 @@ declare namespace fin { /** * Get additional info of cookies. */ - getCookies(option: CookieOption, callback?: (info: Array) => void, errorCallback?: (reason: string) => void): void; + getCookies(option: CookieOption, callback?: (info: CookieInfo[]) => void, errorCallback?: (reason: string) => void): void; /** * Retrieves the command line argument string that started OpenFin Runtime. */ @@ -870,19 +871,18 @@ declare namespace fin { interface DownloadPreloadInfo { success: boolean; - url?: string; - error: string; - } + url?: string; + error: string; + } - - interface CookieInfo { + interface CookieInfo { name: string; // expirationDate: Date; domain: string; path: string; } - interface CookieOption { + interface CookieOption { name: string; } @@ -1145,8 +1145,8 @@ declare namespace fin { */ uuid?: string; /* - * Process exit code - */ + * Process exit code + */ exitCode?: number; }): void; } @@ -1215,13 +1215,13 @@ declare namespace fin { addEventListener( type: OpenFinWindowEventType, listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Performs the specified window transitions @@ -1335,13 +1335,13 @@ declare namespace fin { removeEventListener( type: OpenFinWindowEventType, listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1466,17 +1466,17 @@ declare namespace fin { virtualScreen: MontiorCoordinates; } - interface TrayIconInfo { - x: number; - y: number; - bounds: { - x: number; - y: number; - width: number; - height: number; - } - monitorInfo: MonitorInfo - } + interface TrayIconInfo { + x: number; + y: number; + bounds: { + x: number; + y: number; + width: number; + height: number; + }; + monitorInfo: MonitorInfo; + } interface MonitorInfoDetail { availableRect: MontiorCoordinates; @@ -1784,7 +1784,7 @@ declare namespace fin { parent: { uuid: string; name: string; - } + }; } interface SessionChangedEvent { diff --git a/types/openfin/openfin-tests.ts b/types/openfin/openfin-tests.ts index 2b5237c1e8..6059f54de7 100644 --- a/types/openfin/openfin-tests.ts +++ b/types/openfin/openfin-tests.ts @@ -19,7 +19,7 @@ function test_application() { }, (error) => { console.log("Error creating application:", error); }); - //createFromManifest + // createFromManifest fin.desktop.Application.createFromManifest("http://stuf.com/app.json", (app) => { console.log(app.uuid); }, err => console.log(err)); @@ -88,8 +88,9 @@ function test_application() { // registerCustomData application.registerUser("a", "b", () => console.log("done"), err => console.log(err)); // removeEventListener - const previousCallback = (event: fin.WindowEvent) => { }; - application.removeEventListener("closed", previousCallback, () => { + application.removeEventListener("closed", (event: any) => { + console.log(event); + }, () => { console.log("The unregistration was successful"); }, err => { console.log("failure:", err); @@ -133,8 +134,8 @@ function test_application() { console.log("waiting for hung application"); application.wait(); }); - //uuid - let hasUuid = application.uuid; + // uuid + const hasUuid = application.uuid; } function test_external_application() { @@ -281,7 +282,7 @@ function test_system() { }, err => { console.log("failure: " + err); }); - //flushCookieStore + // flushCookieStore fin.desktop.System.flushCookieStore(() => { console.log('successful'); }, err => { @@ -317,7 +318,7 @@ function test_system() { fin.desktop.System.getCommandLineArguments(args => { console.log("The command line arguments are " + args); }); - //getCookieInfo + // getCookieInfo fin.desktop.System.getCookies({ name: 'myCookie1'}, cookies => { const cookie1 = cookies[0]; console.log(cookie1.name, cookie1.domain, cookie1.path); @@ -356,7 +357,7 @@ function test_system() { console.log(`The filename of the log is ${logInfo.name}, the size is ${logInfo.size}, and the date of creation is ${logInfo.date}`); }); }); - //getMinLogLevel + // getMinLogLevel fin.desktop.System.getMinLogLevel(level => console.log(level), err => console.log(err)); // getMonitorInfo fin.desktop.System.getMonitorInfo(monitorInfo => { @@ -399,7 +400,7 @@ function test_system() { }, error => { console.log('Error:', error); }); - // + // launch external process with an alias fin.desktop.System.launchExternalProcess({ // Additionally note that the executable found in the zip file specified in appAssets // will default to the one mentioned by appAssets.target @@ -491,14 +492,15 @@ function test_system() { }); }); // removeEventListener - const aRegisteredListener = (event: fin.SystemBaseEvent) => { }; - fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, () => { + fin.desktop.System.removeEventListener("monitor-info-changed", (event) => { + console.log(event); + }, () => { console.log("successful"); - }, err => { + }, (err: any) => { console.log("failure: " + err); }); - //setMinLogLevel - fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), err => console.error(err)); + // setMinLogLevel + fin.desktop.System.setMinLogLevel("log level", () => console.log('Success'), (err: any) => console.error(err)); // showDeveloperTools fin.desktop.System.showDeveloperTools("uuid", "name", () => { console.log("successful"); @@ -750,8 +752,9 @@ function test_window() { // moveTo finWindow.moveTo(100, 200); // removeEventListener - const aRegisteredListener = (event: fin.WindowBaseEvent) => { }; - finWindow.removeEventListener("bounds-changed", aRegisteredListener); + finWindow.removeEventListener("bounds-changed", event => { + console.log(event); + }); // resizeBy finWindow.resizeBy(10, 10, "top-right"); // resizeTo @@ -778,13 +781,13 @@ function test_window() { } function test_frame() { - //wrap + // wrap const frame = fin.desktop.Frame.wrap('uuid', 'name'); - //getCurrent + // getCurrent const currentFrame = fin.desktop.Frame.getCurrent(); // addEventlistener frame.addEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); - //removeEventListener + // removeEventListener frame.removeEventListener('event', () => console.log('on event'), () => console.log('success'), err => console.error(err)); // getInfo frame.getInfo(info => { diff --git a/types/openfin/tsconfig.json b/types/openfin/tsconfig.json index df2dae8b79..5299a11917 100644 --- a/types/openfin/tsconfig.json +++ b/types/openfin/tsconfig.json @@ -14,11 +14,6 @@ "../" ], "types": [], - "paths": { - "openfin": [ - "openfin/v29" - ] - }, "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/openfin/v17/tsconfig.json b/types/openfin/v17/tsconfig.json index fd3199ceb7..f2ec7a21dc 100644 --- a/types/openfin/v17/tsconfig.json +++ b/types/openfin/v17/tsconfig.json @@ -14,6 +14,11 @@ "../" ], "types": [], + "paths": { + "openfin": [ + "openfin/v17" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -21,4 +26,4 @@ "index.d.ts", "openfin-tests.ts" ] -} \ No newline at end of file +} From 27c85093ade7cf97873fa40e5d03d176ee8e3aea Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Wed, 28 Mar 2018 20:54:12 +0100 Subject: [PATCH 72/97] Add prorate option to subscription creation options with tests --- types/stripe/index.d.ts | 6 ++++++ types/stripe/stripe-tests.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 361ee4c86b..71396c0183 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -4470,6 +4470,12 @@ declare namespace Stripe { * with month or year intervals, the day of the month for subsequent invoices. */ billing_cycle_anchor?: number; + + /** + * Boolean (default true). Use with a billing_cycle_anchor timestamp to determine whether the customer will be invoiced a prorated amount until + * the anchor date. If false, the anchor period will be free (similar to a trial). + */ + prorate?: boolean; } interface ISubscriptionCreationOptions extends ISubscriptionCustCreationOptions { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 1e7b47a3c7..3642645118 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -252,7 +252,7 @@ stripe.customers.create({ customer.cards.del("card_17xMvXBoqMA9o2xkq6W5gamx").then(function (confirmation) {}); customer.subscriptions.create({ items: [{ plan: "gold" }], trial_period_days: 7 }).then(function (subscription) { }); - customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: "now", billing_cycle_anchor: 1516881177 }).then(function (subscription) { }); + customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: "now", billing_cycle_anchor: 1516881177, prorate: true }).then(function (subscription) { }); customer.subscriptions.create({ items: [{ plan: "gold" }], trial_end: 1516881177, billing: "send_invoice", days_until_due: 7 }).then(function (subscription) { }); customer.subscriptions.create({ items: [{ plan: "gold" }], billing: "charge_automatically" }).then(function (subscription) { }); customer.subscriptions.retrieve("sub_8Eluur5KoIKxuy").then(function (subscription) { From 47c0bffc9a7f6346bcc4b2dcd70b31e14935cb72 Mon Sep 17 00:00:00 2001 From: bmartinson Date: Wed, 28 Mar 2018 13:00:29 -0700 Subject: [PATCH 73/97] Update Tests and Documentation --- types/fabric/index.d.ts | 1 + types/fabric/test/index.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index a0fa06629e..38277c5708 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -4,6 +4,7 @@ // Joseph Livecchi // Michael Randolph // Tiger Oakes +// Brian Martinson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 export import fabric = require("./fabric-impl"); diff --git a/types/fabric/test/index.ts b/types/fabric/test/index.ts index 0f51499c0b..dfdaafce06 100644 --- a/types/fabric/test/index.ts +++ b/types/fabric/test/index.ts @@ -1032,3 +1032,32 @@ function sample9() { canvas.setBackgroundImage('yolo.jpg', () => { "a"; }, { opacity: 45 }); canvas.setBackgroundImage('yolo.jpg', () => { "a"; }); } + +function sample10() { + const canvas = new fabric.Canvas('c'); + const objR = new fabric.Rect({ + top: 10, + left: 10, + width: 10, + height: 10, + fill: "#FF0000", + }); + const objG = new fabric.Rect({ + top: 15, + left: 15, + width: 10, + height: 10, + fill: "#00FF00", + }); + const objB = new fabric.Rect({ + top: 20, + left: 20, + width: 10, + height: 10, + fill: "#0000FF", + }); + canvas.add(objR); + canvas.add(objG); + canvas.add(objB); + const objArray = canvas.getActiveObjects(); +} From 5bfc432d9643d487a95addf4627d42bcdb3752e7 Mon Sep 17 00:00:00 2001 From: Ricardo de pena Date: Wed, 28 Mar 2018 16:18:46 -0400 Subject: [PATCH 74/97] Fixed base url for .17 --- types/openfin/v17/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/openfin/v17/tsconfig.json b/types/openfin/v17/tsconfig.json index f2ec7a21dc..5f07a9e025 100644 --- a/types/openfin/v17/tsconfig.json +++ b/types/openfin/v17/tsconfig.json @@ -9,9 +9,9 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": false, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], "types": [], "paths": { From f52ee65b221bfefeb5f209a4e8e4f6cd9444348e Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Thu, 29 Mar 2018 00:56:19 +0100 Subject: [PATCH 75/97] Add `cancel_at_period_end` option to sub update https://stripe.com/docs/api#update_subscription-cancel_at_period_end --- types/stripe/index.d.ts | 5 +++++ types/stripe/stripe-tests.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 71396c0183..c43e3357a5 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -4562,6 +4562,11 @@ declare namespace Stripe { * String, unchanged (default) or now. This allows you to reset the billing cycle of a subscription. */ billing_cycle_anchor?: "unchanged" | "now"; + + /** + * Boolean indicating whether this subscription should cancel at the end of the current period. + */ + cancel_at_period_end?: boolean; } interface ISubscriptionCancellationOptions extends IDataOptions { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 3642645118..7a45ee9fca 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -259,7 +259,7 @@ stripe.customers.create({ customer.subscriptions.update("sub_8Eluur5KoIKxuy", { items: [{ id: subscription.items.data[0].id, plan: "silver" }] }).then(function (subscription) { }); }); customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: "now", billing_cycle_anchor: "now" }); - customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: 1516881177, billing: "send_invoice", days_until_due: 7, billing_cycle_anchor: "unchanged" }); + customer.subscriptions.update("sub_8Eluur5KoIKxuy", { trial_end: 1516881177, billing: "send_invoice", days_until_due: 7, billing_cycle_anchor: "unchanged", cancel_at_period_end: false }); customer.subscriptions.list().then(function (subscriptions) { }); customer.subscriptions.del("sub_8Eluur5KoIKxuy").then(function (subscription) { }); customer.subscriptions.deleteDiscount("sub_8Eluur5KoIKxuy").then(function (confirmation) { }); From a5d79c1ec641d288cd457f074a0ff5fca1ef3d3c Mon Sep 17 00:00:00 2001 From: Andrija Dvorski Date: Thu, 29 Mar 2018 08:09:24 +0200 Subject: [PATCH 76/97] Fixed import in tests --- types/command-line-usage/command-line-usage-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/command-line-usage/command-line-usage-tests.ts b/types/command-line-usage/command-line-usage-tests.ts index c4dd127cea..05dfadc7f3 100644 --- a/types/command-line-usage/command-line-usage-tests.ts +++ b/types/command-line-usage/command-line-usage-tests.ts @@ -1,4 +1,4 @@ -import * as commandLineUsage from "command-line-usage"; +import commandLineUsage = require("command-line-usage"); const sections = [ { From 81d759c7e84ebc5ff01057536adc4f67823ad356 Mon Sep 17 00:00:00 2001 From: andy-maca <66229754@qq.com> Date: Thu, 29 Mar 2018 15:04:56 +0800 Subject: [PATCH 77/97] Fix build errors --- types/datatables.net-autofill/index.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts index 68075be5ca..2f05d608be 100644 --- a/types/datatables.net-autofill/index.d.ts +++ b/types/datatables.net-autofill/index.d.ts @@ -24,10 +24,6 @@ declare namespace DataTables { * Select the columns that can be auto filled */ columns: string | number[]; - /* - * Attach an Editor instance for database updating - */ - editor: Object; /* * * Initial enablement state of AutoFill From 1824aef19428d49c2be91bc746f3c79384d1b6fc Mon Sep 17 00:00:00 2001 From: lincoln Date: Thu, 29 Mar 2018 15:20:04 +0800 Subject: [PATCH 78/97] update Upload interfaces --- types/dwt/addon.pdf.d.ts | 9 ++-- types/dwt/index.d.ts | 94 ++++++++++++++++++++++++---------------- 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/types/dwt/addon.pdf.d.ts b/types/dwt/addon.pdf.d.ts index 856291a647..87097471b0 100644 --- a/types/dwt/addon.pdf.d.ts +++ b/types/dwt/addon.pdf.d.ts @@ -1,4 +1,5 @@ /*! +* Dynamsoft WebTwain PDF Addon * Based on Dynamsoft WebTwain JavaScript Intellisense * Product: Dynamsoft Web Twain * Web Site: http://www.dynamsoft.com @@ -8,9 +9,9 @@ * Version: 13.4 */ -declare enum EnumDWT_ConverMode { +declare enum EnumDWT_ConvertMode { CM_DEFAULT = 0, - TWPT_CM_RENDERALLGRAY = 1 + CM_RENDERALL = 1 } /** @@ -42,10 +43,10 @@ interface PDF { /** * Set the image convert mode for PDF Rasterizer in Dynamic Web TWAIN. * @method Dynamsoft.WebTwain#SetConvertMode - * @param {EnumDWT_ConverMode} convertMode Specifies the image convert mode. + * @param {EnumDWT_ConvertMode} convertMode Specifies the image convert mode. * @return {boolean} */ - SetConvertMode(convertMode: EnumDWT_ConverMode): boolean; + SetConvertMode(convertMode: EnumDWT_ConvertMode): boolean; /** * Set the output resolution for the PDF Rasterizer in Dynamic Web TWAIN. diff --git a/types/dwt/index.d.ts b/types/dwt/index.d.ts index 69bd65bb9f..be362e680b 100644 --- a/types/dwt/index.d.ts +++ b/types/dwt/index.d.ts @@ -27,7 +27,19 @@ declare namespace Dynamsoft { Errors Events IntToColorStr LS OnGetImageByURL OnGetImageFromServer Path ProgressBar UI Uri addEventListener ajax all appendMessage appendRichMessage aryControlLoadImage attachAddon attachProperty base64 bio cancelFrome clearMessage closeAll closeProgress colorStrToInt config css currentStyle - debug detect detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite + debug*/ + + let detect: { + /*ignored + OnCreatWS OnDetectNext OnWebTwainPostExecute OnWebTwainPreExecute StartWSByIPTimeoutId StartWSTimeoutId + aryReconnectSTwains arySTwains arySTwainsByIP bFirst bNeedUpgradeEvent bNoControlEvent bOK bPromptJSOrServerOutdated + cUrlIndex dcpCallbackType dcpStatus detectType getVersionArray global_dlg hideMask isDWTVersionLatest onNoControl + onNotAllowedForChrome ports scriptLoaded showMask starting tryTimes*/ + ssl: boolean; + }; + + /*ignored + detectButton dialog dialogShowStatus dlgProgress dlgRef drawBoxBorder drawImageWithHermite each empty endsWith */ @@ -53,44 +65,47 @@ declare namespace Dynamsoft { */ } namespace WebTwainEnv { - let JSVersion: string; - let PluginVersion: string; - let ActiveXVersion: string; - let ServerVersionInfo: string; - - let Trial: boolean; - let AutoLoad: boolean; - let ProductKey: string; - let ResourcesPath: string; - - let IfUpdateService: boolean; - let IfUseActiveXForIE10Plus: boolean; - let UseDefaultInstallUI: string; let ActiveXInstallWithCAB: boolean; - let Debug: boolean; - + let ActiveXVersion: string; + let AutoLoad: boolean; + function CloseDialog(): void; let ContainerMap: {}; let Containers: Container[]; + function CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; + function CreateDWTObject(newObjID: string, ip: number | string, port: number | string, portSSL: number | string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; + let Debug: boolean; + function DeleteDWTObject(objID: string): void; let DynamicContainers: string[]; let DynamicDWTMap: {}; - - function CreateDWTObject(newObjID: string, successFn: (dwtObject: WebTwain) => void, failurefn: (...args: any[]) => void): void; function GetWebTwain(cid: string): WebTwain; - function DeleteDWTObject(objID: string): void; + let IfUpdateService: boolean; + let IfUseActiveXForIE10Plus: boolean; + let JSVersion: string; function Load(): void; - function Unload(): void; - function RegisterEvent(event: string, fn: (...args: any[]) => void): void; /*ignored - initQueue inited UseDefaultInstallUI - OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed OnWebTwainReady + OnWebTwainInitMessage OnWebTwainNeedUpgrade OnWebTwainNeedUpgradeWebJavascript OnWebTwainNotFound OnWebTwainOldPluginNotAllowed */ + function OnWebTwainPostExecute(): void; function OnWebTwainPreExecute(): void; + /*ignored + OnWebTwainReady + */ + + let PluginVersion: string; + let ProductKey: string; + function RegisterEvent(event: string, fn: (...args: any[]) => void): void; function RemoveAllAuthorizations(): void; + let ResourcesPath: string; + let ServerVersionInfo: string; function ShowDialog(_dialogWidth: number, _dialogHeight: number, _strDialogMessageWithHtmlFormat: string, _bChangeImage: boolean, bHideCloseButton: boolean): void; - function CloseDialog(): void; + let Trial: boolean; + function Unload(): void; + let UseDefaultInstallUI: string; + let initQueue: number[]; + let inited: boolean; } } @@ -2244,10 +2259,15 @@ interface WebTwain { */ Zoom: number; - /** ignored + /* ignored style _AutoCropMethod */ + + /* + *Methods + */ + /** * Displays the source's built-in interface to acquire image. * @method WebTwain#AcquireImage @@ -2916,7 +2936,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the download fails. Please refer to the function prototype OnFailure. * @return {boolean} */ - HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPDownloadThroughPost(HTTPServer: string, HTTPRemoteFile: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the images specified by the indices to the HTTP server. @@ -2929,7 +2949,7 @@ interface WebTwain { * @param {function} asyncFailureFunc the function to call when the upload fails. Please refer to the function prototype OnFailure. * @return {boolean} */ - HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUpload(url: string, indices: number[], enumImageType: EnumDWT_ImageType, dataFormat: EnumDWT_UploadDataFormat, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads all images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. @@ -2941,7 +2961,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadAllThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads all images in the buffer to the HTTP server through HTTP Post method as a Multi-Page PDF. @@ -2953,7 +2973,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadAllThroughPostAsPDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * [Deprecated.] Uploads all images in the buffer to the HTTP server through the HTTP Put method as a Multi-Page TIFF. @@ -2992,7 +3012,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPost(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page TIFF. @@ -3004,7 +3024,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostAsMultiPageTIFF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the selected images in the buffer to the HTTP server through the HTTP Post method as a Multi-Page PDF. @@ -3016,7 +3036,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostAsMultiPagePDF(HTTPServer: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Directly upload a specific local file to the HTTP server through the HTTP POST method without loading it into Dynamic Web TWAIN. @@ -3029,7 +3049,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload fails. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostDirectly(HTTPServer: string, localFile: string, ActionPage: string, fileName: string, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * Uploads the image of a specified index in the buffer to the HTTP server as a specified image format through the HTTP POST method. @@ -3043,7 +3063,7 @@ interface WebTwain { * @param {function} optionalAsyncFailureFunc optional. The function to call when the upload succeeds. Please refer to the function prototype OnHttpUploadFailure. * @return {boolean} */ - HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): boolean; + HTTPUploadThroughPostEx(HTTPServer: string, sImageIndex: number, ActionPage: string, fileName: string, lImageType: EnumDWT_ImageType, optionalAsyncSuccessFunc?: () => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string, httppostresponsestring: string) => void): boolean; /** * [Deprecated.] Uploads the image of a specified index in the buffer to the HTTP server through the HTTP PUT method. @@ -3244,10 +3264,10 @@ interface WebTwain { * Binds a specified function to an event, so that the function gets called whenever the event fires. * @method WebTwain#RegisterEvent * @param {string} name the name of the event that the function is bound to. - * @param {object} evt specifies the function to call when event fires. + * @param {any} evt specifies the function to call when event fires. * @return {boolean} */ - RegisterEvent(name: string, evt: object): boolean; + RegisterEvent(name: string, evt: any): boolean; /** * Removes all images in buffer. @@ -3415,7 +3435,7 @@ interface WebTwain { /** * Saves the selected images in buffer to base64 string. * @method WebTwain#SaveSelectedImagesToBase64Binary - * @return {string|bool} + * @return {string|boolean} */ SaveSelectedImagesToBase64Binary(optionalAsyncSuccessFunc?: (result: string[]) => void, optionalAsyncFailureFunc?: (errorCode: number, errorString: string) => void): string | boolean; From 72fcbb0d13eea8e0c5d64ebc699f4f8b1ee4e701 Mon Sep 17 00:00:00 2001 From: Alexander Marks Date: Thu, 29 Mar 2018 00:19:26 -0700 Subject: [PATCH 79/97] Add types for path-is-inside --- types/path-is-inside/index.d.ts | 8 +++++++ types/path-is-inside/path-is-inside-tests.ts | 3 +++ types/path-is-inside/tsconfig.json | 23 ++++++++++++++++++++ types/path-is-inside/tslint.json | 1 + 4 files changed, 35 insertions(+) create mode 100644 types/path-is-inside/index.d.ts create mode 100644 types/path-is-inside/path-is-inside-tests.ts create mode 100644 types/path-is-inside/tsconfig.json create mode 100644 types/path-is-inside/tslint.json diff --git a/types/path-is-inside/index.d.ts b/types/path-is-inside/index.d.ts new file mode 100644 index 0000000000..26a28e5db4 --- /dev/null +++ b/types/path-is-inside/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for path-is-inside 1.0 +// Project: https://github.com/domenic/path-is-inside#readme +// Definitions by: Alexander Marks +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function pathIsInside(thePath: string, + potentialParent: string): boolean; +export = pathIsInside; diff --git a/types/path-is-inside/path-is-inside-tests.ts b/types/path-is-inside/path-is-inside-tests.ts new file mode 100644 index 0000000000..723947124a --- /dev/null +++ b/types/path-is-inside/path-is-inside-tests.ts @@ -0,0 +1,3 @@ +import pathIsInside = require('path-is-inside'); + +pathIsInside('path', 'parent'); // $ExpectType boolean diff --git a/types/path-is-inside/tsconfig.json b/types/path-is-inside/tsconfig.json new file mode 100644 index 0000000000..50af237e9a --- /dev/null +++ b/types/path-is-inside/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "path-is-inside-tests.ts" + ] +} diff --git a/types/path-is-inside/tslint.json b/types/path-is-inside/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/path-is-inside/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 2007d0ea35b7918a407cae48fd57feaebbfa19d1 Mon Sep 17 00:00:00 2001 From: Sergey Solomentsev Date: Thu, 29 Mar 2018 11:37:34 +0300 Subject: [PATCH 80/97] Renamed Base class to Generator so to follow latest yeoman API. --- types/yeoman-generator/index.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/types/yeoman-generator/index.d.ts b/types/yeoman-generator/index.d.ts index 9db6a70946..a996185516 100644 --- a/types/yeoman-generator/index.d.ts +++ b/types/yeoman-generator/index.d.ts @@ -11,7 +11,7 @@ import * as inquirer from 'inquirer'; type Callback = (err: any) => void; -declare namespace Base { +declare namespace Generator { interface Question extends inquirer.Question { /** * whether to store the user's previous answer @@ -79,7 +79,7 @@ declare namespace Base { } } -declare class Base extends EventEmitter { +declare class Generator extends EventEmitter { constructor(args: string|string[], options: {}); env: { @@ -89,18 +89,18 @@ declare class Base extends EventEmitter { resolved: string; description: string; appname: string; - config: Base.Storage; - fs: Base.MemFsEditor; + config: Generator.Storage; + fs: Generator.MemFsEditor; options: {}; log(message?: string, context?: any): void; - argument(name: string, config: Base.ArgumentConfig): this; + argument(name: string, config: Generator.ArgumentConfig): this; composeWith(namespace: string, options: { [name: string]: any }, settings?: { local: string, link: 'weak'|'strong' }): this; destinationPath(...path: string[]): string; destinationRoot(rootPath?: string): string; determineAppname(): string; - option(name: string, config: Base.OptionConfig): this; - prompt(questions: Base.Questions): Promise; + option(name: string, config: Generator.OptionConfig): this; + prompt(questions: Generator.Questions): Promise; registerTransformStream(stream: {}|Array<{}>): this; rootGeneratorName(): string; rootGeneratorVersion(): string; @@ -149,7 +149,7 @@ declare class Base extends EventEmitter { * * @return Resolved if install successful, rejected otherwise */ - installDependencies(options?: Base.InstallOptions): Promise; + installDependencies(options?: Generator.InstallOptions): Promise; /** * Receives a list of `packages` and an `options` object to install through npm. * @@ -214,4 +214,4 @@ declare class Base extends EventEmitter { } }; } -export = Base; +export = Generator; \ No newline at end of file From 95deea0a8f70ee3f00c7263c2b1b939cbd9cc216 Mon Sep 17 00:00:00 2001 From: Jack Leigh Date: Thu, 29 Mar 2018 11:06:30 +0100 Subject: [PATCH 81/97] react-native: Export some useful union types --- types/react-native/index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 934b738293..2a08edcdb1 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1044,10 +1044,12 @@ export type KeyboardTypeIOS = | "twitter" | "web-search"; export type KeyboardTypeAndroid = "visible-password"; +export type KeyboardTypeOptions = KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS export type ReturnKeyType = "done" | "go" | "next" | "search" | "send"; export type ReturnKeyTypeAndroid = "none" | "previous"; export type ReturnKeyTypeIOS = "default" | "google" | "join" | "route" | "yahoo" | "emergency-call"; +export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS /** * @see https://facebook.github.io/react-native/docs/textinput.html#props @@ -1103,7 +1105,7 @@ export interface TextInputProperties * The following values work on iOS: - ascii-capable - numbers-and-punctuation - url - number-pad - name-phone-pad - decimal-pad - twitter - web-search * The following values work on Android: - visible-password */ - keyboardType?: KeyboardType | KeyboardTypeIOS | KeyboardTypeAndroid; + keyboardType?: KeyboardTypeOptions; /** * Limits the maximum number of characters that can be entered. @@ -1184,7 +1186,7 @@ export interface TextInputProperties * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call') * Determines how the return key should look. */ - returnKeyType?: ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS; + returnKeyType?: ReturnKeyTypeOptions; /** * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. @@ -3292,6 +3294,7 @@ interface ImagePropertiesAndroid { /** * @see https://facebook.github.io/react-native/docs/image.html */ +export type ImagePropertiesSourceOptions = ImageURISource | ImageURISource[] | ImageRequireSource; export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties { /** * onLayout function @@ -3387,7 +3390,7 @@ export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndr * their width and height. The native side will then choose the best `uri` to display * based on the measured size of the image container. */ - source: ImageURISource | ImageURISource[] | ImageRequireSource; + source: ImagePropertiesSourceOptions; /** * similarly to `source`, this property represents the resource used to render From 9f06b22b1f897ae39161c128a0c5b76e89eed8f3 Mon Sep 17 00:00:00 2001 From: Alexander Marks Date: Thu, 29 Mar 2018 03:22:37 -0700 Subject: [PATCH 82/97] Add types for whatwg-url --- types/whatwg-url/index.d.ts | 105 +++++++++++++++++++++++++++ types/whatwg-url/tsconfig.json | 23 ++++++ types/whatwg-url/tslint.json | 1 + types/whatwg-url/whatwg-url-tests.ts | 45 ++++++++++++ 4 files changed, 174 insertions(+) create mode 100644 types/whatwg-url/index.d.ts create mode 100644 types/whatwg-url/tsconfig.json create mode 100644 types/whatwg-url/tslint.json create mode 100644 types/whatwg-url/whatwg-url-tests.ts diff --git a/types/whatwg-url/index.d.ts b/types/whatwg-url/index.d.ts new file mode 100644 index 0000000000..8bbc271b9a --- /dev/null +++ b/types/whatwg-url/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for whatwg-url 6.4 +// Project: https://github.com/jsdom/whatwg-url#readme +// Definitions by: Alexander Marks +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** https://url.spec.whatwg.org/#url-representation */ +export interface URLRecord { + scheme: string; + username: string; + password: string; + host: string|number|IPv6Address|null; + port: number|null; + path: string[]; + query: string|null; + fragment: string|null; + cannotBeABaseURL?: boolean; +} + +/** https://url.spec.whatwg.org/#concept-ipv6 */ +export type IPv6Address = + [number, number, number, number, number, number, number, number]; + +/** https://url.spec.whatwg.org/#url-class */ +export class URL { + constructor(url: string, base?: string); + + href: string; + readonly origin: string; + protocol: string; + username: string; + password: string; + host: string; + hostname: string; + port: string; + pathname: string; + search: string; + readonly searchParams: URLSearchParams; + hash: string; + + toJSON(): string; +} + +/** https://url.spec.whatwg.org/#interface-urlsearchparams */ +export class URLSearchParams { + constructor(init: (Array<[string, string]>|Iterable<[string, string]>| + {[name: string]: string}|string)); + + append(name: string, value: string): void; + delete(name: string): void; + get(name: string): string|null; + getAll(name: string): string[]; + has(name: string): boolean; + set(name: string, value: string): void; + sort(): void; + + [Symbol.iterator](): IterableIterator<[string, string]>; +} + +/** https://url.spec.whatwg.org/#concept-url-parser */ +export function parseURL( + input: string, + options?: {baseURL?: string, encodingOverride?: string}): URLRecord|null; + +/** https://url.spec.whatwg.org/#concept-basic-url-parser */ +export function basicURLParse(input: string, options?: { + baseURL?: string, + encodingOverride?: string, + url?: URLRecord, + stateOverride?: StateOverride +}): URLRecord|null; + +/** https://url.spec.whatwg.org/#scheme-start-state */ +export type StateOverride = + 'scheme start'|'scheme'|'no scheme'|'special relative or authority'| + 'path or authority'|'relative'|'relative slash'|'special authority slashes'| + 'special authority ignore slashes'|'authority'|'host'|'hostname'|'port'| + 'file'|'file slash'|'file host'|'path start'|'path'| + 'cannot-be-a-base-URL path'|'query'|'fragment'; + +/** https://url.spec.whatwg.org/#concept-url-serializer */ +export function serializeURL( + urlRecord: URLRecord, excludeFragment?: boolean): string; + +/** https://url.spec.whatwg.org/#concept-host-serializer */ +export function serializeHost(host: string|number|IPv6Address): string; + +/** https://url.spec.whatwg.org/#serialize-an-integer */ +export function serializeInteger(number: number): string; + +/** https://html.spec.whatwg.org#ascii-serialisation-of-an-origin */ +export function serializeURLOrigin(urlRecord: URLRecord): string; + +/** https://url.spec.whatwg.org/#set-the-username */ +export function setTheUsername(urlRecord: URLRecord, username: string): void; + +/** https://url.spec.whatwg.org/#set-the-password */ +export function setThePassword(urlRecord: URLRecord, password: string): void; + +/** https://url.spec.whatwg.org/#cannot-have-a-username-password-port */ +export function cannotHaveAUsernamePasswordPort(urlRecord: URLRecord): boolean; + +/** https://url.spec.whatwg.org/#percent-decode */ +export function percentDecode(buffer: Buffer): Buffer; diff --git a/types/whatwg-url/tsconfig.json b/types/whatwg-url/tsconfig.json new file mode 100644 index 0000000000..9b32093c23 --- /dev/null +++ b/types/whatwg-url/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "whatwg-url-tests.ts" + ] +} diff --git a/types/whatwg-url/tslint.json b/types/whatwg-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/whatwg-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/whatwg-url/whatwg-url-tests.ts b/types/whatwg-url/whatwg-url-tests.ts new file mode 100644 index 0000000000..6aae6315eb --- /dev/null +++ b/types/whatwg-url/whatwg-url-tests.ts @@ -0,0 +1,45 @@ +import * as whatwgUrl from 'whatwg-url'; + +// $ExpectType URL +new whatwgUrl.URL('http://example.com'); + +// $ExpectType URL +new whatwgUrl.URL('foo', 'http://example.com'); + +// $ExpectType URLRecord | null +const urlRecord = whatwgUrl.parseURL('http://example.com'); + +if (urlRecord !== null) { + // $ExpectType URLRecord | null + whatwgUrl.basicURLParse('http://example.com', {url: urlRecord}); + + // $ExpectType string + whatwgUrl.serializeURL(urlRecord); + // + // $ExpectType string + whatwgUrl.serializeURLOrigin(urlRecord); + // + // $ExpectType void + whatwgUrl.setTheUsername(urlRecord, 'user'); + // + // $ExpectType void + whatwgUrl.setThePassword(urlRecord, 'secret'); + // + // $ExpectType boolean + whatwgUrl.cannotHaveAUsernamePasswordPort(urlRecord); +} + +// $ExpectType string +whatwgUrl.serializeHost('http://example.com'); + +// $ExpectType string +whatwgUrl.serializeHost(42); + +// $ExpectType string +whatwgUrl.serializeHost([0, 0, 0, 0, 0, 0, 0, 0]); + +// $ExpectType string +whatwgUrl.serializeInteger(42); + +// $ExpectType Buffer +whatwgUrl.percentDecode(Buffer.from('foo')); From 0d32bce4c3f7ed0606871f51968b9ac52e6f220d Mon Sep 17 00:00:00 2001 From: Sergey Solomentsev Date: Thu, 29 Mar 2018 15:14:22 +0300 Subject: [PATCH 83/97] Added new line to the end of the yeoman-generator definition file. --- types/yeoman-generator/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/yeoman-generator/index.d.ts b/types/yeoman-generator/index.d.ts index a996185516..c4a13695fb 100644 --- a/types/yeoman-generator/index.d.ts +++ b/types/yeoman-generator/index.d.ts @@ -214,4 +214,4 @@ declare class Generator extends EventEmitter { } }; } -export = Generator; \ No newline at end of file +export = Generator; From 729ee74fc57d40d9c3322eacd8fadb4e02e820cb Mon Sep 17 00:00:00 2001 From: "Narcisse D. ASSOGBA" Date: Thu, 29 Mar 2018 17:44:35 +0100 Subject: [PATCH 84/97] Add definitions for sql-bricks package --- types/sql-bricks/index.d.ts | 404 ++++++++++++ types/sql-bricks/sql-bricks-tests.ts | 935 +++++++++++++++++++++++++++ types/sql-bricks/tsconfig.json | 23 + types/sql-bricks/tslint.json | 10 + 4 files changed, 1372 insertions(+) create mode 100644 types/sql-bricks/index.d.ts create mode 100644 types/sql-bricks/sql-bricks-tests.ts create mode 100644 types/sql-bricks/tsconfig.json create mode 100644 types/sql-bricks/tslint.json diff --git a/types/sql-bricks/index.d.ts b/types/sql-bricks/index.d.ts new file mode 100644 index 0000000000..d09bfee715 --- /dev/null +++ b/types/sql-bricks/index.d.ts @@ -0,0 +1,404 @@ +// Type definitions for sql-bricks 2.0 +// Project: http://csnw.github.io/sql-bricks +// Definitions by: Narcisse Assogba +// Paleo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace SqlBricks { + /** + * Statement is an abstract base class for all statements (SELECT, INSERT, UPDATE, DELETE) + * and should never be instantiated directly. It is exposed because it can be used with the + * instanceof operator to easily determine whether something is a SQL Bricks statement: my_var instanceof Statement. + */ + interface Statement { + /** + * Clones a statement so that subsequent modifications do not affect the original statement. + */ + clone(): this + + /** + * Returns the non-parameterized SQL for the statement. This is called implicitly by Javascript when using a Statement anywhere that a string is expected (string concatenation, Array.join(), etc). + * While toString() is easy to use, it is not recommended in most cases because: + * It doesn't provide robust protection against SQL injection attacks (it just does basic escaping) + * It doesn't provide as much support for complex data types (objects, arrays, etc, are "stringified" before being passed to your database driver, which then has to interpret them correctly) + * It does not provide the same level of detail in error messages (see this issue) + * For the above reasons, it is usually better to use toParams(). + */ + toString(): string + + /** + * Returns an object with two properties: a parameterized text string and a values array. The values are populated with anything on the right-hand side + * of a WHERE criteria,as well as any values passed into an insert() or update() (they can be passed explicitly with val() or opted out of with sql()) + * @param options A placeholder option of '?%d' can be passed to generate placeholders compatible with node-sqlite3 (%d is replaced with the parameter #): + * @example + * update('person', {'first_name': 'Fred'}).where({'last_name': 'Flintstone'}).toParams({placeholder: '?%d'}); + * // {"text": "UPDATE person SET first_name = ?1 WHERE last_name = ?2", "values": ["Fred", "Flintstone"]} + */ + toParams(options?: { placeholder: string }): SqlBricksParam + } + + interface SqlBricksParam { + text: string + values: any[] + } + + type TableName = string | SelectStatement + + interface OnCriteria { + [column: string]: string + } + + interface WhereObject { + [column: string]: any + } + + interface WhereGroup { + op?: string + expressions: WhereExpression[] + } + + interface WhereBinary { + op: string + col: string | SelectStatement + val: any + quantifier: string + } + + /** + * When a non-expression object is passed somewhere a whereExpression is expected, + * each key/value pair will be ANDed together: + */ + type WhereExpression = WhereGroup | WhereBinary | WhereObject | string + + /** + * A SELECT statement + */ + interface SelectStatement extends Statement { + /** + * Appends additional columns to an existing query. + * @param columns can be passed as multiple arguments, a comma-delimited string or an array. + */ + select(...columns: string[]): SelectStatement + /** + * Appends additional columns to an existing query. + * @param columns can be passed as multiple arguments, a comma-delimited string or an array. + */ + select(columns: string[]): SelectStatement + select(...params): SelectStatement + as(alias: string): SelectStatement + + distinct(...columns): SelectStatement + + /** + * Makes the query a SELECT ... INTO query (which creates a new table with the results of the query). + * @alias intoTable + * @param tbl new table to create + */ + into(tbl: TableName): SelectStatement + /** + * Makes the query a SELECT ... INTO query (which creates a new table with the results of the query). + * @alias into + * @param tbl new table to create + */ + intoTable(tbl: TableName): SelectStatement + + intoTemp(tbl: TableName): SelectStatement, + intoTempTable(tbl: TableName): SelectStatement, + + /** + * Table names can be passed in as multiple string arguments, a comma-delimited string or an array. + * @param tbls table names + */ + from(...tbls: TableName[]): SelectStatement + /** + * Table names can be passed in as multiple string arguments, a comma-delimited string or an array. + * @param tbls array of table names + */ + from(tbls: TableName[]): SelectStatement + + /** + * Adds the specified join to the query. + * @alias innerJoin + * @param tbl can include an alias after a space or after the 'AS' keyword ('my_table my_alias'). + * @param onCriteria is optional if a joinCriteria function has been supplied. + */ + join(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + join(tbl: string, onCol1: string, onCol2: string): SelectStatement + join(firstTbl: string, ...otherTbls: string[]): SelectStatement + + leftJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + leftJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + leftJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + rightJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + rightJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + rightJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + fullJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + fullJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + fullJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + crossJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + crossJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + crossJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + innerJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + innerJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + innerJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + leftOuterJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + leftOuterJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + leftOuterJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + rightOuterJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + rightOuterJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + rightOuterJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + fullOuterJoin(tbl: string, criteria?: OnCriteria | string[] | WhereExpression): SelectStatement + fullOuterJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement + fullOuterJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement + + on(onCriteria: OnCriteria | WhereExpression): SelectStatement, + on(onCol1: string, onCol2: string): SelectStatement, + + /** + * Joins using USING instead of ON. + * @param columnList columnList can be passed in as one or more string arguments, a comma-delimited string, or an array. + * @example + * select('*').from('person').join('address').using('address_id', 'country_id'); + * // SELECT * FROM person INNER JOIN address USING (address_id, country_id) + */ + using(...columnList: string[]): SelectStatement + using(columnList: string[]): SelectStatement + + /** + * Adds the specified natural join to the query. + * @param tbl can include an alias after a space or after the 'AS' keyword ('my_table my_alias'). + */ + naturalJoin(tbl: string): SelectStatement + naturalLeftJoin(tbl: string): SelectStatement + naturalRightJoin(tbl: string): SelectStatement + naturalFullJoin(tbl: string): SelectStatement + + naturalInnerJoin(tbl: string): SelectStatement + naturalLeftOuterJoin(tbl: string): SelectStatement + naturalRightOuterJoin(tbl: string): SelectStatement + naturalFullOuterJoin(tbl: string): SelectStatement + + where(column: string, value?: string): SelectStatement + where(whereExpr: WhereExpression): SelectStatement + where(...options): SelectStatement + + and(...options): SelectStatement + + /** + * Sets or extends the GROUP BY columns. + * @param columns can take multiple arguments, a single comma-delimited string or an array. + */ + groupBy(...columns: string[]): SelectStatement + groupBy(columns: string[]): SelectStatement + + having(column: string, value: string): SelectStatement + having(whereExpr: WhereExpression): SelectStatement + + /** + * Sets or extends the list of columns in the ORDER BY clause. + * @param columns can be passed as multiple arguments, a single comma-delimited string or an array. + */ + orderBy(...columns: string[]): SelectStatement + orderBy(columns: string[]): SelectStatement + order(...columns: string[]): SelectStatement + order(columns: string[]): SelectStatement + + forUpdate(...tbls: string[]): SelectStatement + of(tlb: string): SelectStatement + noWait(): SelectStatement + + union(...stmt: Statement[]): SelectStatement + intersect(...stmt: Statement[]): SelectStatement + minus(...stmt: Statement[]): SelectStatement + except(...stmt: Statement[]): SelectStatement + } + + /** + * An INSERT statement + */ + interface InsertStatement extends Statement { + into(tbl: TableName, ...columns: any[]): InsertStatement + intoTable(tbl: TableName, ...columns: any[]): InsertStatement + select(...params): SelectStatement, + values(...values): InsertStatement + } + + /** + * An UPDATE statement + */ + interface UpdateStatement extends Statement { + values(...values): UpdateStatement + set(...values): UpdateStatement, + where(...options): UpdateStatement, + and(...options): UpdateStatement, + } + + /** + * A DELETE statement + */ + interface DeleteStatement extends Statement { + from(...tbls: string[]): DeleteStatement, + using(...columnList): DeleteStatement, + where(...options): DeleteStatement, + and(...options): DeleteStatement, + } +} + +interface SqlBricksFn { + (...params: any[]): any + /** + * Wraps a value (user-supplied string, number, boolean, etc) so that it can be passed into SQL Bricks + * anywhere that a column is expected (the left-hand side of WHERE criteria and many other SQL Bricks APIs) + * @param value value to be wraped + */ + val(value): any + + /** + * Returns a new INSERT statement. It can be used with or without the new operator. + * @alias insertInto + * @param tbl table name + * @param values a values object or a columns list. Passing a set of columns (as multiple arguments, a comma-delimited string or an array) + * will put the statement into split keys/values mode, where a matching array of values is expected in values() + * @example + * insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'}); + * // INSERT INTO person (first_name, last_name) VALUES ('Fred', 'Flintstone') + */ + insert(tbl?: string, ...values): SqlBricks.InsertStatement + + /** + * Returns a new INSERT statement. It can be used with or without the new operator. + * @alias insert + * @param tbl table name + * @param values a values object or a columns list. Passing a set of columns (as multiple arguments, a comma-delimited string or an array) + * will put the statement into split keys/values mode, where a matching array of values is expected in values() + * @example + * insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'}); + * // INSERT INTO person (first_name, last_name) VALUES ('Fred', 'Flintstone') + */ + insertInto(tbl?: string, ...values): SqlBricks.InsertStatement + + /** + * Returns a new select statement, seeded with a set of columns. It can be used with or without the new keyword. + * @param columns it can be passed in here (or appended later via sel.select() or sel.distinct()) via multiple arguments + * or a comma-delimited string or an array. If no columns are specified, toString() will default to SELECT *. + */ + select(...columns: string[]): SqlBricks.SelectStatement + select(columns: string[] | SqlBricks.SelectStatement[]): SqlBricks.SelectStatement + select(...params): SqlBricks.SelectStatement + + /** + * Returns a new UPDATE statement. It can be used with or without the new operator. + * @param tbl table name + * @param values + */ + update(tbl: string, ...values): SqlBricks.UpdateStatement + + /** + * Returns a new DELETE statement. It can be used with or without the new operator. + * @alias deleteFrom + * @param tbl table name + */ + delete(tbl?: string): SqlBricks.DeleteStatement + /** + * Returns a new DELETE statement. It can be used with or without the new operator. + * @alias delete + * @param tbl table name + */ + deleteFrom(tbl?: string): SqlBricks.DeleteStatement + + /** + * Registers a set of frequently-used table aliases with SQL Bricks. + * These table aliases can then be used by themselves in from(), join(), etc + * and SQL Bricks will automatically expand them to include the table name as well as the alias. + * @param expansions + * @example + * sql.aliasExpansions({'psn': 'person', 'addr': 'address', 'zip': 'zipcode', 'usr': 'user'}); + * select().from('psn').join('addr', {'psn.addr_id': 'addr.id'}); + * // SELECT * FROM person psn INNER JOIN address addr ON psn.addr_id = addr.id + */ + aliasExpansions(expansions: { [tbl: string]: string }): void + + /** + * Sets a user-supplied function to automatically generate the .on() criteria for joins whenever it is not supplied explicitly. + * @param func + */ + joinCriteria(func?: (...args) => SqlBricks.OnCriteria): any + + _extension(): any + prop: number + conversions: any + + ////////////////////////////////////////// + ////// Where Expression functions ////// + ////////////////////////////////////////// + + /** + * Joins the passed expressions with AND + * @param whereExprs + */ + and(...whereExprs: SqlBricks.WhereExpression[]): SqlBricks.WhereGroup + + /** + * Joins the passed expressions with OR: + * @param whereExprs + */ + or(...whereExprs: SqlBricks.WhereExpression[]): SqlBricks.WhereGroup + + /** + * Negates the expression by wrapping it in NOT (...) + * (if it is at the top level, the parentheses are unnecessary and will be omitted) + * @param whereExpr + */ + not(whereExpr: SqlBricks.WhereExpression): SqlBricks.WhereGroup + + /** + * Generates a BETWEEN + * @param column + * @param value1 + * @param value2 + */ + between(column: string, value1, value2): SqlBricks.WhereExpression + isNull(column: string): SqlBricks.WhereExpression + isNotNull(column: string): SqlBricks.WhereExpression + like(column: string, value, escapeStr?: string): SqlBricks.WhereExpression + exists(stmt): SqlBricks.WhereExpression + in(column: string, stmt: SqlBricks.SelectStatement): SqlBricks.WhereExpression + in(column: string, ...values): SqlBricks.WhereExpression + + /** + * Generates the appropriate relational operator (=, <>, <, <=, > or >=). + * @param column column name or query result + * @param value column value + */ + eq(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + equal(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + notEq(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lt(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lte(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gt(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gte(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + + eqAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + notEqAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + ltAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lteAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gtAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gteAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + + eqAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + notEqAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + ltAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lteAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gtAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gteAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + + eqSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + notEqSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + ltSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + lteSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gtSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + gteSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary +} + +declare const SqlBricks: SqlBricksFn +export = SqlBricks diff --git a/types/sql-bricks/sql-bricks-tests.ts b/types/sql-bricks/sql-bricks-tests.ts new file mode 100644 index 0000000000..94014d913d --- /dev/null +++ b/types/sql-bricks/sql-bricks-tests.ts @@ -0,0 +1,935 @@ +// Test file from sql-briks package tests +// https://github.com/CSNW/sql-bricks/blob/master/tests/tests.js +// taked the 03/29/2018. Some dtslint rules has been deabled to be +// close as possible of the original js file. + +import * as sql from "sql-bricks"; + +// tslint:disable-next-line:prefer-const +let assert; +const select = sql.select; +const insertInto = sql.insertInto, insert = sql.insert, + update = sql.update, del = sql.delete; +const and = sql.and, or = sql.or, like = sql.like, not = sql.not, $in = sql.in, + isNull = sql.isNull, isNotNull = sql.isNotNull, equal = sql.equal, eq = sql.eq, + notEq = sql.notEq, lt = sql.lt, lte = sql.lte, gt = sql.gt, gte = sql.gte, + between = sql.between, exists = sql.exists, eqAny = sql.eqAny, notEqAny = sql.notEqAny; + +const alias_expansions = { usr: 'user', psn: 'person', addr: 'address' }; +const table_to_alias = alias_expansions; +sql.aliasExpansions(alias_expansions); + +sql.joinCriteria(function(left_tbl, left_alias, right_tbl, right_alias) { + const criteria = {}; + criteria[left_alias + '.' + table_to_alias[right_tbl] + '_fk'] = right_alias + '.pk'; + return criteria; +}); + +describe('SQL Bricks', function() { + describe('parameterized sql', function() { + it('should generate for insert statements', function() { + const values = { first_name: 'Fred', last_name: 'Flintstone' }; + checkParams(insert('user', values), + 'INSERT INTO "user" (first_name, last_name) VALUES ($1, $2)', + ['Fred', 'Flintstone']); + }); + it('should generate for UPDATEs', function() { + const values = { first_name: 'Fred', last_name: 'Flintstone' }; + checkParams(update('user', values), + 'UPDATE "user" SET first_name = $1, last_name = $2', + ['Fred', 'Flintstone']); + }); + it('should generate for WHERE clauses', function() { + checkParams(select().from('user').where({ + removed: 0, + name: 'Fred Flintstone' + }), 'SELECT * FROM "user" WHERE removed = $1 AND name = $2', + [0, 'Fred Flintstone']); + }); + it('should generate WHERE clauses with arbitrary SQL', function() { + const stmt = select().from('time_limits'); + stmt.where(sql( + "tsrange(start_date_time, end_date_time, '[]') @> tsrange($1, $2, '[]')")); + check(stmt, + "SELECT * FROM time_limits WHERE tsrange(start_date_time, end_date_time, '[]') @> tsrange($1, $2, '[]')"); + }); + it('should generate WHERE clauses with arbitrary SQL and parameters', function() { + const stmt = select().from('time_limits'); + const time1 = '2014-12-06T22:35:00'; + const time2 = '2014-12-06T22:36:00'; + stmt.where(sql( + "tsrange(start_date_time, end_date_time, '[]') @> tsrange($, $, '[]')", time1, time2)); + checkParams(stmt, + "SELECT * FROM time_limits WHERE tsrange(start_date_time, end_date_time, '[]') @> tsrange($1, $2, '[]')", + ['2014-12-06T22:35:00', '2014-12-06T22:36:00']); + }); + it('should handle WHERE clauses with sql() and a null check', function() { + check(select().from('test').where(sql('my_col_val()'), null), + "SELECT * FROM test WHERE my_col_val() IS NULL"); + }); + it('should not escape single quotes in the values returned by toParams()', function() { + checkParams(update('user', { name: "Muad'Dib" }), + 'UPDATE "user" SET name = $1', + ["Muad'Dib"]); + }); + it('should not attempt to serialize arrays (should be done by subsequent layer)', function() { + checkParams(update('user', { name: ["Paul", "Muad'Dib"] }), + 'UPDATE "user" SET name = $1', + [["Paul", "Muad'Dib"]]); + }); + it('should not attempt to serialize dates', function() { + const dt = new Date(); + checkParams(update('user', { birthdate: dt }), + 'UPDATE "user" SET birthdate = $1', + [dt]); + }); + it('should generate node-sqlite3 style params', function() { + const values = { first_name: 'Fred', last_name: 'Flintstone' }; + const result = insert('user', values).toParams({ placeholder: '?%d' }); + assert.equal(result.text, 'INSERT INTO "user" (first_name, last_name) VALUES (?1, ?2)'); + assert.deepEqual(result.values, ['Fred', 'Flintstone']); + }); + it('should generate node-mysql style params', function() { + const values = { first_name: 'Fred', last_name: 'Flintstone' }; + const result = insert('user', values).toParams({ placeholder: '?' }); + assert.equal(result.text, 'INSERT INTO "user" (first_name, last_name) VALUES (?, ?)'); + assert.deepEqual(result.values, ['Fred', 'Flintstone']); + }); + it('should output non-numeric params in SQL order', function() { + const result = select().from('user').where($in(sql.val(5), [3, 5, 10])).toParams({ placeholder: '?' }); + assert.equal(result.text, 'SELECT * FROM "user" WHERE ? IN (?, ?, ?)'); + assert.deepEqual(result.values, [5, 3, 5, 10]); + }); + it('should properly parameterize subqueries', function() { + const values = { first_name: 'Fred' }; + checkParams(select(select('last_name').from('user').where(values)), + 'SELECT (SELECT last_name FROM "user" WHERE first_name = $1)', + ['Fred']); + }); + it('should properly parameterize subqueries with a join', function() { + const values = { first_name: 'Fred' }; + const query = select().from(select().from('user').where(values).as('subuser')) + .join('other_table', { 'other_table.id': 'subuser.id' }); + checkParams(query, + 'SELECT * FROM (SELECT * FROM "user" WHERE first_name = $1) subuser INNER JOIN other_table ON other_table.id = subuser.id', + ['Fred']); + }); + it('should properly parameterize subqueries in updates', function() { + const addr_id_for_usr = select('id').from('address').where('usr_id', sql('"user".id')).and('active', true); + checkParams(update('user').set('addr_id', addr_id_for_usr), + 'UPDATE "user" SET addr_id = (SELECT id FROM address WHERE usr_id = "user".id AND active = $1)', + [true]); + }); + it('should properly merge parameterized sub-expressions with $%d placeholders', function() { + checkParams(select().from('tbl').where(or(sql('a = $1', 444), sql('b = $1', 555), sql('c = $1', 666))), + 'SELECT * FROM tbl WHERE a = $1 OR b = $2 OR c = $3', + [444, 555, 666]); + }); + }); + + describe('value handling', function() { + it('should escape single quotes when toString() is used', function() { + check(update('user', { name: "Muad'Dib" }), + "UPDATE \"user\" SET name = 'Muad''Dib'"); + }); + it('should escape multiple single quotes in the same string', function() { + check(update('address', { city: "Liu'e, Hawai'i" }), + "UPDATE address SET city = 'Liu''e, Hawai''i'"); + }); + it('should support sql.val() to pass in values where columns are expected', function() { + check(select().from('user').where(sql.val('Fred'), sql('first_name')), + "SELECT * FROM \"user\" WHERE 'Fred' = first_name"); + }); + it('should support value objects with differing field orders', function() { + check(insert('user').values([{ id: 1, name: 'Fred' }, { name: 'Barney', id: 2 }]), + "INSERT INTO \"user\" (id, name) VALUES (1, 'Fred'), (2, 'Barney')"); + }); + + describe('.toString() value conversions', function() { + it('should, by default, convert dates to SQL TIMESTAMP WITH TIME ZONE format', function() { + check(update('user', { birthdate: new Date('1980-01-01T00:00:00Z') }), + "UPDATE \"user\" SET birthdate = TIMESTAMP WITH TIME ZONE '1980-01-01 00:00:00.000+00:00'"); + }); + it('should work with sql() SQL literal strings', function() { + check(select().from('person').where(sql('some_func($, $)', ['a', 'b'])), + "SELECT * FROM person WHERE some_func('a', 'b')"); + }); + it('should escape single quotes when sql() SQL literal strings are used', function() { + check(select().from('person').where(sql('some_func($)', ["Muad'Dib"])), + "SELECT * FROM person WHERE some_func('Muad''Dib')"); + }); + it('should support user-supplied conversions', function() { + const orig_bool = sql.conversions.Boolean; + sql.conversions.Boolean = function(bool) { return bool ? '1' : '0'; }; + const str = del('user').where('active', false).toString(); + sql.conversions.Boolean = orig_bool; + assert.equal(str, 'DELETE FROM "user" WHERE active = 0'); + }); + }); + }); + + it('should expand abbreviations in FROM and JOINs', function() { + check(select().from('usr').join('psn', { 'usr.psn_fk': 'psn.pk' }), + 'SELECT * FROM "user" usr INNER JOIN person psn ON usr.psn_fk = psn.pk'); + }); + + it('should expand left_tbl on all joins', function() { + const left_tbls: any[] = []; + const orig = sql.joinCriteria(); + sql.joinCriteria(function(left_tbl) { + left_tbls.push(left_tbl); + // return orig.apply(this, arguments); + return orig.apply(); + }); + + select().from('test').join('psn').join('usr').toString(); + sql.joinCriteria(orig); + assert(left_tbls.indexOf('person') > -1 && left_tbls.indexOf('psn') === -1, 'left_tbl is not expanded: [' + left_tbls.join(',') + ']'); + }); + + it('should support aliases', function() { + check(select().from('user usr2').join('address addr2'), + 'SELECT * FROM "user" usr2 INNER JOIN address addr2 ON usr2.addr_fk = addr2.pk'); + }); + + it('should auto-generate join criteria using supplied joinCriteria() function', function() { + check(select().from('usr').join('psn'), + 'SELECT * FROM "user" usr INNER JOIN person psn ON usr.psn_fk = psn.pk'); + }); + it('should auto-generate join criteria to multiple tables', function() { + check(select().from('usr').join('psn').join('addr'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN person psn ON usr.psn_fk = psn.pk ' + + 'INNER JOIN address addr ON psn.addr_fk = addr.pk'); + }); + it('should auto-generate join criteria from a single table to multiple tables', function() { + check(select().from('usr').join('psn', 'addr'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN person psn ON usr.psn_fk = psn.pk ' + + 'INNER JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('should handle unions', function() { + check(select().from('usr').where({ name: 'Roy' }) + .union(select().from('usr').where({ name: 'Moss' })) + .union(select().from('usr').where({ name: 'The elders of the internet' })), + "SELECT * FROM \"user\" usr WHERE name = 'Roy'" + + " UNION SELECT * FROM \"user\" usr WHERE name = 'Moss'" + + " UNION SELECT * FROM \"user\" usr WHERE name = 'The elders of the internet'"); + }); + it('should handle chained unions', function() { + check(select().from('usr').where({ name: 'Roy' }) + .union().select().from('usr').where({ name: 'blurns' }), + "SELECT * FROM \"user\" usr WHERE name = 'Roy'" + + " UNION SELECT * FROM \"user\" usr WHERE name = 'blurns'"); + }); + it('should handle chained unions with params', function() { + checkParams(select().from('usr').where({ name: 'Roy' }) + .union().select().from('usr').where({ name: 'Moss' }), + "SELECT * FROM \"user\" usr WHERE name = $1" + + " UNION SELECT * FROM \"user\" usr WHERE name = $2", ['Roy', 'Moss']); + }); + it('should handle unions with params', function() { + checkParams(select().from('usr').where({ name: 'Roy' }) + .union(select().from('usr').where({ name: 'Moss' })) + .union(select().from('usr').where({ name: 'The elders of the internet' })), + 'SELECT * FROM "user" usr WHERE name = $1' + + ' UNION SELECT * FROM "user" usr WHERE name = $2' + + ' UNION SELECT * FROM "user" usr WHERE name = $3', + ['Roy', 'Moss', 'The elders of the internet']); + }); + + describe('UPDATE statements', function() { + it('should handle .set() with (key, value)', function() { + check(update('user').set('name', 'Fred'), + "UPDATE \"user\" SET name = 'Fred'"); + }); + it('should handle .values() with an object literal', function() { + check(update('user').values({ name: 'Fred' }), + "UPDATE \"user\" SET name = 'Fred'"); + }); + it('should handle multiple .set()s with object literals', function() { + check(update('user').set({ name: 'Fred' }).set({ last_name: 'Flintstone' }), + "UPDATE \"user\" SET name = 'Fred', last_name = 'Flintstone'"); + }); + it('should handle multiple .values() with (key, value)', function() { + check(update('user').values('name', 'Fred').values('last_name', 'Flintstone'), + "UPDATE \"user\" SET name = 'Fred', last_name = 'Flintstone'"); + }); + it('should handle values argument', function() { + check(update('user', { name: 'Fred' }), + "UPDATE \"user\" SET name = 'Fred'"); + }); + }); + + describe('INSERT statements', function() { + it('should take an object of column/value pairs', function() { + check(insert('user', { id: 33, name: 'Fred' }), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should insert a null for undefined', function() { + check(insert('user', { id: 33, name: undefined }), + "INSERT INTO \"user\" (id, name) VALUES (33, null)"); + }); + it('should insert a null for null', function() { + check(insert('user', { id: 33, name: null }), + "INSERT INTO \"user\" (id, name) VALUES (33, null)"); + }); + it('should take an array of columns & values', function() { + check(insert('user', ['id', 'name']).values([33, 'Fred']), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should take multiple parameters of columns & values', function() { + check(insert('user', 'id', 'name').values(33, 'Fred'), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should take an array of objects', function() { + check(insert('user', [{ id: 33, name: 'Fred' }, { id: 34, name: 'Wilma' }]), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred'), (34, 'Wilma')"); + }); + + describe('.values()', function() { + it('should take an array of arrays', function() { + check(insert('user', ['id', 'name']).values([[33, 'Fred'], [34, 'Wilma']]), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred'), (34, 'Wilma')"); + }); + }); + + describe('.into()', function() { + it('should take an object of column/value pairs', function() { + check(insert().into('user', { id: 33, name: 'Fred' }), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should take an array of columns & values', function() { + check(insert().into('user', ['id', 'name']).values([33, 'Fred']), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + it('should take multiple parameters of columns & values', function() { + check(insert().into('user', 'id', 'name').values(33, 'Fred'), + "INSERT INTO \"user\" (id, name) VALUES (33, 'Fred')"); + }); + }); + }); + + describe('SELECT clause', function() { + it('should handle an array', function() { + check(select(['one', 'order']).from('user'), + 'SELECT one, "order" FROM "user"'); + }); + it('should handle multiple args', function() { + check(select('one', 'order').from('user'), + 'SELECT one, "order" FROM "user"'); + }); + it('should default to *', function() { + check(select().from('user'), + 'SELECT * FROM "user"'); + }); + it('should handle a comma-delimited str', function() { + check(select('one, order').from('user'), + 'SELECT one, "order" FROM "user"'); + }); + it('should handle being called multiple times', function() { + check(select('one, order').select(['two', 'desc']).select('three', 'four').from('user'), + 'SELECT one, "order", two, "desc", three, four FROM "user"'); + }); + it('should support DISTINCT', function() { + check(select('one, order').distinct('two, desc').from('user'), + 'SELECT DISTINCT one, "order", two, "desc" FROM "user"'); + }); + it('should support FOR UPDATE', function() { + check(select().from('user').forUpdate(), + 'SELECT * FROM "user" FOR UPDATE'); + }); + it('should support FOR UPDATE w/ col list', function() { + check(select().from('user').forUpdate().of('user'), + 'SELECT * FROM "user" FOR UPDATE OF "user"'); + }); + it('should support FOR UPDATE OF ... NO WAIT', function() { + check(select().from('user').forUpdate().of('user').noWait(), + 'SELECT * FROM "user" FOR UPDATE OF "user" NO WAIT'); + }); + }); + + describe('.from()', function() { + it('should handle an array', function() { + check(select().from(['one', 'two', 'usr']), + 'SELECT * FROM one, two, "user" usr'); + }); + it('should handle multiple args', function() { + check(select().from('one', 'two', 'usr'), + 'SELECT * FROM one, two, "user" usr'); + }); + it('should handle a comma-delimited string', function() { + check(select().from('one, two, usr'), + 'SELECT * FROM one, two, "user" usr'); + }); + it('should handle being called multiple times', function() { + check(select().from('one', 'usr').from(['two', 'psn']).from('three, addr'), + 'SELECT * FROM one, "user" usr, two, person psn, three, address addr'); + }); + it('should handle subquery object', function() { + check(select().from(select().from('user').as('subq')), + 'SELECT * FROM (SELECT * FROM "user") subq'); + }); + it('should handle subquery string', function() { + check(select().from('(SELECT * FROM "user") subq'), + 'SELECT * FROM (SELECT * FROM "user") subq'); + }); + }); + + describe('select().into() should insert into a new table', function() { + it('.into()', function() { + check(select().into('new_user').from('user'), + 'SELECT * INTO new_user FROM "user"'); + }); + it('.intoTable()', function() { + check(select().intoTable('new_user').from('user'), + 'SELECT * INTO new_user FROM "user"'); + }); + it('intoTemp()', function() { + check(select().intoTemp('new_user').from('user'), + 'SELECT * INTO TEMP new_user FROM "user"'); + }); + it('intoTempTable()', function() { + check(select().intoTempTable('new_user').from('user'), + 'SELECT * INTO TEMP new_user FROM "user"'); + }); + }); + + describe('insert().into() should insert into a preexisting table', function() { + it('insert().into().select()', function() { + check(insert().into('new_user', 'id', 'addr_id') + .select('id', 'addr_id').from('user'), + 'INSERT INTO new_user (id, addr_id) SELECT id, addr_id FROM "user"'); + }); + it('insert().into().select() with no columns', function() { + check(insert().into('new_user') + .select('id', 'addr_id').from('user'), + 'INSERT INTO new_user SELECT id, addr_id FROM "user"'); + }); + it('insert().select()', function() { + check(insert('new_user', 'id', 'addr_id') + .select('id', 'addr_id').from('user'), + 'INSERT INTO new_user (id, addr_id) SELECT id, addr_id FROM "user"'); + }); + it('insert().select() with params', function() { + check(insert('new_user', 'id', 'addr_id') + .select('id', 'addr_id').from('user').where({ active: true }).toParams().text, + 'INSERT INTO new_user (id, addr_id) SELECT id, addr_id FROM "user" WHERE active = $1'); + }); + }); + + describe('GROUP BY clause', function() { + it('should support single group by', function() { + check(select().from('user').groupBy('last_name'), + 'SELECT * FROM "user" GROUP BY last_name'); + }); + it('should support multiple groupBy() args w/ reserved words quoted', function() { + check(select().from('user').groupBy('last_name', 'order'), + 'SELECT * FROM "user" GROUP BY last_name, "order"'); + }); + it('should support .groupBy().groupBy()', function() { + check(select().from('user').groupBy('last_name').groupBy('order'), + 'SELECT * FROM "user" GROUP BY last_name, "order"'); + }); + it('should support an array', function() { + check(select().from('user').groupBy(['last_name', 'order']), + 'SELECT * FROM "user" GROUP BY last_name, "order"'); + }); + }); + + describe('.order() / .orderBy()', function() { + it('should support .orderBy(arg1, arg2)', function() { + check(select().from('user').orderBy('last_name', 'order'), + 'SELECT * FROM "user" ORDER BY last_name, "order"'); + }); + it('should support an array', function() { + check(select().from('user').orderBy(['last_name', 'order']), + 'SELECT * FROM "user" ORDER BY last_name, "order"'); + }); + it('should support being called multiple times', function() { + check(select().from('user').orderBy('last_name').orderBy('order'), + 'SELECT * FROM "user" ORDER BY last_name, "order"'); + }); + }); + + describe('joins', function() { + it('.join() should accept a comma-delimited string', function() { + check(select().from('usr').join('psn, addr'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN person psn ON usr.psn_fk = psn.pk ' + + 'INNER JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.leftJoin() should generate a left join', function() { + check(select().from('usr').leftJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'LEFT JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.leftOuterJoin() should generate a left join', function() { + check(select().from('usr').leftOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'LEFT JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.rightJoin() should generate a right join', function() { + check(select().from('usr').rightJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'RIGHT JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.rightOuterJoin() should generate a right join', function() { + check(select().from('usr').rightOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'RIGHT JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.fullJoin() should generate a full join', function() { + check(select().from('usr').fullJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'FULL JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.fullOuterJoin() should generate a full join', function() { + check(select().from('usr').fullOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'FULL JOIN address addr ON usr.addr_fk = addr.pk'); + }); + it('.crossJoin() should generate a cross join', function() { + check(select().from('usr').crossJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'CROSS JOIN address addr'); + }); + it('join() should accept an expression for the on argument', function() { + check(select().from('usr').join('addr', eq('usr.addr_id', sql('addr.id'))), + 'SELECT * FROM "user" usr INNER JOIN address addr ON usr.addr_id = addr.id'); + }); + it('join() should accept an array for the on argument (for JOIN USING)', function() { + check(select().from('usr').join('addr', ['addr_id', 'country_id']), + 'SELECT * FROM "user" usr INNER JOIN address addr USING (addr_id, country_id)'); + }); + }); + + describe('.on()', function() { + it('should accept an object literal', function() { + check(select().from('usr').join('addr').on({ 'usr.addr_id': 'addr.id' }), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr ON usr.addr_id = addr.id'); + }); + it('should accept a (key, value) pair', function() { + check(select().from('usr').join('addr').on('usr.addr_id', 'addr.id'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr ON usr.addr_id = addr.id'); + }); + it('can be called multiple times', function() { + check(select().from('usr', 'psn').join('addr').on({ 'usr.addr_id': 'addr.id' }) + .on('psn.addr_id', 'addr.id'), + 'SELECT * FROM "user" usr, person psn ' + + 'INNER JOIN address addr ON usr.addr_id = addr.id AND psn.addr_id = addr.id'); + }); + it('can be called multiple times w/ an object literal', function() { + check(select().from('usr', 'psn').join('addr').on({ 'usr.addr_id': 'addr.id' }) + .on({ 'psn.addr_id': 'addr.id' }), + 'SELECT * FROM "user" usr, person psn ' + + 'INNER JOIN address addr ON usr.addr_id = addr.id AND psn.addr_id = addr.id'); + }); + it('should accept an expression', function() { + check(select().from('usr').join('addr').on(eq('usr.addr_id', sql('addr.id'))), + 'SELECT * FROM "user" usr INNER JOIN address addr ON usr.addr_id = addr.id'); + }); + it('should not proceed if .using() has already been used', function() { + assert.throws(function() { + select().from('t1').join('t2').using('id').on({ 't1.t2_id': 't2.id' }); + }); + }); + }); + + describe('.using()', function() { + it('should accept a comma-delimited string', function() { + check(select().from('usr').join('addr').using('addr_id, contrived_id'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr USING (addr_id, contrived_id)'); + }); + it('should accept multiple arguments', function() { + check(select().from('usr').join('addr').using('addr_id', 'contrived_id'), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr USING (addr_id, contrived_id)'); + }); + it('should accept an array literal', function() { + check(select().from('usr').join('addr').using(['addr_id', 'contrived_id']), + 'SELECT * FROM "user" usr ' + + 'INNER JOIN address addr USING (addr_id, contrived_id)'); + }); + it('should not proceed if .on() has already been used', function() { + assert.throws(function() { + select().from('t1').join('t2').on({ 't1.t2_id': 't2.id' }).using('id'); + }); + }); + }); + + describe('natural joins', function() { + it('.naturalJoin() should accept a comma-delimited string', function() { + check(select().from('usr').naturalJoin('psn, addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL INNER JOIN person psn ' + + 'NATURAL INNER JOIN address addr'); + }); + it('.naturalLeftJoin() should generate a natural left join', function() { + check(select().from('usr').naturalLeftJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL LEFT JOIN address addr'); + }); + it('.naturalLeftOuterJoin() should generate a natural left join', function() { + check(select().from('usr').naturalLeftOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL LEFT JOIN address addr'); + }); + it('.naturalRightJoin() should generate a natural right join', function() { + check(select().from('usr').naturalRightJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL RIGHT JOIN address addr'); + }); + it('.naturalRightOuterJoin() should generate a natural right join', function() { + check(select().from('usr').naturalRightOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL RIGHT JOIN address addr'); + }); + it('.naturalFullJoin() should generate a natural full join', function() { + check(select().from('usr').naturalFullJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL FULL JOIN address addr'); + }); + it('.naturalFullOuterJoin() should generate a natural full join', function() { + check(select().from('usr').naturalFullOuterJoin('addr'), + 'SELECT * FROM "user" usr ' + + 'NATURAL FULL JOIN address addr'); + }); + }); + + describe('WHERE clauses', function() { + it('should AND multiple where() criteria by default', function() { + check(select().from('user').where({ + first_name: 'Fred', + last_name: 'Flintstone' + }), + "SELECT * FROM \"user\" WHERE first_name = 'Fred' AND last_name = 'Flintstone'"); + }); + it('should AND multiple where()s by default', function() { + check(select().from('user').where({ first_name: 'Fred' }) + .where({ last_name: 'Flintstone' }), + "SELECT * FROM \"user\" WHERE first_name = 'Fred' AND last_name = 'Flintstone'"); + }); + it('should handle explicit .and() with (key, value) args', function() { + check(select().from('user').where('first_name', 'Fred') + .and('last_name', 'Flintstone'), + "SELECT * FROM \"user\" WHERE first_name = 'Fred' AND last_name = 'Flintstone'"); + }); + it('should handle nested and(or())', function() { + check(select().from('user').where(and({ last_name: 'Flintstone' }, or({ first_name: 'Fred' }, { first_name: 'Wilma' }))), + "SELECT * FROM \"user\" WHERE last_name = 'Flintstone' AND (first_name = 'Fred' OR first_name = 'Wilma')"); + }); + it('should handle or([...])', function() { + check(select().from('table').where({ this: 'test' }).and(or(['test1', 'test2'].map(function(val) { return eq('that', val); }))), + "SELECT * FROM \"table\" WHERE this = 'test' AND (that = 'test1' OR that = 'test2')"); + }); + it('and() should be implicit', function() { + check(select().from('user').where({ last_name: 'Flintstone' }, or({ first_name: 'Fred' }, { first_name: 'Wilma' })), + "SELECT * FROM \"user\" WHERE last_name = 'Flintstone' AND (first_name = 'Fred' OR first_name = 'Wilma')"); + }); + it('should handle like()', function() { + check(select().from('user').where(like('last_name', 'Flint%')), + "SELECT * FROM \"user\" WHERE last_name LIKE 'Flint%'"); + }); + it('should accept a 3rd escape param to like()', function() { + check(select().from('user').where(like('percent', '100\\%', '\\')), + "SELECT * FROM \"user\" WHERE percent LIKE '100\\%' ESCAPE '\\'"); + }); + it('should handle not()', function() { + check(select().from('user').where(not({ first_name: 'Fred' })), + "SELECT * FROM \"user\" WHERE NOT first_name = 'Fred'"); + }); + it('should handle in()', function() { + check(select().from('user').where($in('first_name', ['Fred', 'Wilma'])), + "SELECT * FROM \"user\" WHERE first_name IN ('Fred', 'Wilma')"); + }); + it('should handle .in() with multiple args', function() { + check(select().from('user').where($in('name', 'Jimmy', 'Owen')), + "SELECT * FROM \"user\" WHERE name IN ('Jimmy', 'Owen')"); + }); + it('should handle .in() with a subquery', function() { + check(select().from('user').where($in('addr_id', select('id').from('address'))), + 'SELECT * FROM "user" WHERE addr_id IN (SELECT id FROM address)'); + }); + it('should handle exists() with a subquery', function() { + check(select().from('user').where(exists(select().from('address').where({ 'user.addr_id': sql('address.id') }))), + 'SELECT * FROM "user" WHERE EXISTS (SELECT * FROM address WHERE "user".addr_id = address.id)'); + }); + it('should handle exists() with a subquery, parameterized', function() { + checkParams(select().from('user').where('active', true).where(exists(select().from('address').where({ 'user.addr_id': 37 }))), + 'SELECT * FROM "user" WHERE active = $1 AND EXISTS (SELECT * FROM address WHERE "user".addr_id = $2)', + [true, 37]); + }); + it('should handle isNull()', function() { + check(select().from('user').where(isNull('first_name')), + 'SELECT * FROM "user" WHERE first_name IS NULL'); + }); + it('should handle isNotNull()', function() { + check(select().from('user').where(isNotNull('first_name')), + 'SELECT * FROM "user" WHERE first_name IS NOT NULL'); + }); + it('should automatically generate IS NULL', function() { + check(select().from('user').where({ first_name: null }), + 'SELECT * FROM "user" WHERE first_name IS NULL'); + }); + it('should handle explicit equal()', function() { + check(select().from('user').where(equal('first_name', 'Fred')), + "SELECT * FROM \"user\" WHERE first_name = 'Fred'"); + }); + it('should automatically generate IS NOT NULL', function() { + check(select().from('user').where(notEq('first_name', null)), + "SELECT * FROM \"user\" WHERE first_name IS NOT NULL"); + }); + it('should handle lt()', function() { + check(select().from('user').where(lt('order', 5)), + 'SELECT * FROM "user" WHERE "order" < 5'); + }); + it('should handle lte()', function() { + check(select().from('user').where(lte('order', 5)), + 'SELECT * FROM "user" WHERE "order" <= 5'); + }); + it('should handle gt()', function() { + check(select().from('user').where(gt('order', 5)), + 'SELECT * FROM "user" WHERE "order" > 5'); + }); + it('should handle gte()', function() { + check(select().from('user').where(gte('order', 5)), + 'SELECT * FROM "user" WHERE "order" >= 5'); + }); + it('should handle between()', function() { + check(select().from('user').where(between('name', 'Frank', 'Fred')), + "SELECT * FROM \"user\" WHERE name BETWEEN 'Frank' AND 'Fred'"); + }); + it('should do nothing for null, undefined, {}', function() { + check(select().from('user').where(), + "SELECT * FROM \"user\""); + check(select().from('user').where(null), + "SELECT * FROM \"user\""); + check(select().from('user').where({}), + "SELECT * FROM \"user\""); + check(select().from('user').where(undefined), + "SELECT * FROM \"user\""); + }); + it('should not ignore the 2nd arg if the first is {}', function() { + check(select().from('user').where({}, { name: 'Fred' }), + "SELECT * FROM \"user\" WHERE name = 'Fred'"); + }); + + describe('customizations', function() { + it('should support customized criteria', function() { + check(select().from('table').where(arraysToOrs({ this: 'test', that: ['test1', 'test2'] })), + "SELECT * FROM \"table\" WHERE this = 'test' AND (that = 'test1' OR that = 'test2')"); + }); + + it('should support changing the default array handling', function() { + const proto = sql.select.prototype; + const orig = proto.where; + proto.where = function(criteria) { + // return orig.call(this, arraysToOrs(criteria)); + return orig.call() + }; + + check(select().from('table').where({ this: 'test', that: ['test1', 'test2'] }), + "SELECT * FROM \"table\" WHERE this = 'test' AND (that = 'test1' OR that = 'test2')"); + + proto.where = orig; + }); + + function arraysToOrs(criteria) { + const where = and(); + for (const col in criteria) { + const val = criteria[col]; + let expr; + if (Array.isArray(val)) + expr = or(val.map(function(val) { return eq(col, val); })); + else + expr = eq(col, val); + where.expressions.push(expr); + } + return where; + } + + it('should support converting expressions to string', function() { + check(and({ this: 'test' }, $in('that', ['v1', 'v2'])), + "(this = 'test' AND that IN ('v1', 'v2'))"); + }); + + it('should support raw sql blocks in expressions', function() { + check(and({ this: 'test' }, sql('field is null')), + "(this = 'test' AND field is null)"); + }); + + it('should support converting ?-parameterized sql blocks to string', function() { + check(sql('field = ?', 123).toString({ placeholder: '?' }), + "field = 123"); + }); + + it('should support converting default-parameterized sql blocks to string', function() { + check(sql('field = $1', 123), + "field = 123"); + }); + }); + }); + + describe('should quote column names with capitals in them', function() { + it('in SELECT', function() { + check(select('Name').from('user'), + 'SELECT "Name" FROM "user"'); + }); + it('in SELECT, after tbl prefix, before AS suffix', function() { + check(select('user.Name AS UserName').from('user'), + 'SELECT "user"."Name" AS UserName FROM "user"'); + }); + it('in SELECT, after tbl prefix, with the optional "AS" omitted', function() { + check(select('user.Name UserName').from('user'), + 'SELECT "user"."Name" UserName FROM "user"'); + }); + it('in SELECT, with the optional "AS" omitted', function() { + check(select('Name UserName').from('user'), + 'SELECT "Name" UserName FROM "user"'); + }); + }); + + describe('should quote table names that are reserved words or have capitals', function() { + it('in joins', function() { + check(select('Name UserName').from('person').join('user', { 'person.usr_id': 'user.id' }), + 'SELECT "Name" UserName FROM person INNER JOIN "user" ON person.usr_id = "user".id'); + }); + it('unless they are wrapped in sql() literals (to query reserved system tables)', function() { + check(select(sql('user.id')).from(sql('user')), + 'SELECT user.id FROM user'); + }); + }); + + describe('should quote reserved words in column names', function() { + it('in ORDER BY', function() { + check(select().from('usr').orderBy('order'), + 'SELECT * FROM "user" usr ORDER BY "order"'); + }); + it('in SELECT', function() { + check(select('desc').from('usr'), + 'SELECT "desc" FROM "user" usr'); + }); + it('in JOIN ONs', function() { + check(select().from('usr').join('psn', { 'usr.order': 'psn.order' }), + 'SELECT * FROM "user" usr INNER JOIN person psn ON usr."order" = psn."order"'); + }); + it('in JOIN USINGs', function() { + check(select().from('usr').join('psn').using('order'), + 'SELECT * FROM "user" usr INNER JOIN person psn USING ("order")'); + }); + it('in INSERT', function() { + check(insert('user').values({ order: 1 }), + 'INSERT INTO "user" ("order") VALUES (1)'); + }); + it('in alternative insert() API', function() { + check(insert('user', 'order').values(1), + 'INSERT INTO "user" ("order") VALUES (1)'); + }); + it('with a db and table prefix and a suffix', function() { + check(select('db.person.desc AS psn_desc').from('person'), + 'SELECT db.person."desc" AS psn_desc FROM person'); + }); + it('should quote sqlite reserved words', function() { + check(select('action').from('user'), + 'SELECT "action" FROM "user"'); + }); + it('should not quote reserved words in SELECT expressions', function() { + check(select("CASE WHEN name = 'Fred' THEN 1 ELSE 0 AS security_level").from('user'), + "SELECT CASE WHEN name = 'Fred' THEN 1 ELSE 0 AS security_level FROM \"user\""); + }); + }); + + describe('subqueries in <, >, etc', function() { + it('should support a subquery in >', function() { + const count_addrs_for_usr = select('count(*)').from('address').where({ 'user.addr_id': sql('address.id') }); + check(select().from('user').where(gt(count_addrs_for_usr, 5)), + 'SELECT * FROM "user" WHERE (SELECT count(*) FROM address WHERE "user".addr_id = address.id) > 5'); + }); + it('should support a subquery in <=', function() { + const count_addrs_for_usr = select('count(*)').from('address').where({ 'user.addr_id': sql('address.id') }); + check(select().from('user').where(lte(count_addrs_for_usr, 5)), + 'SELECT * FROM "user" WHERE (SELECT count(*) FROM address WHERE "user".addr_id = address.id) <= 5'); + }); + it('should support = ANY (subquery) quantifier', function() { + check(select().from('user').where(eqAny('user.id', select('user_id').from('address'))), + 'SELECT * FROM "user" WHERE "user".id = ANY (SELECT user_id FROM address)'); + }); + it('should support <> ANY (subquery) quantifier', function() { + check(select().from('user').where(notEqAny('user.id', select('user_id').from('address'))), + 'SELECT * FROM "user" WHERE "user".id <> ANY (SELECT user_id FROM address)'); + }); + }); + + describe('deep Statement.clone()', function() { + it('should deep clone WHERE expressions', function() { + const sel = select().from('user').where({ first_name: 'Fred' }); + sel.clone().where({ last_name: 'Flintstone' }); + check(sel, "SELECT * FROM \"user\" WHERE first_name = 'Fred'"); + }); + it('should deep clone .order()', function() { + const sel = select().from('user').order('name'); + sel.clone().order('last_name'); + check(sel, 'SELECT * FROM "user" ORDER BY name'); + }); + it('should deep clone .join()', function() { + const sel = select().from('user').join('addr'); + sel.clone().join('psn'); + check(sel, 'SELECT * FROM "user" INNER JOIN address addr ON "user".addr_fk = addr.pk'); + }); + it('should clone values', function() { + const ins = insert('user', { first_name: 'Fred' }); + ins.clone().values({ last_name: 'Flintstone' }); + check(ins, "INSERT INTO \"user\" (first_name) VALUES ('Fred')"); + }); + it('should clone $in subqueries', function() { + const sel = select().from('user').where($in('first_name', select('first_name').from('user'))); + sel.clone().where('last_name', 'Flintstone'); + check(sel, "SELECT * FROM \"user\" WHERE first_name IN (SELECT first_name FROM \"user\")"); + }); + }); + + describe('the AS keyword', function() { + it('should not generate invalid SQL', function() { + check(select().from('user AS usr').join('addr'), + 'SELECT * FROM "user" AS usr INNER JOIN address addr ON usr.addr_fk = addr.pk'); + }); + }); + + describe('delete()', function() { + it('should generate a DELETE statement', function() { + check(del('user'), + 'DELETE FROM "user"'); + }); + it('should support .from()', function() { + check(del().from('user'), + 'DELETE FROM "user"'); + }); + it('should generate a DELETE statement with a WHERE clause', function() { + check(del('user').where('first_name', 'Fred'), + "DELETE FROM \"user\" WHERE first_name = 'Fred'"); + }); + }); + + describe('_extension()', function() { + it('should shield base', function() { + const ext = sql._extension(); + + ext.prop = 1; + assert.equal(sql.prop, undefined); + + ext.select.prop = 1; + // assert.equal(sql.select.returning, undefined); + + assert(ext.select.prototype.clauses !== sql.select.prototype.clauses); + }); + }); +}); + +function describe(...param) { } +function it(...param) { } +function check(...param) { } +function checkParams(...param) { } diff --git a/types/sql-bricks/tsconfig.json b/types/sql-bricks/tsconfig.json new file mode 100644 index 0000000000..3c5db90a4f --- /dev/null +++ b/types/sql-bricks/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": false, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sql-bricks-tests.ts" + ] +} \ No newline at end of file diff --git a/types/sql-bricks/tslint.json b/types/sql-bricks/tslint.json new file mode 100644 index 0000000000..1e7260a20f --- /dev/null +++ b/types/sql-bricks/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "only-arrow-functions": false, + "prefer-template": false, + "prefer-conditional-expression": false, + "one-variable-per-declaration": false, + "semicolon":false + } +} \ No newline at end of file From 6095ef105d0156ec9ad3a03621edf7f8df60cea4 Mon Sep 17 00:00:00 2001 From: Reid Weber Date: Thu, 29 Mar 2018 10:55:29 -0700 Subject: [PATCH 85/97] Added calendar to Expo Permissions --- types/expo/index.d.ts | 3 ++- types/expo/v24/expo-tests.tsx | 1 + types/expo/v24/index.d.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8661cac727..2cde351dbe 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1701,7 +1701,7 @@ export namespace Pedometer { */ export namespace Permissions { type PermissionType = 'remoteNotifications' | 'location' | - 'camera' | 'contacts' | 'audioRecording'; + 'camera' | 'contacts' | 'audioRecording' | 'calendar'; type PermissionStatus = 'undetermined' | 'granted' | 'denied'; type PermissionExpires = 'never'; @@ -1733,6 +1733,7 @@ export namespace Permissions { const NOTIFICATIONS: RemoteNotificationPermission; const CONTACTS: 'contacts'; const SYSTEM_BRIGHTNESS: 'systemBrightness'; + const CALENDAR: 'calendar'; } /** diff --git a/types/expo/v24/expo-tests.tsx b/types/expo/v24/expo-tests.tsx index 8749a5993c..5ea1758270 100644 --- a/types/expo/v24/expo-tests.tsx +++ b/types/expo/v24/expo-tests.tsx @@ -528,6 +528,7 @@ Permissions.CONTACTS === 'contacts'; Permissions.NOTIFICATIONS === 'remoteNotifications'; Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications'; Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness'; +Permissions.CALENDAR === 'calendar'; async () => { const result = await Permissions.askAsync(Permissions.CAMERA); diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 829e9730a7..376f885073 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -1681,7 +1681,7 @@ export namespace Pedometer { */ export namespace Permissions { type PermissionType = 'remoteNotifications' | 'location' | - 'camera' | 'contacts' | 'audioRecording'; + 'camera' | 'contacts' | 'audioRecording' | 'calendar'; type PermissionStatus = 'undetermined' | 'granted' | 'denied'; type PermissionExpires = 'never'; @@ -1713,6 +1713,7 @@ export namespace Permissions { const NOTIFICATIONS: RemoteNotificationPermission; const CONTACTS: 'contacts'; const SYSTEM_BRIGHTNESS: 'systemBrightness'; + const CALENDAR: 'calendar'; } /** From 600231c52fc6fa43e605ef19ffb20b20b56fa752 Mon Sep 17 00:00:00 2001 From: "Narcisse D. ASSOGBA" Date: Thu, 29 Mar 2018 19:03:17 +0100 Subject: [PATCH 86/97] Add "noImplicitAny" constraint and other tslint constraints --- types/sql-bricks/index.d.ts | 121 ++++++++++++++------------- types/sql-bricks/sql-bricks-tests.ts | 64 ++++++++------ types/sql-bricks/tsconfig.json | 2 +- types/sql-bricks/tslint.json | 3 - 4 files changed, 103 insertions(+), 87 deletions(-) diff --git a/types/sql-bricks/index.d.ts b/types/sql-bricks/index.d.ts index d09bfee715..ccc7e523a7 100644 --- a/types/sql-bricks/index.d.ts +++ b/types/sql-bricks/index.d.ts @@ -78,16 +78,17 @@ declare namespace SqlBricks { * Appends additional columns to an existing query. * @param columns can be passed as multiple arguments, a comma-delimited string or an array. */ - select(...columns: string[]): SelectStatement + select(...columns: Array): SelectStatement /** * Appends additional columns to an existing query. * @param columns can be passed as multiple arguments, a comma-delimited string or an array. */ - select(columns: string[]): SelectStatement - select(...params): SelectStatement + select(columns: string[] | SelectStatement[]): SelectStatement + as(alias: string): SelectStatement - distinct(...columns): SelectStatement + distinct(...columns: Array): SelectStatement + distinct(columns: string[] | SelectStatement[]): SelectStatement /** * Makes the query a SELECT ... INTO query (which creates a new table with the results of the query). @@ -102,8 +103,8 @@ declare namespace SqlBricks { */ intoTable(tbl: TableName): SelectStatement - intoTemp(tbl: TableName): SelectStatement, - intoTempTable(tbl: TableName): SelectStatement, + intoTemp(tbl: TableName): SelectStatement + intoTempTable(tbl: TableName): SelectStatement /** * Table names can be passed in as multiple string arguments, a comma-delimited string or an array. @@ -151,8 +152,8 @@ declare namespace SqlBricks { fullOuterJoin(tbl: string, onCol1: string, onCol2: string): SelectStatement fullOuterJoin(firstTbl: string, ...otherTbls: string[]): SelectStatement - on(onCriteria: OnCriteria | WhereExpression): SelectStatement, - on(onCol1: string, onCol2: string): SelectStatement, + on(onCriteria: OnCriteria | WhereExpression): SelectStatement + on(onCol1: string, onCol2: string): SelectStatement /** * Joins using USING instead of ON. @@ -178,11 +179,10 @@ declare namespace SqlBricks { naturalRightOuterJoin(tbl: string): SelectStatement naturalFullOuterJoin(tbl: string): SelectStatement - where(column: string, value?: string): SelectStatement - where(whereExpr: WhereExpression): SelectStatement - where(...options): SelectStatement + where(column?: string | null, value?: any): SelectStatement + where(...whereExpr: WhereExpression[]): SelectStatement - and(...options): SelectStatement + and(...options: any[]): SelectStatement /** * Sets or extends the GROUP BY columns. @@ -219,28 +219,34 @@ declare namespace SqlBricks { interface InsertStatement extends Statement { into(tbl: TableName, ...columns: any[]): InsertStatement intoTable(tbl: TableName, ...columns: any[]): InsertStatement - select(...params): SelectStatement, - values(...values): InsertStatement + select(...columns: Array): SelectStatement + select(columns: string[] | SelectStatement[]): SelectStatement + values(...values: any[]): InsertStatement } /** * An UPDATE statement */ interface UpdateStatement extends Statement { - values(...values): UpdateStatement - set(...values): UpdateStatement, - where(...options): UpdateStatement, - and(...options): UpdateStatement, + values(...values: any[]): UpdateStatement + set(...values: any[]): UpdateStatement + where(column?: string | null, value?: any): SelectStatement + where(...whereExpr: WhereExpression[]): SelectStatement + and(column?: string | null, value?: any): SelectStatement + and(...whereExpr: WhereExpression[]): SelectStatement } /** * A DELETE statement */ interface DeleteStatement extends Statement { - from(...tbls: string[]): DeleteStatement, - using(...columnList): DeleteStatement, - where(...options): DeleteStatement, - and(...options): DeleteStatement, + from(...tbls: string[]): DeleteStatement + using(...columnList: string[]): SelectStatement + using(columnList: string[]): SelectStatement + where(column?: string | null, value?: any): SelectStatement + where(...whereExpr: WhereExpression[]): SelectStatement + and(column?: string | null, value?: any): SelectStatement + and(...whereExpr: WhereExpression[]): SelectStatement } } @@ -251,7 +257,7 @@ interface SqlBricksFn { * anywhere that a column is expected (the left-hand side of WHERE criteria and many other SQL Bricks APIs) * @param value value to be wraped */ - val(value): any + val(value: any): any /** * Returns a new INSERT statement. It can be used with or without the new operator. @@ -263,7 +269,7 @@ interface SqlBricksFn { * insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'}); * // INSERT INTO person (first_name, last_name) VALUES ('Fred', 'Flintstone') */ - insert(tbl?: string, ...values): SqlBricks.InsertStatement + insert(tbl?: string, ...values: any[]): SqlBricks.InsertStatement /** * Returns a new INSERT statement. It can be used with or without the new operator. @@ -275,23 +281,22 @@ interface SqlBricksFn { * insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'}); * // INSERT INTO person (first_name, last_name) VALUES ('Fred', 'Flintstone') */ - insertInto(tbl?: string, ...values): SqlBricks.InsertStatement + insertInto(tbl?: string, ...values: any[]): SqlBricks.InsertStatement /** * Returns a new select statement, seeded with a set of columns. It can be used with or without the new keyword. * @param columns it can be passed in here (or appended later via sel.select() or sel.distinct()) via multiple arguments * or a comma-delimited string or an array. If no columns are specified, toString() will default to SELECT *. */ - select(...columns: string[]): SqlBricks.SelectStatement + select(...columns: Array): SqlBricks.SelectStatement select(columns: string[] | SqlBricks.SelectStatement[]): SqlBricks.SelectStatement - select(...params): SqlBricks.SelectStatement /** * Returns a new UPDATE statement. It can be used with or without the new operator. * @param tbl table name * @param values */ - update(tbl: string, ...values): SqlBricks.UpdateStatement + update(tbl: string, ...values: any[]): SqlBricks.UpdateStatement /** * Returns a new DELETE statement. It can be used with or without the new operator. @@ -322,7 +327,7 @@ interface SqlBricksFn { * Sets a user-supplied function to automatically generate the .on() criteria for joins whenever it is not supplied explicitly. * @param func */ - joinCriteria(func?: (...args) => SqlBricks.OnCriteria): any + joinCriteria(func?: (...args: any[]) => SqlBricks.OnCriteria): any _extension(): any prop: number @@ -357,47 +362,47 @@ interface SqlBricksFn { * @param value1 * @param value2 */ - between(column: string, value1, value2): SqlBricks.WhereExpression + between(column: string, value1: any, value2: any): SqlBricks.WhereExpression isNull(column: string): SqlBricks.WhereExpression isNotNull(column: string): SqlBricks.WhereExpression - like(column: string, value, escapeStr?: string): SqlBricks.WhereExpression - exists(stmt): SqlBricks.WhereExpression + like(column: string, value: any, escapeStr?: string): SqlBricks.WhereExpression + exists(stmt: any): SqlBricks.WhereExpression in(column: string, stmt: SqlBricks.SelectStatement): SqlBricks.WhereExpression - in(column: string, ...values): SqlBricks.WhereExpression + in(column: string, ...values: any[]): SqlBricks.WhereExpression /** * Generates the appropriate relational operator (=, <>, <, <=, > or >=). * @param column column name or query result * @param value column value */ - eq(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - equal(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - notEq(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lt(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lte(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gt(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gte(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + eq(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + equal(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + notEq(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lt(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lte(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gt(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gte(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary - eqAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - notEqAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - ltAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lteAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gtAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gteAll(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + eqAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + notEqAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + ltAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lteAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gtAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gteAll(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary - eqAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - notEqAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - ltAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lteAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gtAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gteAny(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + eqAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + notEqAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + ltAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lteAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gtAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gteAny(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary - eqSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - notEqSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - ltSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - lteSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gtSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary - gteSome(column: string | SqlBricks.SelectStatement, value?): SqlBricks.WhereBinary + eqSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + notEqSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + ltSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + lteSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gtSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary + gteSome(column: string | SqlBricks.SelectStatement, value?: any): SqlBricks.WhereBinary } declare const SqlBricks: SqlBricksFn diff --git a/types/sql-bricks/sql-bricks-tests.ts b/types/sql-bricks/sql-bricks-tests.ts index 94014d913d..8a5c7de5d7 100644 --- a/types/sql-bricks/sql-bricks-tests.ts +++ b/types/sql-bricks/sql-bricks-tests.ts @@ -6,22 +6,38 @@ import * as sql from "sql-bricks"; // tslint:disable-next-line:prefer-const -let assert; +let assert: any; const select = sql.select; -const insertInto = sql.insertInto, insert = sql.insert, - update = sql.update, del = sql.delete; -const and = sql.and, or = sql.or, like = sql.like, not = sql.not, $in = sql.in, - isNull = sql.isNull, isNotNull = sql.isNotNull, equal = sql.equal, eq = sql.eq, - notEq = sql.notEq, lt = sql.lt, lte = sql.lte, gt = sql.gt, gte = sql.gte, - between = sql.between, exists = sql.exists, eqAny = sql.eqAny, notEqAny = sql.notEqAny; +const insertInto = sql.insertInto; +const insert = sql.insert; +const update = sql.update; +const del = sql.delete; +const and = sql.and; +const or = sql.or; +const like = sql.like; +const not = sql.not; +const $in = sql.in; +const isNull = sql.isNull; +const isNotNull = sql.isNotNull; +const equal = sql.equal; +const eq = sql.eq; +const notEq = sql.notEq; +const lt = sql.lt; +const lte = sql.lte; +const gt = sql.gt; +const gte = sql.gte; +const between = sql.between; +const exists = sql.exists; +const eqAny = sql.eqAny; +const notEqAny = sql.notEqAny; const alias_expansions = { usr: 'user', psn: 'person', addr: 'address' }; -const table_to_alias = alias_expansions; +const table_to_alias: sql.OnCriteria = alias_expansions; sql.aliasExpansions(alias_expansions); -sql.joinCriteria(function(left_tbl, left_alias, right_tbl, right_alias) { - const criteria = {}; - criteria[left_alias + '.' + table_to_alias[right_tbl] + '_fk'] = right_alias + '.pk'; +sql.joinCriteria(function(left_tbl: string, left_alias: string, right_tbl: string, right_alias: string) { + const criteria: sql.OnCriteria = {}; + criteria[`${left_alias}.${table_to_alias[right_tbl]}_fk`] = right_alias + '.pk'; return criteria; }); @@ -160,7 +176,7 @@ describe('SQL Bricks', function() { }); it('should support user-supplied conversions', function() { const orig_bool = sql.conversions.Boolean; - sql.conversions.Boolean = function(bool) { return bool ? '1' : '0'; }; + sql.conversions.Boolean = function(bool: boolean) { return bool ? '1' : '0'; }; const str = del('user').where('active', false).toString(); sql.conversions.Boolean = orig_bool; assert.equal(str, 'DELETE FROM "user" WHERE active = 0'); @@ -184,7 +200,7 @@ describe('SQL Bricks', function() { select().from('test').join('psn').join('usr').toString(); sql.joinCriteria(orig); - assert(left_tbls.indexOf('person') > -1 && left_tbls.indexOf('psn') === -1, 'left_tbl is not expanded: [' + left_tbls.join(',') + ']'); + assert(left_tbls.indexOf('person') > -1 && left_tbls.indexOf('psn') === -1, `left_tbl is not expanded: [ ${left_tbls.join(',')} ]`); }); it('should support aliases', function() { @@ -727,9 +743,9 @@ describe('SQL Bricks', function() { it('should support changing the default array handling', function() { const proto = sql.select.prototype; const orig = proto.where; - proto.where = function(criteria) { + proto.where = function(criteria: sql.OnCriteria) { // return orig.call(this, arraysToOrs(criteria)); - return orig.call() + return orig.call(); }; check(select().from('table').where({ this: 'test', that: ['test1', 'test2'] }), @@ -738,15 +754,13 @@ describe('SQL Bricks', function() { proto.where = orig; }); - function arraysToOrs(criteria) { + function arraysToOrs(criteria: sql.WhereObject) { const where = and(); for (const col in criteria) { const val = criteria[col]; - let expr; - if (Array.isArray(val)) - expr = or(val.map(function(val) { return eq(col, val); })); - else - expr = eq(col, val); + let expr: sql.WhereExpression; + expr = Array.isArray(val) ? or(val.map(function(val) { return eq(col, val); })) + : expr = eq(col, val); where.expressions.push(expr); } return where; @@ -929,7 +943,7 @@ describe('SQL Bricks', function() { }); }); -function describe(...param) { } -function it(...param) { } -function check(...param) { } -function checkParams(...param) { } +function describe(...param: any[]) { } +function it(...param: any[]) { } +function check(...param: any[]) { } +function checkParams(...param: any[]) { } diff --git a/types/sql-bricks/tsconfig.json b/types/sql-bricks/tsconfig.json index 3c5db90a4f..4b321fc911 100644 --- a/types/sql-bricks/tsconfig.json +++ b/types/sql-bricks/tsconfig.json @@ -4,7 +4,7 @@ "lib": [ "es6" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, diff --git a/types/sql-bricks/tslint.json b/types/sql-bricks/tslint.json index 1e7260a20f..4ddaadda1f 100644 --- a/types/sql-bricks/tslint.json +++ b/types/sql-bricks/tslint.json @@ -2,9 +2,6 @@ "extends": "dtslint/dt.json", "rules": { "only-arrow-functions": false, - "prefer-template": false, - "prefer-conditional-expression": false, - "one-variable-per-declaration": false, "semicolon":false } } \ No newline at end of file From 95cb5756a15d82ba8c729c3582a63588934deec7 Mon Sep 17 00:00:00 2001 From: Reid Weber Date: Thu, 29 Mar 2018 12:34:16 -0700 Subject: [PATCH 87/97] Removed v24 changes --- types/expo/v24/expo-tests.tsx | 1 - types/expo/v24/index.d.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/types/expo/v24/expo-tests.tsx b/types/expo/v24/expo-tests.tsx index 5ea1758270..8749a5993c 100644 --- a/types/expo/v24/expo-tests.tsx +++ b/types/expo/v24/expo-tests.tsx @@ -528,7 +528,6 @@ Permissions.CONTACTS === 'contacts'; Permissions.NOTIFICATIONS === 'remoteNotifications'; Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications'; Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness'; -Permissions.CALENDAR === 'calendar'; async () => { const result = await Permissions.askAsync(Permissions.CAMERA); diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 376f885073..829e9730a7 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -1681,7 +1681,7 @@ export namespace Pedometer { */ export namespace Permissions { type PermissionType = 'remoteNotifications' | 'location' | - 'camera' | 'contacts' | 'audioRecording' | 'calendar'; + 'camera' | 'contacts' | 'audioRecording'; type PermissionStatus = 'undetermined' | 'granted' | 'denied'; type PermissionExpires = 'never'; @@ -1713,7 +1713,6 @@ export namespace Permissions { const NOTIFICATIONS: RemoteNotificationPermission; const CONTACTS: 'contacts'; const SYSTEM_BRIGHTNESS: 'systemBrightness'; - const CALENDAR: 'calendar'; } /** From e2d2716e8ca75ef7d17bd1cddc355ab666d47849 Mon Sep 17 00:00:00 2001 From: Feirell Date: Thu, 29 Mar 2018 23:07:15 +0200 Subject: [PATCH 88/97] [three] added test for PlaneHelper --- types/three/test/webgl/webgl_helpers.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/types/three/test/webgl/webgl_helpers.ts b/types/three/test/webgl/webgl_helpers.ts index 6b955968f4..9033ed5279 100644 --- a/types/three/test/webgl/webgl_helpers.ts +++ b/types/three/test/webgl/webgl_helpers.ts @@ -1,3 +1,4 @@ + // https://github.com/mrdoob/three.js/blob/master/examples/webgl_helpers.html () => { @@ -27,10 +28,14 @@ scene.add(new THREE.PointLightHelper(light, 5)); - var helper = new THREE.GridHelper(200, 10); - helper.setColors(0x0000ff, 0x808080); - helper.position.y = - 150; - scene.add(helper); + var gridHelper = new THREE.GridHelper(200, 10); + gridHelper.setColors(0x0000ff, 0x808080); + gridHelper.position.y = - 150; + scene.add(gridHelper); + + var plane = new THREE.Plane(new THREE.Vector3(1, 1, 0.2), 3); + var planeHelper = new THREE.PlaneHelper(plane, 1, 0xffff00); + scene.add(planeHelper); var loader = new THREE.JSONLoader(); loader.load('obj/leeperrysmith/LeePerrySmith.js', function (geometry, materials) { From cee5dc61ed0e84db7df24130c77b37793b43f338 Mon Sep 17 00:00:00 2001 From: "Matt R. Wilson" Date: Thu, 29 Mar 2018 15:48:36 -0600 Subject: [PATCH 89/97] [@types/newrelic] Add startSegment. --- types/newrelic/index.d.ts | 22 +++++++++++++++++++++- types/newrelic/newrelic-tests.ts | 6 ++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/types/newrelic/index.d.ts b/types/newrelic/index.d.ts index 83b6e409dc..f6c54f5a4b 100644 --- a/types/newrelic/index.d.ts +++ b/types/newrelic/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for newrelic 2.7 +// Type definitions for newrelic 3.3 // Project: http://github.com/newrelic/node-newrelic // Definitions by: Matt R. Wilson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -147,6 +147,23 @@ declare namespace newrelic { */ getBrowserTimingHeader(): string; + /** + * Instrument a particular method to improve visibility into a transaction, + * or optionally turn it into a metric. + * + * The name defines a name for the segment. This name will be visible in transaction traces and + * as a new metric in the New Relic UI. + * The record flag defines whether the segment should be recorded as a metric. + * The handler is the function you want to track as a segment. + * The optional callback is a function passed to the handler to fire after its work is done. + * + * The agent begins timing the segment when startSegment is called. + * The segment is ended when either the handler finishes executing, or callback is fired, if it is provided. + * If a promise is returned from the handler, the segment's ending will be tied to that promise resolving or rejecting. + */ + startSegment>(name: string, record: boolean, handler: T): T; + startSegment any>(name: string, record: boolean, handler: (cb?: C) => T, callback?: C): T; + /** * Instrument a particular callback to improve visibility into a transaction. * @@ -157,6 +174,9 @@ declare namespace newrelic { * * The agent begins timing the segment when createTracer is called, and ends the segment when the callback * defined by the callback argument finishes executing. + * + * @deprecated + * This method has been deprecated in favor of newrelic.startSegment() */ createTracer any>(name: string, handle: T): T; diff --git a/types/newrelic/newrelic-tests.ts b/types/newrelic/newrelic-tests.ts index 73cd53cc78..3f99152c66 100644 --- a/types/newrelic/newrelic-tests.ts +++ b/types/newrelic/newrelic-tests.ts @@ -29,6 +29,12 @@ newrelic.addIgnoringRule(/^[0-9]+$/); // $ExpectType void newrelic.getBrowserTimingHeader(); // $ExpectType string +newrelic.startSegment('foo', false, () => "bar"); // $ExpectType string +newrelic.startSegment('foo', false, () => "bar", () => "baz"); // $ExpectType string +newrelic.startSegment('foo', false, Promise.all([5, 7])).then(([a, b]: [number, number]) => { + console.log(a, b); +}); + const wrappedFn = newrelic.createTracer("foo", (x: number) => { return x * x; }); From 646191d20b2f1dc6949752d5d8d1ba67e8e5bf94 Mon Sep 17 00:00:00 2001 From: "Narcisse D. ASSOGBA" Date: Thu, 29 Mar 2018 23:04:14 +0100 Subject: [PATCH 90/97] Use import sql = require("sql-bricks") syntax for the module import --- types/sql-bricks/sql-bricks-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/sql-bricks/sql-bricks-tests.ts b/types/sql-bricks/sql-bricks-tests.ts index 8a5c7de5d7..effc01eca3 100644 --- a/types/sql-bricks/sql-bricks-tests.ts +++ b/types/sql-bricks/sql-bricks-tests.ts @@ -3,7 +3,7 @@ // taked the 03/29/2018. Some dtslint rules has been deabled to be // close as possible of the original js file. -import * as sql from "sql-bricks"; +import sql = require("sql-bricks"); // tslint:disable-next-line:prefer-const let assert: any; From 7c35bcd4228ca48362b5fcaedf49ec9fd07800a6 Mon Sep 17 00:00:00 2001 From: doomsower Date: Fri, 30 Mar 2018 11:18:04 +0300 Subject: [PATCH 91/97] Stronger params for screen --- types/react-navigation/index.d.ts | 91 ++++++++++--------- .../react-navigation-tests.tsx | 7 +- 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 241232227e..88d510134d 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -46,10 +46,10 @@ export interface HeaderProps extends NavigationSceneRendererProps { router: NavigationRouter< NavigationState, NavigationStackScreenOptions - >; + >; getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< NavigationStackScreenOptions - >; + >; style: StyleProp; } @@ -147,9 +147,9 @@ export interface NavigationRouter { export type NavigationScreenOption = T | (( - navigation: NavigationScreenProp, - config: T - ) => T); + navigation: NavigationScreenProp, + config: T +) => T); export interface NavigationScreenDetails { options: T; @@ -169,26 +169,27 @@ export interface NavigationScreenConfigProps { export type NavigationScreenConfig = Options | ((navigationOptionsContainer: NavigationScreenConfigProps & { - navigationOptions: NavigationScreenProp, - }) => Options); + navigationOptions: NavigationScreenProp, +}) => Options); export type NavigationComponent = - NavigationScreenComponent + NavigationScreenComponent | NavigationNavigator; export type NavigationScreenComponent< - Options = {}, - Props = {} -> = React.ComponentType & Props> & -{ navigationOptions?: NavigationScreenConfig }; + Params = NavigationParams, + Options = {}, + Props = {} + > = React.ComponentType & Props> & + { navigationOptions?: NavigationScreenConfig }; export type NavigationNavigator< - State = NavigationState, - Options = {}, - Props = {} -> = React.ComponentType & Props> & { - router: NavigationRouter, - navigationOptions?: NavigationScreenConfig, + State = NavigationState, + Options = {}, + Props = {} + > = React.ComponentType & Props> & { + router: NavigationRouter, + navigationOptions?: NavigationScreenConfig, }; export interface NavigationParams { @@ -332,9 +333,9 @@ export type NavigationRouteConfig = NavigationComponent | ({ } & NavigationScreenRouteConfig); export type NavigationScreenRouteConfig = NavigationComponent | { - screen: NavigationComponent, + screen: NavigationComponent, } | { - getScreen: () => NavigationComponent, + getScreen: () => NavigationComponent, }; export interface NavigationPathsConfig { @@ -351,22 +352,22 @@ export interface NavigationTabRouterConfig { backBehavior?: 'none' | 'initialRoute'; // defaults `initialRoute` } export interface TabScene { - route: NavigationRoute; - focused: boolean; - index: number; - tintColor?: string; + route: NavigationRoute; + focused: boolean; + index: number; + tintColor?: string; } export interface NavigationTabScreenOptions extends NavigationScreenOptions { tabBarIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); tabBarLabel?: string | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | string | null)); tabBarVisible?: boolean; tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string }; @@ -380,13 +381,13 @@ export interface NavigationDrawerScreenOptions extends NavigationScreenOptions { drawerIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); drawerLabel?: string | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); } @@ -402,11 +403,11 @@ export interface NavigationProp { } export type EventType = -| 'willFocus' -| 'didFocus' -| 'willBlur' -| 'didBlur' -| 'action'; + | 'willFocus' + | 'didFocus' + | 'willBlur' + | 'didBlur' + | 'action'; export interface NavigationEventPayload { type: EventType; @@ -429,17 +430,17 @@ export interface NavigationScreenProp { goBack: (routeKey?: string | null) => boolean; navigate(options: { routeName: string; - params?: P; + params?: NavigationParams; action?: NavigationAction; key?: string; }): boolean; navigate( routeNameOrOptions: string, - params?: P, + params?: NavigationParams, action?: NavigationAction, ): boolean; getParam: (param: T, fallback?: P[T]) => P[T]; - setParams: (newParams: NavigationParams) => boolean; + setParams: (newParams: P) => boolean; addListener: ( eventName: string, callback: NavigationEventCallback @@ -565,9 +566,9 @@ export interface LayoutEvent { } export type NavigatorType = -| 'react-navigation/STACK' -| 'react-navigation/TABS' -| 'react-navigation/DRAWER'; + | 'react-navigation/STACK' + | 'react-navigation/TABS' + | 'react-navigation/DRAWER'; export function addNavigationHelpers( navigation: { @@ -592,7 +593,7 @@ export interface NavigationContainerProps { export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps -> { + > { router: NavigationRouter; screenProps: { [key: string]: any }; navigationOptions: any; @@ -657,7 +658,7 @@ export function DrawerNavigator( * Tab Navigator */ -// From views/TabView/TabView.js + // From views/TabView/TabView.js export interface TabViewConfig { tabBarComponent?: React.ReactType; tabBarPosition?: 'top' | 'bottom'; @@ -806,7 +807,7 @@ export interface TransitionerState { export class Transitioner extends React.Component< TransitionerProps, TransitionerState -> { } + > { } /** * Tab Router @@ -859,10 +860,10 @@ export function createNavigationContainer( * BEGIN CUSTOM CONVENIENCE INTERFACES */ -export interface NavigationScreenProps { - navigation: NavigationScreenProp>; +export interface NavigationScreenProps { + navigation: NavigationScreenProp, Params>; screenProps?: { [key: string]: any }; - navigationOptions?: NavigationScreenConfig; + navigationOptions?: NavigationScreenConfig; } /** diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index d70bca3ecd..7e956d2c1a 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -134,7 +134,12 @@ export const AppNavigator = StackNavigator( }, ); -const StatelessScreen: NavigationScreenComponent = () => ; +interface StatelessScreenParams { + testID: string; +} + +const StatelessScreen: NavigationScreenComponent = (props) => + ; StatelessScreen.navigationOptions = { title: 'Stateless' }; From 5575ff4dc1776255b373258b777489e455993475 Mon Sep 17 00:00:00 2001 From: doomsower Date: Fri, 30 Mar 2018 11:34:29 +0300 Subject: [PATCH 92/97] Fix whitespaces --- types/react-navigation/index.d.ts | 78 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 88d510134d..f86a47ccf5 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -46,10 +46,10 @@ export interface HeaderProps extends NavigationSceneRendererProps { router: NavigationRouter< NavigationState, NavigationStackScreenOptions - >; + >; getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< NavigationStackScreenOptions - >; + >; style: StyleProp; } @@ -147,9 +147,9 @@ export interface NavigationRouter { export type NavigationScreenOption = T | (( - navigation: NavigationScreenProp, - config: T -) => T); + navigation: NavigationScreenProp, + config: T + ) => T); export interface NavigationScreenDetails { options: T; @@ -169,27 +169,27 @@ export interface NavigationScreenConfigProps { export type NavigationScreenConfig = Options | ((navigationOptionsContainer: NavigationScreenConfigProps & { - navigationOptions: NavigationScreenProp, -}) => Options); + navigationOptions: NavigationScreenProp, + }) => Options); export type NavigationComponent = NavigationScreenComponent | NavigationNavigator; export type NavigationScreenComponent< - Params = NavigationParams, - Options = {}, - Props = {} - > = React.ComponentType & Props> & - { navigationOptions?: NavigationScreenConfig }; + Params = NavigationParams, + Options = {}, + Props = {} +> = React.ComponentType & Props> & +{ navigationOptions?: NavigationScreenConfig }; export type NavigationNavigator< - State = NavigationState, - Options = {}, - Props = {} - > = React.ComponentType & Props> & { - router: NavigationRouter, - navigationOptions?: NavigationScreenConfig, + State = NavigationState, + Options = {}, + Props = {} +> = React.ComponentType & Props> & { + router: NavigationRouter, + navigationOptions?: NavigationScreenConfig, }; export interface NavigationParams { @@ -333,9 +333,9 @@ export type NavigationRouteConfig = NavigationComponent | ({ } & NavigationScreenRouteConfig); export type NavigationScreenRouteConfig = NavigationComponent | { - screen: NavigationComponent, + screen: NavigationComponent, } | { - getScreen: () => NavigationComponent, + getScreen: () => NavigationComponent, }; export interface NavigationPathsConfig { @@ -352,22 +352,22 @@ export interface NavigationTabRouterConfig { backBehavior?: 'none' | 'initialRoute'; // defaults `initialRoute` } export interface TabScene { - route: NavigationRoute; - focused: boolean; - index: number; - tintColor?: string; + route: NavigationRoute; + focused: boolean; + index: number; + tintColor?: string; } export interface NavigationTabScreenOptions extends NavigationScreenOptions { tabBarIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); tabBarLabel?: string | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | string | null)); tabBarVisible?: boolean; tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string }; @@ -381,13 +381,13 @@ export interface NavigationDrawerScreenOptions extends NavigationScreenOptions { drawerIcon?: React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); drawerLabel?: string | React.ReactElement | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any + any > | null)); } @@ -403,11 +403,11 @@ export interface NavigationProp { } export type EventType = - | 'willFocus' - | 'didFocus' - | 'willBlur' - | 'didBlur' - | 'action'; +| 'willFocus' +| 'didFocus' +| 'willBlur' +| 'didBlur' +| 'action'; export interface NavigationEventPayload { type: EventType; @@ -566,9 +566,9 @@ export interface LayoutEvent { } export type NavigatorType = - | 'react-navigation/STACK' - | 'react-navigation/TABS' - | 'react-navigation/DRAWER'; +| 'react-navigation/STACK' +| 'react-navigation/TABS' +| 'react-navigation/DRAWER'; export function addNavigationHelpers( navigation: { @@ -593,7 +593,7 @@ export interface NavigationContainerProps { export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps - > { +> { router: NavigationRouter; screenProps: { [key: string]: any }; navigationOptions: any; @@ -658,7 +658,7 @@ export function DrawerNavigator( * Tab Navigator */ - // From views/TabView/TabView.js +// From views/TabView/TabView.js export interface TabViewConfig { tabBarComponent?: React.ReactType; tabBarPosition?: 'top' | 'bottom'; @@ -807,7 +807,7 @@ export interface TransitionerState { export class Transitioner extends React.Component< TransitionerProps, TransitionerState - > { } +> { } /** * Tab Router From 8444f10ce33c5f982349a2a4dbfa425d251e10d2 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Fri, 30 Mar 2018 17:36:01 +0900 Subject: [PATCH 93/97] export as namespace jsyaml --- types/js-yaml/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/js-yaml/index.d.ts b/types/js-yaml/index.d.ts index 5cd852ab3f..da2d2a36c8 100644 --- a/types/js-yaml/index.d.ts +++ b/types/js-yaml/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 +export as namespace jsyaml; + export type DocumentLoadResult = object | undefined; export function safeLoad(str: string, opts?: LoadOptions): DocumentLoadResult; From 23e98c3d656f73d5b7b4f7ef6b3714d685c56a72 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 30 Mar 2018 07:29:20 -0700 Subject: [PATCH 94/97] socket.io: Expose as a global for backwards-compatibility (#24619) --- types/socket.io/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/socket.io/index.d.ts b/types/socket.io/index.d.ts index 1583eac66b..d63effe544 100644 --- a/types/socket.io/index.d.ts +++ b/types/socket.io/index.d.ts @@ -7,6 +7,8 @@ declare const SocketIO: SocketIOStatic; export = SocketIO; +/** @deprecated Available as a global for backwards-compatibility. */ +export as namespace SocketIO; interface SocketIOStatic { /** From 1ed52bceabec52ee4ebcf6fed9bf2e6a1bb1f4c3 Mon Sep 17 00:00:00 2001 From: Andrew Goodale Date: Fri, 30 Mar 2018 11:10:33 -0400 Subject: [PATCH 95/97] Fix declaration of `onMoveShouldSetResponderCapture` --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 2a08edcdb1..b881476782 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1526,7 +1526,7 @@ export interface GestureResponderHandlers { * So if a parent View wants to prevent the child from becoming responder on a touch start, * it should have a onStartShouldSetResponderCapture handler which returns true. */ - onMoveShouldSetResponderCapture?: () => void; + onMoveShouldSetResponderCapture?: (event: GestureResponderEvent) => boolean; } // @see https://facebook.github.io/react-native/docs/view.html#style From 9c3030d32d6e9b9a5338dade566ba2217a244bb1 Mon Sep 17 00:00:00 2001 From: jewbre Date: Fri, 30 Mar 2018 19:36:32 +0200 Subject: [PATCH 96/97] types for named regexp group --- types/named-regexp-groups/index.d.ts | 38 +++++++++++++++++++ .../named-regexp-groups-tests.ts | 19 ++++++++++ types/named-regexp-groups/tsconfig.json | 23 +++++++++++ types/named-regexp-groups/tslint.json | 1 + 4 files changed, 81 insertions(+) create mode 100644 types/named-regexp-groups/index.d.ts create mode 100644 types/named-regexp-groups/named-regexp-groups-tests.ts create mode 100644 types/named-regexp-groups/tsconfig.json create mode 100644 types/named-regexp-groups/tslint.json diff --git a/types/named-regexp-groups/index.d.ts b/types/named-regexp-groups/index.d.ts new file mode 100644 index 0000000000..19426c352e --- /dev/null +++ b/types/named-regexp-groups/index.d.ts @@ -0,0 +1,38 @@ +// Type definitions for named-regexp-groups 1.0 +// Project: https://github.com/commenthol/named-regexp-groups/ +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +interface NamedRegExpExecArray extends RegExpExecArray { + groups: { [propName: string]: string }; +} + +declare class NamedRegExp { + constructor(pattern?: string | RegExp, flags?: string); + + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): NamedRegExpExecArray | null; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + // Non-standard extensions + toString(): string; + + [Symbol.replace](str: string, replacement: string | ((match: string, ...capturedGroups: string[]) => string)): string; + + [Symbol.match](str: string): NamedRegExpExecArray; + + [Symbol.split](str: string): string[]; + + [Symbol.search](str: string): number; +} + +export = NamedRegExp; diff --git a/types/named-regexp-groups/named-regexp-groups-tests.ts b/types/named-regexp-groups/named-regexp-groups-tests.ts new file mode 100644 index 0000000000..cff4cc057e --- /dev/null +++ b/types/named-regexp-groups/named-regexp-groups-tests.ts @@ -0,0 +1,19 @@ +import NamedRegExp = require("named-regexp-groups"); + +// $ExpectType NamedRegExp +new NamedRegExp('aaa', 'gi'); + +// $ExpectType NamedRegExp +new NamedRegExp(/aaa/gi); + +// $ExpectType NamedRegExp +new NamedRegExp(); + +// $ExpectError +new NamedRegExp(1); + +// $ExpectError +new NamedRegExp({}); + +// $ExpectError +new NamedRegExp([]); diff --git a/types/named-regexp-groups/tsconfig.json b/types/named-regexp-groups/tsconfig.json new file mode 100644 index 0000000000..9ce09a5d74 --- /dev/null +++ b/types/named-regexp-groups/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "named-regexp-groups-tests.ts" + ] +} diff --git a/types/named-regexp-groups/tslint.json b/types/named-regexp-groups/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/named-regexp-groups/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 635dd53a9dba92ccc457922293321d4e114f50e6 Mon Sep 17 00:00:00 2001 From: jewbre Date: Fri, 30 Mar 2018 21:19:44 +0200 Subject: [PATCH 97/97] types for amp 0.3 --- types/amp/amp-tests.ts | 44 +++++++++++++++++++++++++++++++++++++++++ types/amp/index.d.ts | 19 ++++++++++++++++++ types/amp/tsconfig.json | 23 +++++++++++++++++++++ types/amp/tslint.json | 1 + 4 files changed, 87 insertions(+) create mode 100644 types/amp/amp-tests.ts create mode 100644 types/amp/index.d.ts create mode 100644 types/amp/tsconfig.json create mode 100644 types/amp/tslint.json diff --git a/types/amp/amp-tests.ts b/types/amp/amp-tests.ts new file mode 100644 index 0000000000..1e17bc8507 --- /dev/null +++ b/types/amp/amp-tests.ts @@ -0,0 +1,44 @@ +import { decode, encode, Stream } from 'amp'; + +// $ExpectType Buffer[] +decode(new Buffer('something')); + +// $ExpectType Buffer +encode([new Buffer('something'), new Buffer('something')]); + +// $ExpectError +decode(''); + +// $ExpectError +decode(1); + +// $ExpectError +decode(); + +// $ExpectError +encode(''); + +// $ExpectError +encode(1); + +// $ExpectError +encode(); + +// $ExpectType Stream +new Stream({}); + +// $ExpectType Stream +new Stream({ + highWaterMark: 1, + decodeStrings: true, + objectMode: true, + destroy: (error?: Error) => { + return 'handle error'; + }, + final: (callback: (error?: Error) => void) => { + // do nothing + } +}); + +// $ExpectError +new Stream({somethingNoneExisting: true}); diff --git a/types/amp/index.d.ts b/types/amp/index.d.ts new file mode 100644 index 0000000000..99b9fc7f45 --- /dev/null +++ b/types/amp/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for amp 0.3 +// Project: https://github.com/visionmedia/node-amp +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import * as stream from 'stream'; + +export function decode(buf: Buffer): Buffer[]; + +export function encode(args: Buffer[]): Buffer; + +export class Stream extends stream.Writable { + constructor(opts: stream.WritableOptions); + + _write(chunk: any, encoding: string, fn: () => void): void; +} diff --git a/types/amp/tsconfig.json b/types/amp/tsconfig.json new file mode 100644 index 0000000000..4bb6a171ad --- /dev/null +++ b/types/amp/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "amp-tests.ts" + ] +} diff --git a/types/amp/tslint.json b/types/amp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }