diff --git a/notNeededPackages.json b/notNeededPackages.json index 5c649d2368..cbfcc651a1 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1272,6 +1272,12 @@ "sourceRepoURL": "https://github.com/router5/router5", "asOfVersion": "5.0.0" }, + { + "libraryName": "rrule", + "typingsPackageName": "rrule", + "sourceRepoURL": "https://github.com/jakubroztocil/rrule", + "asOfVersion": "2.2.9" + }, { "libraryName": "rvo2", "typingsPackageName": "rvo2", diff --git a/types/actions-on-google/assistant-app.d.ts b/types/actions-on-google/assistant-app.d.ts index d835915259..76a206122c 100644 --- a/types/actions-on-google/assistant-app.d.ts +++ b/types/actions-on-google/assistant-app.d.ts @@ -1,6 +1,7 @@ import * as express from 'express'; -import { BasicCard, Carousel, ImageDisplays, List, OptionItem, RichResponse } from './response-builder'; +import { BasicCard, BrowseCarousel, BrowseItem, Carousel, ImageDisplays, List, MediaObject, + MediaResponse, MediaValues, OptionItem, RichResponse, SimpleResponse } from './response-builder'; import { ActionPaymentTransactionConfig, Cart, GooglePaymentTransactionConfig, LineItem, Location, Order, OrderUpdate, TransactionDecision, TransactionValues } from './transactions'; @@ -30,6 +31,8 @@ export enum StandardIntents { DELIVERY_ADDRESS, /** App fires TRANSACTION_DECISION intent when action asks for transaction decision. */ TRANSACTION_DECISION, + /** App fires PLACE intent when action asks for place. */ + PLACE, /** App fires CONFIRMATION intent when requesting affirmation from user. */ CONFIRMATION, /** App fires DATETIME intent when requesting date/time from user. */ @@ -45,7 +48,11 @@ export enum StandardIntents { /** App fires REGISTER_UPDATE intent when requesting user to register for proactive updates. */ REGISTER_UPDATE, /** App receives CONFIGURE_UPDATES intent to indicate a REGISTER_UPDATE intent should be sent. */ - CONFIGURE_UPDATES + CONFIGURE_UPDATES, + /** App fires LINK intent to request user to open to link. */ + LINK, + /** App receives MEDIA_STATUS intent when the MediaResponse status is updated from user. */ + MEDIA_STATUS } /** @@ -101,6 +108,10 @@ export enum BuiltInArgNames { * Transactions decision argument. */ TRANSACTION_DECISION_VALUE, + /** + * Place value argument. + */ + PLACE, /** * Confirmation argument. */ @@ -126,7 +137,11 @@ export enum BuiltInArgNames { */ NEW_SURFACE, /** Update registration value argument. */ - REGISTER_UPDATE + REGISTER_UPDATE, + /** Link request result argument. */ + LINK, + /** MediaStatus value argument. */ + MEDIA_STATUS } /** @@ -173,6 +188,14 @@ export enum SurfaceCapabilities { * The ability to output on a screen */ SCREEN_OUTPUT, + /** + * The ability to output a MediaResponse + */ + MEDIA_RESPONSE_AUDIO, + /** + * The ability to open a web URL + */ + WEB_BROWSER } /** @@ -223,6 +246,18 @@ export enum SignInStatus { ERROR } +/** + * SKU (Stock Keeping Units) types for Play Package Entitlements. + */ +export enum EntitlementSkuTypes { + /** In app purchase */ + IN_APP, + /** In app subscription */ + SUBSCRIPTION, + /** Paid app. */ + APP +} + /** * Possible update trigger time context frequencies. */ @@ -259,10 +294,15 @@ export interface UserName { familyName: string; } +export interface LocationCoordinates { + latitude: number; + longitude: number; +} + /** - * User's permissioned device location. + * Location information. */ -export interface DeviceLocation { +export interface Location { /** Coordinates: {latitude, longitude}. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ coordinates: Coordinates; /** Full, formatted street address. Requested with SupportedPermissions.DEVICE_PRECISE_LOCATION. */ @@ -273,6 +313,22 @@ export interface DeviceLocation { city: string; } +/** + * User's permissioned device location. + */ +export type DeviceLocation = Location; + +/** + * Place information. + */ +export interface Place extends Location { + /** + * Used with Places API to fetch details of a place. + * See {@link https://developers.google.com/places/web-service/place-id} + */ + placeId: string; +} + /** * Coordinates containing latitude and longitude */ @@ -309,6 +365,33 @@ export interface User { userStorage: string; } +/** + * Google Play Android App Package Entitlements. + */ +export interface PackageEntitlement { + /** Name of the Android app package. */ + packageName: string; + /** List of entitlements for a given app. */ + entitlements: Entitlement[]; +} + +/** + * A user's digital entitlement. + */ +export interface Entitlement { + /** Product SKU. Matches getSku() in Google Play InApp Billing API. */ + sku: string; + /** The type of SKU. One of EntitlementSkuType. */ + skuType: string; + /** For in app purchases/subscriptions, relevant details. */ + inAppDetails: { + /** JSON data of the in app purchase. */ + inAppPurchaseData: object; + /** Matches IN_APP_DATA_SIGNATURE from getPurchases() method in Play InApp Billing API. */ + inAppDataSignature: object; + }; +} + /** * Actions on Google Surface. */ @@ -437,6 +520,16 @@ export class AssistantApp { */ readonly Transactions: typeof TransactionValues; + /** + * Values related to supporting {@link Media}. + */ + readonly Media: typeof MediaValues; + + /** + * SKU (Stock Keeping Units) types for Play Package Entitlements. + */ + readonly EntitlementSkuTypes: typeof EntitlementSkuTypes; + /** * Possible update trigger time context frequencies. */ @@ -923,6 +1016,80 @@ export class AssistantApp { */ askForDeliveryAddress(reason: string, dialogState?: object): express.Response | null; + /** + * Asks user to provide a geo-located place, possibly using contextual information, + * like a store near the user's location or a contact's address. + * + * Developer provides custom text prompts to tailor the request handled by Google. + * + * @example + * // For DialogflowApp: + * + * // Dialogflow Actions + * const Actions = { + * WELCOME: 'input.welcome', + * PLACE: 'get.place' // Create Dialogflow Action with actions_intent_PLACE event + * }; + * + * const app = new DialogflowApp({request, response}); + * + * function handleWelcome (app) { + * const requestPrompt = 'Where do you want to get picked up?'; + * const permissionContext = 'To find a place to pick you up'; + * app.askForPlace(requestPrompt, permissionContext); + * } + * + * function handlePlace (app) { + * const place = app.getPlace(); + * if (place) { + * app.tell(`Ah, I see. You want to get picked up at ${place.address}`); + * } else { + * app.tell(`Sorry, I couldn't find where you want to get picked up`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(Actions.WELCOME, handleWelcome); + * actionMap.set(Actions.PLACE, handlePlace); + * app.handleRequest(actionMap); + * + * // For ActionsSdkApp: + * const app = new ActionsSdkApp({ request, response }); + * + * function handleWelcome (app) { + * const requestPrompt = 'Where do you want to get picked up?'; + * const permissionContext = 'To find a place to pick you up'; + * app.askForPlace(requestPrompt, permissionContext); + * } + * + * function handlePlace (app) { + * const place = app.getPlace(); + * if (place) { + * app.tell(`Ah, I see. You want to get picked up at ${place.address}`); + * } else { + * app.tell(`Sorry, I couldn't find where you want to get picked up`); + * } + * } + * + * const actionsMap = new Map(); + * actionsMap.set(app.StandardIntents.MAIN, handleWelcome); + * actionsMap.set(app.StandardIntents.PLACE, handlePlace); + * app.handleRequest(actionsMap); + * + * @param requestPrompt This is the initial response by location sub-dialog. + * For example: "Where do you want to get picked up?" + * @param permissionContext This is the context for seeking permissions. + * For example: "To find a place to pick you up" + * Prompt to user: "*To find a place to pick you up*, I just need to check your location. + * Can I get that from Google?". + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. + * @return HTTP response. + * @actionssdk + * @dialogflow + */ + askForPlace(requestPrompt: string, permissionContext: string, dialogState?: object): express.Response | null; + /** * Asks user for a confirmation. * @@ -1131,6 +1298,72 @@ export class AssistantApp { */ askToRegisterDailyUpdate(intent: string, intentArguments: IntentArgument[], dialogState?: object): express.Response | null; + /** + * Requests the user to transfer to a linked out Android app intent. Using this feature + * requires verifying the linked app in the (Actions console)[console.actions.google.com]. + * + * @example + * // For DialogflowApp: + * + * // Dialogflow Actions + * const WELCOME_ACTION = 'input.welcome'; + * const HANDLE_LINK = 'handle.link'; // Create Dialogflow Action with actions_intent_LINK event + * + * const app = new DialogflowApp({ request, response }); + * + * console.log('Request headers: ' + JSON.stringify(request.headers)); + * console.log('Request body: ' + JSON.stringify(request.body)); + * + * function requestLink (app) { + * app.askToDeepLink('Great! Looks like we can do that in the app.', 'Google', + * 'example://gizmos', 'com.example.gizmos', 'handle this for you'); + * } + * + * function handleLink (app) { + * const linkStatus = app.getLinkStatus(); + * app.tell('Okay maybe we can take care of that another time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(WELCOME_ACTION, requestLink); + * actionMap.set(HANDLE_LINK, handleLink); + * app.handleRequest(actionMap); + * + * // For ActionsSdkApp + * const app = new ActionsSdkApp({ request, response }); + * + * console.log('Request headers: ' + JSON.stringify(request.headers)); + * console.log('Request body: ' + JSON.stringify(request.body)); + * + * function requestLink (app) { + * app.askToDeepLink('Great! Looks like we can do that in the app.', 'Google', + * 'example://gizmos', 'com.example.gizmos', 'handle this for you.'); + * } + * + * function handleLink (app) { + * const linkStatus = app.getLinkStatus(); + * app.tell('Okay maybe we can take care of that another time.'); + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MAIN, requestLink); + * actionMap.set(app.StandardIntents.LINK, handleLink); + * app.handleRequest(actionMap); + * + * @param prompt A simple response to prepend to the link request. + * @param destinationName The name of the link destination. + * @param url URL of Android deep link. + * @param packageName Android app package name to which to link. + * @param reason The reason to transfer the user. This may be appended to a + * Google-specified prompt. + * @param dialogState JSON object the app uses to hold dialog state that + * will be circulated back by Assistant. Used in {@link ActionsSdkApp}. + * @return HTTP response. + * @dialogflow + * @actionssdk + */ + askToDeepLink(prompt: string | SimpleResponse | null, destinationName: string, url: string, packageName: string, reason?: string | null, dialogState?: object): express.Response | null; + /** * Gets the {@link User} object. * The user object contains information about the user, including @@ -1209,6 +1442,20 @@ export class AssistantApp { */ getLastSeen(): Date | null; + /** + * Get the the list of all digital goods that your user purchased from + * your published Android apps. To enable this feature, see the instructions + * in the (documentation)[https://developers.google.com/actions/identity/digital-goods]. + * + * @example + * const app = new DialogflowApp({request, response}); + * const packageEntitlements = app.getPackageEntitlements(); + * + * @return The list of digital goods purchased by the user in + * any verified Android app package. Null if no Package Entitlements present in the request. + */ + getPackageEntitlements(): PackageEntitlement[] | null; + /** * If granted permission to device's location in previous intent, returns device's * location (see {@link AssistantApp#askForPermissions|askForPermissions}). @@ -1273,6 +1520,15 @@ export class AssistantApp { */ getTransactionDecision(): TransactionDecision; + /** + * Gets the user provided place. Use after askForPlace. + * + * @return Place information given by the user. Null if no place given. + * @dialogflow + * @actionssdk + */ + getPlace(): Place | null; + /** * Gets confirmation decision. Use after askForConfirmation. * @@ -1304,6 +1560,31 @@ export class AssistantApp { */ getSignInStatus(): string; + /** + * Get status of MEDIA_STATUS intent. + * + * @example + * const app = new DialogflowApp({request: request, response: response}); + * + * function mediaStatusIntent (app) { + * const status = app.getMediaStatus(); + * if (status === app.Media.Status.FINISHED) { + * app.tell('Oh, I see you are done playing the media!'); + * } else { + * app.tell(`I don't understand the current media status: ${status}`); + * } + * } + * + * const actionMap = new Map(); + * actionMap.set(app.StandardIntents.MEDIA_STATUS, mediaStatusIntent); + * app.handleRequest(actionMap); + * + * @return Result of media status intent. + * @dialogflow + * @actionssdk + */ + getMediaStatus(): MediaValues.Status | null; + /** * Returns true if user device has a given surface capability. * @@ -1464,6 +1745,16 @@ export class AssistantApp { */ isUpdateRegistered(): boolean; + /** + * Returns the status of a link request. Used with + * {@link AssistantApp#askToDeepLink} + * + * @return The status code of the request to link. + * @dialogflow + * @actionssdk + */ + getLinkStatus(): number; + // --------------------------------------------------------------------------- // Response Builders // --------------------------------------------------------------------------- @@ -1500,6 +1791,13 @@ export class AssistantApp { */ buildCarousel(): Carousel; + /** + * Constructs a Browse Carousel with chainable property setters. + * + * @return Constructed Browse Carousel. + */ + buildBrowseCarousel(): BrowseCarousel; + /** * Constructs OptionItem with chainable property setters. * @@ -1512,6 +1810,15 @@ export class AssistantApp { */ buildOptionItem(key?: string, synonyms?: string | string[]): OptionItem; + /** + * Constructs BrowseItem for the Browse Carousel with chainable property setters. + * + * @param title The displayed title of the Browse Carousel card. + * @param url The URL linked to by clicking the card. + * @return Constructed BrowseItem. + */ + buildBrowseItem(title?: string, url?: string): BrowseItem; + // --------------------------------------------------------------------------- // Transaction Builders // --------------------------------------------------------------------------- @@ -1552,4 +1859,24 @@ export class AssistantApp { * @return Constructed OrderUpdate. */ buildOrderUpdate(orderId: string, isGoogleOrderId: boolean): OrderUpdate; + + // --------------------------------------------------------------------------- + // Media Builders + // --------------------------------------------------------------------------- + + /** + * Constructs Media Response with chainable property setters. + * + * @return Constructed Media Response. + */ + buildMediaResponse(): MediaResponse; + + /** + * Constructs MediaObject with chainable property setters. + * + * @param name Name of media file. + * @param contentUrl Location of media file. + * @return Constructed MediaObject. + */ + buildMediaObject(name: string, contentUrl: string): MediaObject; } diff --git a/types/actions-on-google/index.d.ts b/types/actions-on-google/index.d.ts index 937943e1f0..943554586f 100644 --- a/types/actions-on-google/index.d.ts +++ b/types/actions-on-google/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for actions-on-google 1.8 +// Type definitions for actions-on-google 1.10 // Project: https://github.com/actions-on-google/actions-on-google-nodejs // Definitions by: Joel Hegg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/actions-on-google/response-builder.d.ts b/types/actions-on-google/response-builder.d.ts index 227d102958..9844fe45c1 100644 --- a/types/actions-on-google/response-builder.d.ts +++ b/types/actions-on-google/response-builder.d.ts @@ -27,6 +27,53 @@ export enum ImageDisplays { CROPPED } +/** + * Values related to supporting media. + */ +export namespace MediaValues { + /** + * Type of the media within a MediaResponse. + */ + enum Type { + /** + * Unspecified. + */ + MEDIA_TYPE_UNSPECIFIED, + /** + * Audio stream. + */ + AUDIO + } + + /** + * List of media control status' returned. + */ + enum Status { + /** + * Unspecified. + */ + UNSPECIFIED, + /** + * Finished. + */ + FINISHED + } + + /** + * List of possible item types. + */ + enum ImageType { + /** + * Icon. + */ + ICON, + /** + * Large image. + */ + LARGE + } +} + /** * Simple Response type. */ @@ -155,6 +202,22 @@ export class RichResponse { */ addBasicCard(basicCard: BasicCard): RichResponse; + /** + * Adds media to this response. + * + * @param mediaResponse MediaResponse to include in response. + * @return Returns current constructed RichResponse. + */ + addMediaResponse(mediaResponse: MediaResponse): RichResponse; + + /** + * Adds a Browse Carousel to list of items. + * + * @param browseCarousel Browse Carousel to present to user + * @return Returns current constructed RichResponse. + */ + addBrowseCarousel(browseCarousel: string | BrowseCarousel): RichResponse; + /** * Adds a single suggestion or list of suggestions to list of items. * @@ -325,6 +388,43 @@ export class List { addItems(optionItems: OptionItem | OptionItem[]): List; } +/** + * Class for initializing and constructing BrowseCarousel with chainable interface. + */ +export class BrowseCarousel { + /** + * Constructor for BrowseCarousel. Accepts optional BrowseCarousel to + * clone or list of items to copy. + * + * @param carousel Either a carousel to clone + * or an array of BrowseItem to initialize a new carousel + */ + constructor(carousel?: BrowseCarousel | BrowseItem[]); + + /** + * List of 2-20 items to show in this carousel. Required. + */ + items: BrowseItem[]; + + /** + * Adds a single item or list of items to the carousel. + * + * @param browseItems BrowseItems to add. + * @return Returns current constructed BrowseCarousel. + */ + addItems(browseItems: BrowseItem | BrowseItem[]): BrowseCarousel; + + /** + * Sets the display options for the images in this carousel. + * Use one of the image display constants. If none is chosen, + * ImageDisplays.DEFAULT will be enforced. + * + * @param option The option for displaying the image. + * @return Returns current constructed BrowseCarousel. + */ + setImageDisplay(option: ImageDisplays): BrowseCarousel; +} + /** * Class for initializing and constructing Carousel with chainable interface. */ @@ -350,6 +450,120 @@ export class Carousel { * @return Returns current constructed Carousel. */ addItems(optionItems: OptionItem | OptionItem[]): Carousel; + + /** + * Sets the display options for the images in this carousel. + * Use one of the image display constants. If none is chosen, + * ImageDisplays.DEFAULT will be enforced. + * + * @param option The option for displaying the image. + * @return Returns current constructed Carousel. + */ + setImageDisplay(option: ImageDisplays): Carousel; +} + +/** + * Class for initializing and constructing Option Items with chainable interface. + */ +export class BrowseItem { + /** + * Constructor for BrowseItem. Accepts a title and URL for the Browse Item + * card. + * + * @param title The title of the Browse Item card. + * @param url The URL of the link opened by clicking the Browse Item card. + */ + constructor(title?: string, url?: string); + + /** + * Title of the browse item. Required. + */ + title: string; + + /** + * Description text of the item. Optional. + */ + description?: string; + + /** + * Footer text of the item. Optional. + */ + footer?: string; + + /** + * Image to show on item. Optional. + */ + image?: Image; + + /** + * Url to that clicking the card opens. Optional. + */ + openUrlAction?: object; + + /** + * @return Returns the possible valid values for URL type hints + */ + urlTypeHints(): object; + + /** + * Sets the title for this Browse Item. + * + * @param title Title to show on item. + * @return Returns current constructed BrowseItem. + */ + setTitle(title: string): BrowseItem; + + /** + * Sets the description for this Browse Item. + * + * @param description Description to show on item. + * @return Returns current constructed BrowseItem. + */ + setDescription(description: string): BrowseItem; + + /** + * Sets the footer for this Browse Item. + * + * @param footerText text to show on item. + * @return Returns current constructed BrowseItem. + */ + setFooter(footerText: string): BrowseItem; + + /** + * Sets the image for this Browse Item. + * + * @param url Image source URL. + * @param accessibilityText Text to replace for image for accessibility. + * @param width Width of the image. + * @param height Height of the image. + * @return Returns current constructed BrowseItem. + */ + setImage(url: string, accessibilityText: string, width?: number, height?: number): BrowseItem; + + /** + * Sets the Open URL action - which includes the url and possibly the typeHint + * + * @param url Image source URL. + * @param urlTypeHint One of the typeHints enumerated by this.urlTypeHints() + * @return Returns the current constructed BrowseItem + */ + setOpenUrlAction(url: string, urlTypeHint?: string): BrowseItem; + + /** + * Sets the URL target of the BrowseItem card + * + * @param url Image source URL. + * @return Returns the current constructed BrowseItem + */ + setUrl(url: string): BrowseItem; + + /** + * Sets the URL type hint for the BrowseItem card + * + * @param urlTypeHint One of the typeHints enumerated by this.urlTypeHints() + * @return Returns the current constructed BrowseItem + */ + setUrlTypeHint(urlTypeHint: string): BrowseItem; } /** @@ -430,6 +644,90 @@ export class OptionItem { addSynonyms(synonyms: string | string[]): OptionItem; } +/** + * Class for initializing and constructing MediaResponse with chainable interface. + */ +export class MediaResponse { + /** + * Constructor for MediaResponse. + * @param mediaType Type of the media which defaults to MediaValues.Type.AUDIO + */ + constructor(mediaType: MediaValues.Type); + + /** + * Array of MediaObject held in the MediaResponse. + */ + mediaObjects: MediaObject[]; + + /** + * Type of the media within this MediaResponse + */ + mediaType: MediaValues.Type; + + /** + * Adds a single media file or list of media files to the cart. + * + * @param items Single or Array of MediaObject to add. + * @return Returns current constructed MediaResponse. + */ + addMediaObjects(items: MediaObject | MediaObject[]): MediaResponse; +} + +/** + * Class for initializing and constructing MediaObject with chainable interface. + */ +export class MediaObject { + /** + * Constructor for MediaObject. + * + * @param name Name of the MediaObject. + * @param contentUrl URL of the MediaObject. + */ + constructor(name: string, contentUrl: string); + + /** + * Name of the MediaObject. + */ + name: string; + + /** + * MediaObject URL. + */ + contentUrl: string; + + /** + * Description of the MediaObject. + */ + description?: string; + + /** + * Large image. + */ + largeImage?: Image; + + /** + * Icon image. + */ + icon?: Image; + + /** + * Set the description of the item. + * + * @param description Description of the item. + * @return Returns current constructed MediaObject. + */ + setDescription(description: string): MediaObject; + + /** + * Sets the image for this item. + * + * @param url Image source URL. + * @param type Type of image (LARGE or ICON). + * @return Returns current constructed MediaObject. + */ + setImage(url: string, type: MediaValues.ImageType): MediaObject; +} + /** * Check if given text contains SSML. * @param text Text to check. diff --git a/types/agenda/agenda-tests.ts b/types/agenda/agenda-tests.ts index bbf945bd62..a7031d2ef8 100644 --- a/types/agenda/agenda-tests.ts +++ b/types/agenda/agenda-tests.ts @@ -5,8 +5,8 @@ var mongoConnectionString = "mongodb://127.0.0.1/agenda"; var agenda = new Agenda({ db: { address: mongoConnectionString } }); -agenda.define('delete old users', (job, done) => { - +agenda.define<{ foo: Error }>('delete old users', (job, done) => { + done(job.attrs.data.foo) }); agenda.on('ready', () => { @@ -62,7 +62,7 @@ agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications' agenda.now('do the hokey pokey'); -var job = agenda.create('printAnalyticsReport', { userCount: 100 }); +var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 }); job.save(function(err) { console.log("Job successfully saved"); }); diff --git a/types/agenda/index.d.ts b/types/agenda/index.d.ts index 12b0b76c38..b29158983d 100644 --- a/types/agenda/index.d.ts +++ b/types/agenda/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for Agenda v1.0.0 -// Project: https://github.com/rschmukler/agenda +// Type definitions for Agenda v1.0.3 +// Project: https://github.com/agenda/agenda // Definitions by: Meir Gottlieb +// Jeff Principe // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -89,14 +90,14 @@ declare class Agenda extends EventEmitter { * @param name The name of the job. * @param data Data to associated with the job. */ - create(name: string, data?: any): Agenda.Job; + create(name: string, data?: T): Agenda.Job; /** * Find all Jobs matching `query` and pass same back in cb(). * @param query * @param cb */ - jobs(query: any, cb: ResultCallback): void; + jobs(query: any, cb: ResultCallback[]>): void; /** * Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want @@ -113,8 +114,8 @@ declare class Agenda extends EventEmitter { * @param options The options for the job. * @param handler The handler to execute. */ - define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; - define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; + define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; + define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void; /** * Runs job name at the given interval. Optionally, data and options can be passed in. @@ -124,8 +125,8 @@ declare class Agenda extends EventEmitter { * @param options An optional argument that will be passed to job.repeatEvery. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - every(interval: number | string, names: string, data?: any, options?: any, cb?: ResultCallback): Agenda.Job; - every(interval: number | string, names: string[], data?: any, options?: any, cb?: ResultCallback): Agenda.Job[]; + every(interval: number | string, names: string, data?: T, options?: any, cb?: ResultCallback>): Agenda.Job; + every(interval: number | string, names: string[], data?: T, options?: any, cb?: ResultCallback[]>): Agenda.Job[]; /** * Schedules a job to run name once at a given time. @@ -134,8 +135,8 @@ declare class Agenda extends EventEmitter { * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - schedule(when: Date | string, names: string, data?: any, cb?: ResultCallback): Agenda.Job; - schedule(when: Date | string, names: string[], data?: any, cb?: ResultCallback): Agenda.Job[]; + schedule(when: Date | string, names: string, data?: T, cb?: ResultCallback>): Agenda.Job; + schedule(when: Date | string, names: string[], data?: T, cb?: ResultCallback[]>): Agenda.Job[]; /** * Schedules a job to run name once immediately. @@ -143,7 +144,7 @@ declare class Agenda extends EventEmitter { * @param data An optional argument that will be passed to the processing function under job.attrs.data. * @param cb An optional callback function which will be called when the job has been persisted in the database. */ - now(name: string, data?: any, cb?: ResultCallback): Agenda.Job; + now(name: string, data?: T, cb?: ResultCallback>): Agenda.Job; /** * Cancels any jobs matching the passed mongodb-native query, and removes them from the database. @@ -242,10 +243,14 @@ declare namespace Agenda { } } + interface JobAttributesData { + [key: string]: any; + } + /** * The database record associated with a job. */ - interface JobAttributes { + interface JobAttributes { /** * The record identity. */ @@ -264,7 +269,7 @@ declare namespace Agenda { /** * The job details. */ - data: { [name: string]: any }; + data: T; /** * The priority of the job. @@ -330,12 +335,12 @@ declare namespace Agenda { /** * A scheduled job. */ - interface Job { + interface Job { /** * The database record associated with the job. */ - attrs: JobAttributes; + attrs: JobAttributes; /** * The agenda that created the job. @@ -348,54 +353,54 @@ declare namespace Agenda { * @param options An optional argument that can include a timezone field. The timezone should be a string as * accepted by moment-timezone and is considered when using an interval in the cron string format. */ - repeatEvery(interval: string | number, options?: { timezone?: string }): Job + repeatEvery(interval: string | number, options?: { timezone?: string }): Job /** * Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples). * @param time */ - repeatAt(time: string): Job + repeatAt(time: string): Job /** * Disables the job. */ - disable(): Job; + disable(): Job; /** * Enables the job. */ - enable(): Job; + enable(): Job; /** * Ensure that only one instance of this job exists with the specified properties * @param value The properties associated with the job that must be unqiue. * @param opts */ - unique(value: any, opts?: { insertOnly?: boolean }): Job; + unique(value: any, opts?: { insertOnly?: boolean }): Job; /** * Specifies the next time at which the job should run. * @param time The next time at which the job should run. */ - schedule(time: string | Date): Job; + schedule(time: string | Date): Job; /** * Specifies the priority weighting of the job. * @param value The priority of the job (lowest|low|normal|high|highest|number). */ - priority(value: string | number): Job; + priority(value: string | number): Job; /** * Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason. * @param reason A message or Error object that indicates why the job failed. */ - fail(reason: string | Error): Job; + fail(reason: string | Error): Job; /** * Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually * @param cb Called when the job is completed. */ - run(cb?: ResultCallback): Job; + run(cb?: ResultCallback>): Job; /** * Returns true if the job is running; otherwise, returns false. @@ -406,7 +411,7 @@ declare namespace Agenda { * Saves the job into the database. * @param cb Called when the job is saved. */ - save(cb?: ResultCallback): Job; + save(cb?: ResultCallback>): Job; /** * Removes the job from the database and cancels the job. @@ -424,7 +429,7 @@ declare namespace Agenda { /** * Calculates next time the job should run */ - computeNextRunAt(): Job; + computeNextRunAt(): Job; } interface JobOptions { diff --git a/types/amp-message/amp-message-tests.ts b/types/amp-message/amp-message-tests.ts new file mode 100644 index 0000000000..003949f3b7 --- /dev/null +++ b/types/amp-message/amp-message-tests.ts @@ -0,0 +1,57 @@ +import Message = require('amp-message'); + +// $ExpectType Message +new Message(new Buffer('aaa')); + +// $ExpectType Message +new Message([new Buffer('aaa'), new Buffer('bbb')]); + +const message = new Message([new Buffer('aaa'), new Buffer('bbb')]); + +// $ExpectType string +message.inspect(); + +// $ExpectType Buffer +message.toBuffer(); + +// $ExpectType number +message.push(new Buffer('ccc')); + +// $ExpectType Buffer | undefined +message.pop(); + +// $ExpectType Buffer | undefined +message.shift(); + +// $ExpectType number +message.unshift(new Buffer('ddd')); + +// $ExpectError +new Message(); + +// $ExpectError +new Message(1); + +// $ExpectError +new Message({}); + +// $ExpectError +new Message('aaa'); + +// $ExpectError +message.push(1); + +// $ExpectError +message.push({}); + +// $ExpectError +message.push('aaa'); + +// $ExpectError +message.unshift(1); + +// $ExpectError +message.unshift({}); + +// $ExpectError +message.unshift('aaa'); diff --git a/types/amp-message/index.d.ts b/types/amp-message/index.d.ts new file mode 100644 index 0000000000..f1ca520ae7 --- /dev/null +++ b/types/amp-message/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for amp-message 0.1 +// Project: https://github.com/visionmedia/node-amp-message +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +declare class Message { + constructor(args: Buffer | Buffer[]); + + inspect(): string; + + toBuffer(): Buffer; + + push(...items: Buffer[]): number; + + pop(): Buffer | undefined; + + shift(): Buffer | undefined; + + unshift(...items: Buffer[]): number; +} + +export = Message; diff --git a/types/amp-message/tsconfig.json b/types/amp-message/tsconfig.json new file mode 100644 index 0000000000..7b1826a6d8 --- /dev/null +++ b/types/amp-message/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-message-tests.ts" + ] +} diff --git a/types/amp-message/tslint.json b/types/amp-message/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/amp-message/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.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/rrule/tsconfig.json b/types/amp/tsconfig.json similarity index 78% rename from types/rrule/tsconfig.json rename to types/amp/tsconfig.json index 3e64a1d17a..4bb6a171ad 100644 --- a/types/rrule/tsconfig.json +++ b/types/amp/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ @@ -18,8 +18,6 @@ }, "files": [ "index.d.ts", - "test/rrule.ts", - "test/commonJs.ts", - "test/global.ts" + "amp-tests.ts" ] -} \ No newline at end of file +} 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" } diff --git a/types/aphrodite/aphrodite-tests.tsx b/types/aphrodite/aphrodite-tests.tsx index 685a9a4283..feb35c8c7c 100644 --- a/types/aphrodite/aphrodite-tests.tsx +++ b/types/aphrodite/aphrodite-tests.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { StyleSheet, css, StyleSheetServer, StyleSheetTestUtils } from "aphrodite"; +import { StyleSheet, css, StyleSheetServer, StyleSheetTestUtils, FontFamily } from "aphrodite"; const styles = StyleSheet.create({ red: { @@ -20,7 +20,7 @@ const styles = StyleSheet.create({ } }); -const coolFont = { +const coolFont: FontFamily = { fontFamily: "CoolFont", fontStyle: "normal", fontWeight: "normal", diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index 00d1908d9f..9684895588 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -6,11 +6,25 @@ import * as React from "react"; +type FontFamily = + | React.CSSProperties['fontFamily'] + | Pick + /** * Aphrodite style declaration */ export interface StyleDeclaration { - [key: string]: React.CSSProperties; + [key: string]: Pick & { + fontFamily?: FontFamily | FontFamily[]; + }; } interface StyleSheetStatic { diff --git a/types/arrify/arrify-tests.ts b/types/arrify/arrify-tests.ts index 319e86897a..12995781bf 100644 --- a/types/arrify/arrify-tests.ts +++ b/types/arrify/arrify-tests.ts @@ -1,4 +1,4 @@ -import arrify = require("arrify"); +import * as arrify from 'arrify'; arrify(null); arrify(null); diff --git a/types/arrify/index.d.ts b/types/arrify/index.d.ts index a1dda1b9ec..43c06af05f 100644 --- a/types/arrify/index.d.ts +++ b/types/arrify/index.d.ts @@ -14,4 +14,5 @@ * arrify([2, 3]) // returns [2, 3] */ declare function arrify(val: undefined | null | T | T[]): T[]; +declare namespace arrify {} export = arrify; diff --git a/types/async-retry/async-retry-tests.ts b/types/async-retry/async-retry-tests.ts index 29c90b36c8..68327b66bd 100644 --- a/types/async-retry/async-retry-tests.ts +++ b/types/async-retry/async-retry-tests.ts @@ -1,4 +1,5 @@ -import { Options, RetryFunction, retry } from 'async-retry'; +import { Options, RetryFunction } from 'async-retry'; +import retry = require("async-retry"); const o: Options = { retries: 1, diff --git a/types/async-retry/index.d.ts b/types/async-retry/index.d.ts index 38d0d8aeec..a2f65e00a4 100644 --- a/types/async-retry/index.d.ts +++ b/types/async-retry/index.d.ts @@ -1,17 +1,25 @@ -// Type definitions for async-retry 1.1 +// Type definitions for async-retry 1.2 // Project: https://github.com/zeit/async-retry#readme // Definitions by: Albert Wu +// Pablo Rodríguez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export function retry(fn: RetryFunction, opts: Options): Promise; +declare function AsyncRetry( + fn: AsyncRetry.RetryFunction, + opts: AsyncRetry.Options +): Promise; -export interface Options { - retries?: number; - factor?: number; - minTimeout?: number; - maxTimeout?: number; - randomize?: boolean; - onRetry?: (e: Error) => any; +declare namespace AsyncRetry { + interface Options { + retries?: number; + factor?: number; + minTimeout?: number; + maxTimeout?: number; + randomize?: boolean; + onRetry?: (e: Error) => any; + } + + type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; } -export type RetryFunction = (bail: (e: Error) => A, attempt: number) => A|Promise; +export = AsyncRetry; diff --git a/types/autobahn/index.d.ts b/types/autobahn/index.d.ts index 969c703478..59bb2c404d 100644 --- a/types/autobahn/index.d.ts +++ b/types/autobahn/index.d.ts @@ -25,7 +25,7 @@ declare namespace autobahn { leave(reason: string, message: string): void; - call(procedure: string, args?: any[], kwargs?: any, options?: ICallOptions): When.Promise; + call(procedure: string, args?: any[] | any, kwargs?: any, options?: ICallOptions): When.Promise; publish(topic: string, args?: any[], kwargs?: any, options?: IPublishOptions): When.Promise; @@ -96,7 +96,7 @@ declare namespace autobahn { kwargs: any; } - type SubscribeHandler = (args?: any[], kwargs?: any, details?: IEvent) => void; + type SubscribeHandler = (args?: any[] | any, kwargs?: any, details?: IEvent) => void; interface ISubscription { topic: string; @@ -206,7 +206,7 @@ declare namespace autobahn { type DeferFactory = () => When.Promise; - type OnChallengeHandler = (session: Session, method: string, extra: any) => string; + type OnChallengeHandler = (session: Session, method: string, extra: any) => string | When.Promise; interface IConnectionOptions { use_es6_promises?: boolean; diff --git a/types/big.js/index.d.ts b/types/big.js/index.d.ts index 405622f7ee..8b61c73d37 100644 --- a/types/big.js/index.d.ts +++ b/types/big.js/index.d.ts @@ -102,6 +102,12 @@ export interface BigConstructor { export interface Big { /** Returns a Big number whose value is the absolute value, i.e. the magnitude, of this Big number. */ abs(): Big; + /** + * Returns a Big number whose value is the value of this Big number plus n - alias for .plus(). + * + * @throws `NaN` if n is invalid. + */ + add(n: BigSource): Big; /** * Compare the values. * @@ -162,6 +168,12 @@ export interface Big { * @throws `NaN` if n is negative or otherwise invalid. */ mod(n: BigSource): Big; + /** + * Returns a Big number whose value is the value of this Big number times n - alias for .times(). + * + * @throws `NaN` if n is invalid. + */ + mul(n: BigSource): Big; /** * Returns a Big number whose value is the value of this Big number plus n. * @@ -196,6 +208,12 @@ export interface Big { * @throws `NaN` if this Big number is negative. */ sqrt(): Big; + /** + * Returns a Big number whose value is the value of this Big number minus n - alias for .minus(). + * + * @throws `NaN` if n is invalid. + */ + sub(n: BigSource): Big; /** * Returns a Big number whose value is the value of this Big number times n. * diff --git a/types/big.js/test/big.js-global-tests.ts b/types/big.js/test/big.js-global-tests.ts index 578391de7b..a57e748fbf 100644 --- a/types/big.js/test/big.js-global-tests.ts +++ b/types/big.js/test/big.js-global-tests.ts @@ -86,6 +86,7 @@ function minusTests() { 0.3 - 0.1; // 0.19999999999999998 const x = new Big(0.3); x.minus(0.1); // '0.2' + x.sub(0.1); // '0.2' } function modTests() { @@ -99,6 +100,7 @@ function plusTests() { const x = new Big(0.1); const y = x.plus(0.2); // '0.3' Big(0.7).plus(x).plus(y); // '1' + Big(0.7).add(x).add(y); // '1' } function powTests() { @@ -138,6 +140,7 @@ function timesTests() { const x = new Big(0.6); const y = x.times(3); // '1.8' Big('7e+500').times(y); // '1.26e+501' + Big('7e+500').mul(y); // '1.26e+501' } function toExponentialTests() { diff --git a/types/big.js/test/big.js-module-tests.ts b/types/big.js/test/big.js-module-tests.ts index 056d41727b..62e5ba491e 100644 --- a/types/big.js/test/big.js-module-tests.ts +++ b/types/big.js/test/big.js-module-tests.ts @@ -88,6 +88,7 @@ function minusTests() { 0.3 - 0.1; // 0.19999999999999998 const x = new Big(0.3); x.minus(0.1); // '0.2' + x.sub(0.1); // '0.2' } function modTests() { @@ -101,6 +102,7 @@ function plusTests() { const x = new Big(0.1); const y = x.plus(0.2); // '0.3' Big(0.7).plus(x).plus(y); // '1' + Big(0.7).add(x).add(y); // '1' } function powTests() { @@ -140,6 +142,7 @@ function timesTests() { const x = new Big(0.6); const y = x.times(3); // '1.8' Big('7e+500').times(y); // '1.26e+501' + Big('7e+500').mul(y); // '1.26e+501' } function toExponentialTests() { diff --git a/types/cassandra-driver/index.d.ts b/types/cassandra-driver/index.d.ts index 5c0578ccf2..33a9f5988f 100644 --- a/types/cassandra-driver/index.d.ts +++ b/types/cassandra-driver/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for cassandra-driver v3.2.2 +// Type definitions for cassandra-driver v3.4.1 // Project: https://github.com/datastax/nodejs-driver // Definitions by: Marc Fisher +// Christian D // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -115,7 +116,11 @@ export namespace policies { interface RetryPolicyStatic { new (): RetryPolicy; - retryDecision: any; + retryDecision: { + rethrow: number, + retry: number, + ignore: number + }; } interface RetryPolicy { @@ -126,15 +131,55 @@ export namespace policies { retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean }; } } + + namespace speculativeExecution { + let NoSpeculativeExecutionPolicy: NoSpeculativeExecutionPolicyStatic + + interface SpeculativeExecutionPolicy { + init(client: Client): void; + newPlan(keyspace: string, queryInfo: string | Array): { + nextExecution: Function + } + } + + interface NoSpeculativeExecutionPolicyStatic { + new (): NoSpeculativeExecutionPolicy + } + + interface NoSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } + + interface ConstantSpeculativeExecutionPolicyStatic { + new (delay: number, maxSpeculativeExecutions: number): ConstantSpeculativeExecutionPolicy + } + + interface ConstantSpeculativeExecutionPolicy extends SpeculativeExecutionPolicy { } + } + + namespace timestampGeneration { + let MonotonicTimestampGenerator: MonotonicTimestampGeneratorStatic + + interface TimestampGenerator { + next(client: Client): null | number | _Long + } + + interface MonotonicTimestampGeneratorStatic { + new (warningThreshold?: number, minLogInterval?: number): MonotonicTimestampGeneratorStatic + } + + interface MonotonicTimestampGenerator extends TimestampGenerator { + getDate(): number + } + } } export namespace types { let BigDecimal: BigDecimalStatic; + let Duration: DurationStatic; + let Long: _Long; let InetAddress: InetAddressStatic; let Integer: IntegerStatic; let LocalDate: LocalDateStatic; let LocalTime: LocalTimeStatic; - let Long: _Long; let ResultSet: ResultSetStatic; // let ResultStream: ResultStreamStatic; let Row: RowStatic; @@ -221,6 +266,19 @@ export namespace types { toJSON(): string; } + interface DurationStatic { + new (month: number, days: number, nanoseconds: number | _Long): Duration; + + fromBuffer(buffer: Buffer): Duration; + fromString(input: string): Duration; + } + + interface Duration { + equals(other: Duration): boolean; + toBuffer(): Buffer; + toString(): string; + } + interface InetAddressStatic { new (buffer: Buffer): InetAddress; @@ -336,13 +394,14 @@ export namespace types { } interface ResultSetStatic { - new (response: any, host: string, triedHost: { [key: string]: any }, consistency: consistencies): ResultSet; + new (response: any, host: string, triedHost: { [key: string]: any }, speculativeExecutions: number, consistency: consistencies): ResultSet; } interface ResultSet { info: { queriedHost: Host, triedHosts: { [key: string]: string; }, + speculativeExecutions: number, achievedConsistency: consistencies, traceId: Uuid, warnings: Array, @@ -352,11 +411,13 @@ export namespace types { rowLength: number; columns: Array<{ [key: string]: string; }>; pageState: string; - nextPage: any; // function + nextPage: Function; first(): Row; getPageState(): string; getColumns(): Array<{ [key: string]: string; }>; + wasApplied(): boolean; + [Symbol.iterator](): Iterator; } interface ResultStreamStatic { @@ -442,40 +503,50 @@ export let Encoder: EncoderStatic; export interface ClientOptions { contactPoints: Array, keyspace?: string, + refreshSchemaDelay?: number, + isMetadataSyncEnabled?: boolean, + prepareOnAllHosts?: boolean, + rePrepareOnUp?: boolean, + maxPrepared?: number, policies?: { - addressResolution?: policies.addressResolution.AddressTranslator, loadBalancing?: policies.loadBalancing.LoadBalancingPolicy, + retry?: policies.retry.RetryPolicy, reconnection?: policies.reconnection.ReconnectionPolicy, - retry?: policies.retry.RetryPolicy + addressResolution?: policies.addressResolution.AddressTranslator, + speculativeExecution?: policies.speculativeExecution.SpeculativeExecutionPolicy, + timestampGeneration?: policies.timestampGeneration.TimestampGenerator, }, queryOptions?: QueryOptions, pooling?: { - heartBeatInterval: number, - coreConnectionsPerHost: { [key: number]: number; }, - warmup: boolean; + heartBeatInterval?: number, + coreConnectionsPerHost?: { [key: number]: number; }, + maxRequestsPerConnection?: number, + warmup?: boolean; }, protocolOptions?: { - port: number, - maxSchemaAgreementWaitSeconds: number, - maxVersion: number + port?: number, + maxSchemaAgreementWaitSeconds?: number, + maxVersion?: number }, socketOptions?: { - connectTimeout: number, - defunctReadTimeoutThreshold: number, - keepAlive: boolean, - keepAliveDelay: number, - readTimeout: number, - tcpNoDelay: boolean, - coalescingThreshold: number + connectTimeout?: number, + defunctReadTimeoutThreshold?: number, + keepAlive?: boolean, + keepAliveDelay?: number, + readTimeout?: number, + tcpNoDelay?: boolean, + coalescingThreshold?: number }, authProvider?: auth.AuthProvider, sslOptions?: tls.ConnectionOptions, encoding?: { - map: Function, - set: Function, - copyBuffer: boolean, - useUndefinedAsUnset: boolean - } + map?: Function, + set?: Function, + copyBuffer?: boolean, + useUndefinedAsUnset?: boolean + }, + profiles?: Array, + promiseFactory?: Function, } export interface QueryOptions { @@ -483,8 +554,11 @@ export interface QueryOptions { captureStackTrace?: boolean; consistency?: number; customPayload?: any; + executionProfile?: string | ExecutionProfile; fetchSize?: number; hints?: Array | Array>; + isIdempotent?: boolean; + keyspace?: string; logged?: boolean; pageState?: Buffer | string; prepare?: boolean; @@ -520,6 +594,7 @@ export interface Client extends events.EventEmitter { execute(query: string, callback: ResultCallback): void; execute(query: string, params?: any, options?: QueryOptions): Promise; getReplicas(keyspace: string, token: Buffer): Array; // TODO: Should this be a more explicit return? + getState(): metadata.ClientState; shutdown(callback?: Callback): void; shutdown(): Promise; stream(query: string, params?: any, options?: QueryOptions, callback?: Callback): NodeJS.ReadableStream; @@ -548,6 +623,7 @@ export interface HostMapStatic { export interface HostMap extends events.EventEmitter { length: number; + clear(): Array; forEach(callback: Callback): void; get(key: string): Host; keys(): Array; @@ -566,6 +642,22 @@ export interface Encoder { encode(value: any, typeInfo?: string | number | { code: number, info?: any }): Buffer; } +interface ExecutionProfileOptions { + consistency: number, + loadBalancing: policies.loadBalancing.LoadBalancingPolicy, + name: string, + readTimeout: number, + retry: policies.retry.RetryPolicy, + serialConsistency: number +} + +export interface ExecutionProfileStatic { + new (name: string, options: ExecutionProfileOptions): ExecutionProfile +} + +export interface ExecutionProfile extends ExecutionProfileOptions { +} + export namespace auth { let Authenticator: AuthenticatorStatic; let PlainTextAuthProvider: PlainTextAuthProviderStatic; @@ -649,6 +741,17 @@ export namespace metadata { stateFunction: string; stateType: string; } + + interface ClientStateStatic { + new (): ClientState; + } + + interface ClientState { + getConnectedHosts(): Array; + getInFlightQueries(host: Host): number; + getOpenConnections(host: Host): number; + toString(): string; + } interface DataTypeInfo { code: number, diff --git a/types/ckeditor/ckeditor-tests.ts b/types/ckeditor/ckeditor-tests.ts index dd0ec92164..515996e90a 100644 --- a/types/ckeditor/ckeditor-tests.ts +++ b/types/ckeditor/ckeditor-tests.ts @@ -506,3 +506,9 @@ function test_editor_instance_event() { } }); } + +function test_dtd() { + var brConsideredEmptyTag = CKEDITOR.dtd.$empty["br"]; + var spanCanContainText = CKEDITOR.dtd["span"]["#"]; + var divCanContainSpan = CKEDITOR.dtd["div"]["span"]; +} diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts index cf7cd0cc27..49ffce2fd9 100644 --- a/types/ckeditor/index.d.ts +++ b/types/ckeditor/index.d.ts @@ -24,8 +24,8 @@ declare namespace CKEDITOR { var DIALOG_RESIZE_HEIGHT: number; var DIALOG_RESIZE_NONE: number; var DIALOG_RESIZE_WIDTH: number; - var DIALOG_STATE_IDLE: number; - var DIALOG_STATE_BUSY: number; + var DIALOG_STATE_IDLE: number; + var DIALOG_STATE_BUSY: number; var ELEMENT_MODE_APPENDTO: number; var ELEMENT_MODE_INLINE: number; var ELEMENT_MODE_NONE: number; @@ -44,10 +44,10 @@ declare namespace CKEDITOR { var NODE_DOCUMENT_FRAGMENT: number; var NODE_ELEMENT: number; var NODE_TEXT: number; - var POSITION_BEFORE_START: number; - var POSITION_BEFORE_END: number; - var POSITION_AFTER_START: number; - var POSITION_AFTER_END: number; + var POSITION_BEFORE_START: number; + var POSITION_BEFORE_END: number; + var POSITION_AFTER_START: number; + var POSITION_AFTER_END: number; var SELECTION_ELEMENT: number; var SELECTION_NONE: number; var SELECTION_TEXT: number; @@ -55,9 +55,9 @@ declare namespace CKEDITOR { var SHRINK_ELEMENT: number; var SHRINK_TEXT: number; var START: number; - var STYLE_BLOCK: string; - var STYLE_INLINE: string; - var STYLE_OBJECT: string; + var STYLE_BLOCK: string; + var STYLE_INLINE: string; + var STYLE_OBJECT: string; var TRISTATE_DISABLED: number; var TRISTATE_OFF: number; var TRISTATE_ON: number; @@ -288,7 +288,7 @@ declare namespace CKEDITOR { class elementPath { constructor(startNode: element, root: element); - constructor(startNode: element); + constructor(startNode: element); block: element; blockLimit: element; root: element; @@ -342,7 +342,7 @@ declare namespace CKEDITOR { setStartAt(node: node, position: number): void; setEndAt(node: node, position: number): void; fixBlock(isStart: boolean, blockTag: Object): Object; - select(): selection; + select(): selection; splitBlock(blockTag: Object): Object; splitElement(toSplit: element): element; removeEmptyBlocksAtEnd(atEnd: boolean): void; @@ -836,7 +836,7 @@ declare namespace CKEDITOR { templates_files?: Object; templates_replaceContent?: boolean; title?: string | boolean; - toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; + toolbar?: string | (string | string[] | { name: string, items?: string[], groups?: string[] })[] | null; toolbarCanCollapse?: boolean; toolbarGroupCycling?: boolean; toolbarGroups?: (toolbarGroups | string)[]; @@ -869,19 +869,19 @@ declare namespace CKEDITOR { } module skin { - var icons: { [name: string]: { path: string } }; - function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; - } + var icons: { [name: string]: { path: string } }; + function addIcon(name: string, path: string, offset?: number, bgsize?: string): void; + } class style { - constructor(something: { element: string, attributes: { [att: string]: string } }); - applyToRange(range: Range, editor: editor): void; - } + constructor(something: { element: string, attributes: { [att: string]: string } }); + applyToRange(range: Range, editor: editor): void; + } interface editable extends dom.element { - hasFocus: boolean; - attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, - scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; + hasFocus: boolean; + attachListener(obj: event | editable, eventName: string, listenerFunction: (ei: eventInfo) => void, + scopeobj?: {}, listenerData?: any, priority?: number): listenerRegistration; } @@ -978,7 +978,7 @@ declare namespace CKEDITOR { destroy(widget: CKEDITOR.plugins.widget, offline?: boolean): void; destroyAll(offline?: boolean): void; finalizeCreation(container: any): void; - focused: widget; + focused: widget; fire(eventName: string, data: Object, editor: editor): any; // should be boolean | Object getByElement(element: any, checkWrapperOnly: boolean): CKEDITOR.plugins.widget; hasListeners(eventName: string): boolean; @@ -1089,7 +1089,7 @@ declare namespace CKEDITOR { interface IMenuItemDefinition { label:string, command:string, - icon: string + icon: string group:string, order:number } @@ -1142,7 +1142,7 @@ declare namespace CKEDITOR { createFakeParserElement(realElement: Object, className: Object, realElementType: Object, isResizable: Object): void; createRange(): dom.range; destroy(noUpdate?: boolean): void; - editable(): editable | null; + editable(): editable | null; editable(elementOrEditable: dom.element): void; editable(elementOrEditable: editable): void; elementPath(startNode?: dom.node): dom.elementPath; @@ -1300,14 +1300,14 @@ declare namespace CKEDITOR { stop(): void; } - module filter { - interface allowedContentRules { + module filter { + interface allowedContentRules { - } - } + } + } class filter { - allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; + allow(newRules: CKEDITOR.filter.allowedContentRules, featureName?: string, overrideCustom?: boolean): boolean; } @@ -1370,10 +1370,28 @@ declare namespace CKEDITOR { } - class dtd { - + interface dtdDefinition { + [outerTagName: string]: {[innerTagName: string]: 1}; + $block: {[tagName: string]: 1}; + $blockLimit: {[tagName: string]: 1}; + $cdata: {[tagName: string]: 1}; + $editable: {[tagName: string]: 1}; + $empty: {[tagName: string]: 1}; + $inline: {[tagName: string]: 1}; + $intermediate: {[tagName: string]: 1}; + $list: {[tagName: string]: 1}; + $listItem: {[tagName: string]: 1}; + $nonBodyContent: {[tagName: string]: 1}; + $nonEditable: {[tagName: string]: 1}; + $object: {[tagName: string]: 1}; + $removeEmpty: {[tagName: string]: 1}; + $tabIndex: {[tagName: string]: 1}; + $tableContent: {[tagName: string]: 1}; + $transparent: {[tagName: string]: 1}; } + var dtd: dtdDefinition; + class ui extends event { constructor(editor: editor); @@ -1819,7 +1837,7 @@ declare namespace CKEDITOR { children: any[]; type: number; add(node: node): number; - add(node: node, index: number): void; + add(node: node, index: number): void; clone(): element; filter(filter: filter): boolean; filterChildren(filter: filter): void; 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..05dfadc7f3 --- /dev/null +++ b/types/command-line-usage/command-line-usage-tests.ts @@ -0,0 +1,24 @@ +import commandLineUsage = require("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" } diff --git a/types/cron/cron-tests.ts b/types/cron/cron-tests.ts index 7eea73eeed..21e28f9c0f 100644 --- a/types/cron/cron-tests.ts +++ b/types/cron/cron-tests.ts @@ -47,7 +47,12 @@ var job = new CronJob({ start: false, timeZone: 'America/Los_Angeles' }); +console.log(job.lastDate()); +console.log(job.nextDates(1)); +console.log(job.running); +job.setTime(new CronTime('00 30 11 * * 1-2')); job.start(); +job.stop(); // How to check if a cron pattern is valid: try { diff --git a/types/cron/index.d.ts b/types/cron/index.d.ts index 780890c014..b27bfdf90c 100644 --- a/types/cron/index.d.ts +++ b/types/cron/index.d.ts @@ -1,25 +1,118 @@ -// Type definitions for cron 1.2 +// Type definitions for cron 1.3 // Project: https://www.npmjs.com/package/cron // Definitions by: Hiroki Horiuchi +// Lundarl Gholoi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export declare class CronTime { + /** + * Create a new ```CronTime```. + * @param source The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + * @param zone Timezone name. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + */ + constructor(source: string | Date, zone?: string); + /** + * Tells you when ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + */ + public sendAt(i?: number): Date; + /** + * Get the number of milliseconds in the future at which to fire our callbacks. + */ + public getTimeout(): number; +} -interface CronJobStatic { - new (cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean): CronJob; - new (options: { - cronTime: string | Date; onTick: () => void; onComplete?: () => void; start?: boolean; timeZone?: string; context?: any; runOnInit?: boolean - }): CronJob; +export declare interface CronJobParameters { + /** + * The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + */ + cronTime: string | Date; + /** + * The function to fire at the specified time. + */ + onTick: () => void; + /** + * A function that will fire when the job is complete, when it is stopped. + */ + onComplete?: () => void; + /** + * Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs. + */ + start?: boolean; + /** + * Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + */ + timeZone?: string; + /** + * The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call ```this.stop()```. However, if you change this you'll have access to the functions and values within your context object. + */ + context?: any; + /** + * This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility. + */ + runOnInit?: boolean; } -interface CronJob { - start(): void; - stop(): void; - running: boolean | undefined; -} -export declare var CronJob: CronJobStatic; -interface CronTimeStatic { - new (time: string | Date): CronTime; +export declare class CronJob { + /** + * Return ```true``` if job is running. + */ + public running: boolean | undefined; + /** + * Function using to fire ```onTick```, default set to an inner private function. Overwrite this only if you have a really good reason to do so. + */ + public fireOnTick: Function; + + /** + * Create a new ```CronJob```. + * @param cronTime The time to fire off your job. This can be in the form of cron syntax or a JS ```Date``` object. + * @param onTick The function to fire at the specified time. + * @param onComplete A function that will fire when the job is complete, when it is stopped. + * @param start Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call ```job.start()``` in order to start the job (assuming ```job``` is the variable you set the cronjob to). This does not immediately fire your onTick function, it just gives you more control over the behavior of your jobs. + * @param timeZone Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at [Moment Timezone Website](http://momentjs.com/timezone/). + * @param context The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call ```this.stop()```. However, if you change this you'll have access to the functions and values within your context object. + * @param runOnInit This will immediately fire your ```onTick``` function as soon as the requisit initialization has happened. This option is set to ```false``` by default for backwards compatibility. + */ + constructor(cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean); + /** + * Create a new ```CronJob```. + * @param options Job parameters. + */ + constructor(options: CronJobParameters); + + /** + * Runs your job. + */ + public start(): void; + /** + * Stops your job. + */ + public stop(): void; + /** + * Change the time for the ```CronJob```. + * @param time Target time. + */ + public setTime(time: CronTime): void; + /** + * Tells you the last execution date. + */ + public lastDate(): Date; + /** + * Tells you when a ```CronTime``` will be run. + * @param i Indicate which turn of run after now. If not given return next run time. + */ + public nextDates(i?: number): Date; + /** + * Add another ```onTick``` function. + * @param callback Target function. + */ + public addCallback(callback: Function): void; } -interface CronTime { } -export declare var CronTime: CronTimeStatic; + +export declare var job: + ((cronTime: string | Date, onTick: () => void, onComplete?: () => void, start?: boolean, timeZone?: string, context?: any, runOnInit?: boolean) => CronJob) + | ((options: CronJobParameters) => CronJob); +export declare var time: (source: string | Date, zone?: string) => CronTime; +export declare var sendAt: (cronTime: CronTime) => Date; +export declare var timeout: (cronTime: CronTime) => number; diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts index 3cffde0c9e..9712a0da15 100644 --- a/types/d3-fetch/d3-fetch-tests.ts +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -51,8 +51,8 @@ promise2 = d3Fetch.tsv(url, parseRow); promise2 = d3Fetch.tsv(url, init, parseRow); let docPromise: Promise; -docPromise = d3Fetch.hmtl(url); -docPromise = d3Fetch.hmtl(url, init); +docPromise = d3Fetch.html(url); +docPromise = d3Fetch.html(url, init); docPromise = d3Fetch.svg(url); docPromise = d3Fetch.svg(url, init); diff --git a/types/d3-fetch/index.d.ts b/types/d3-fetch/index.d.ts index fc0d5e0e66..6e31d70a76 100644 --- a/types/d3-fetch/index.d.ts +++ b/types/d3-fetch/index.d.ts @@ -154,7 +154,7 @@ export function dsv( * @param url A valid URL string. * @param init An optional request initialization object. */ -export function hmtl(url: string, init?: RequestInit): Promise; +export function html(url: string, init?: RequestInit): Promise; /** * Fetches the image at the specified input URL and returns a promise of an HTML image element. diff --git a/types/dagre/index.d.ts b/types/dagre/index.d.ts index 6c5e5e00ec..774fbf8f80 100644 --- a/types/dagre/index.d.ts +++ b/types/dagre/index.d.ts @@ -95,15 +95,15 @@ export interface NodeConfig { } export interface EdgeConfig { - minlen: number; - weight: number; - width: number; - height: number; - lablepos: 'l'|'c'|'r'; - labeloffest: number; + minlen?: number; + weight?: number; + width?: number; + height?: number; + lablepos?: 'l'|'c'|'r'; + labeloffest?: number; } -export function layout(graph: graphlib.Graph, layout?: GraphLabel&NodeConfig&EdgeConfig): void; +export function layout(graph: graphlib.Graph, layout?: GraphLabel & NodeConfig & EdgeConfig): void; export interface Edge { v: string; 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..0ad00b4395 --- /dev/null +++ b/types/datatables.net-autofill/datatables.net-autofill-tests.ts @@ -0,0 +1,8 @@ +const config: DataTables.Settings = { + // AutoFill extension options + autoFill: { + alwaysAsk: true, + enable: true, + columns: [1, 2] + } +}; diff --git a/types/datatables.net-autofill/index.d.ts b/types/datatables.net-autofill/index.d.ts new file mode 100644 index 0000000000..2f05d608be --- /dev/null +++ b/types/datatables.net-autofill/index.d.ts @@ -0,0 +1,33 @@ +// 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; + /* + * Select the columns that can be auto filled + */ + columns: string | number[]; + /* + * + * 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" } 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..a6126baf44 --- /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..8254cd71dc --- /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: () => void; + } + + 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; + }; + } +} diff --git a/types/datatables.net-colreorder/tsconfig.json b/types/datatables.net-colreorder/tsconfig.json new file mode 100644 index 0000000000..ec5e47bb49 --- /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" + ] +} 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" } diff --git a/types/datatables.net-select/index.d.ts b/types/datatables.net-select/index.d.ts index e24f6b8ab6..563a51fc25 100644 --- a/types/datatables.net-select/index.d.ts +++ b/types/datatables.net-select/index.d.ts @@ -44,6 +44,41 @@ 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 { + 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; + }; + } + + interface RowMethods { + /** + * Select a row + */ + select(): Api; + /** + * Deselect a row + */ + deselect(): Api; + } + + interface RowsMethods { + /** + * Select multiple rows + */ + select(): Api; + /** + * 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 cdddc98789..c0a37145ab 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 * @@ -221,7 +225,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 +233,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 +241,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 @@ -1297,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" @@ -1931,6 +1935,7 @@ declare namespace DataTables { } interface ColumnLegacy { + idx: number; aDataSort: any; asSorting: string[]; bSearchable: boolean; diff --git a/types/dotenv/dotenv-tests.ts b/types/dotenv/dotenv-tests.ts index df05475c17..613da3b056 100644 --- a/types/dotenv/dotenv-tests.ts +++ b/types/dotenv/dotenv-tests.ts @@ -11,6 +11,8 @@ dotenv.config({ encoding: 'utf8' }); +dotenv.load(); + const parsed = dotenv.parse("ENVIRONMENT=production\nDEBUG=no\n"); const debug: string = parsed['DEBUG']; diff --git a/types/dotenv/index.d.ts b/types/dotenv/index.d.ts index 831790138c..4dd67b15c0 100644 --- a/types/dotenv/index.d.ts +++ b/types/dotenv/index.d.ts @@ -20,6 +20,7 @@ export function parse(src: string | Buffer): {[name: string]: string}; * Example: 'KEY=value' becomes { parsed: { KEY: 'value' } } */ export function config(options?: DotenvOptions): DotenvResult; +export const load: typeof config; export interface DotenvOptions { /** 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; diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index 03f6b12c24..e95fb94b2b 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -8,7 +8,7 @@ /*! * filename: ej.web.all.d.ts -* version : 16.1.0.24 +* version : 16.1.0.32 * Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -378,7 +378,7 @@ declare namespace ej { update(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; } class ForeignKeyAdaptor extends ej.JsonAdaptor { - constructor(); + constructor(data: any, type: string); processQuery(ds: any, query: ej.Query): any; insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: any }; @@ -9567,8 +9567,8 @@ declare namespace ej { */ cssClass?: string; - /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled.When you enter the delimiter value, the text after the delimiter is considered as a - * separateword or query. The delimiter string is a single character and must be a symbol. Mostly,the delimiter symbol is used as comma (,), semi-colon (;), or any other special + /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled. When you enter the delimiter value, the text after the delimiter is considered as a + * separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,), semi-colon (;), or any other special * character. * @Default {,} */ @@ -9628,12 +9628,12 @@ declare namespace ej { */ readOnly?: boolean; - /** The DropDownTree’s textbox is displayed with rounded corner style. + /** The DropDownTree's textbox is displayed with rounded corner style. * @Default {false} */ showRoundedCorner?: boolean; - /** Specifies the targetID for the DropDownTree’s items. + /** Specifies the targetID for the DropDownTree's items. * @Default {null} */ targetID?: string; @@ -9653,8 +9653,8 @@ declare namespace ej { */ validationRules?: any; - /** Specifies the value (text content) for the DropDownTree control. For the single selection mode, the selected item’s value will be returned in its data type, and for - * MultiSelectMode, returns the selected items’ values separated by delimiter in string type. + /** Specifies the value (text content) for the DropDownTree control. For the single selection mode, the selected item's value will be returned in its data type, and for + * MultiSelectMode, returns the selected items values separated by delimiter in string type. * @Default {null} */ value?: string; @@ -9678,7 +9678,7 @@ declare namespace ej { */ blur?(e: BlurEventArgs): void; - /** Fires the action when the DropDownTree control’s value is changed. + /** Fires the action when the DropDownTree control's value is changed. */ change?(e: ChangeEventArgs): void; @@ -9744,15 +9744,15 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ selectedText?: string; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9779,11 +9779,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9810,11 +9810,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; } @@ -9863,7 +9863,7 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ selectedText?: string; @@ -9905,11 +9905,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; } @@ -9928,11 +9928,11 @@ declare namespace ej { */ model?: any; - /** Selected item’s text. + /** Selected item's text. */ text?: string; - /** Selected item’s value. + /** Selected item's value. */ value?: string; @@ -9961,7 +9961,7 @@ declare namespace ej { } } enum Textmode { - //When TextMode property is set to none, only selected/checked node’s text is presented. + //When TextMode property is set to none, only selected/checked node's text is presented. None, //When FullPath option is selected, the full path of the selected node is shown in the control. FullPath, @@ -19622,6 +19622,11 @@ declare namespace ej { */ value?: string|Date; + /** Specifies the water mark text to be displayed in input text. + * @Default {select a time} + */ + watermarkText?: string; + /** Defines the width of the TimePicker textbox. */ width?: string|number; @@ -30758,6 +30763,11 @@ declare namespace ej { */ operationalMode?: ej.Pivot.OperationalMode|string; + /** To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. + * @Default {[]} + */ + axes?: any[]; + /** This is a horizontal axis that contains options to configure the axis and it is the primary x-axis for all series in the series array. To override x-axis for particular series, * create an axis object by providing a unique name by using the name property and add it to the axes array. Then, assign the name to the series’s xAxisName property to link both * the axis and the series. @@ -30818,10 +30828,6 @@ declare namespace ej { */ beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; - /** Triggers before the pivot engine starts to populate. - */ - beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; - /** Triggers when performing drill up/down operation in the pivot chart control. */ drillSuccess?(e: DrillSuccessEventArgs): void; @@ -30888,13 +30894,6 @@ declare namespace ej { element?: any; } - export interface BeforePivotEnginePopulateEventArgs { - - /** returns the current instance of PivotChart. - */ - chartObj?: any; - } - export interface DrillSuccessEventArgs { /** returns the current instance of PivotChart. @@ -33505,6 +33504,11 @@ declare namespace ej { */ allowInline?: boolean; + /** When set to false, disables the appointment delete option on the Scheduler. + * @Default {true} + */ + allowDelete?: boolean; + /** When set to true, Scheduler allows interaction through keyboard shortcut keys. * @Default {true} */ @@ -37077,6 +37081,11 @@ declare namespace ej { * @Default {0} */ weekStartDay?: number; + + /** Enable or disable the automatic timescale update on cell editing, dialog editing and taskbar editing. + * @Default {true} + */ + updateTimescaleView?: boolean; } export interface SelectedCellIndex { @@ -38114,6 +38123,14 @@ declare namespace ej { */ sortColumn(fieldName: string, columnSortDirection: string): void; + /** To move the TreeGrid rows programmatically with from index ,to index and position. + * @param {number} you can pass drag Index of the row + * @param {number} you can pass target Index of the row. + * @param {string} you can pass the drop position as above,below,child + * @returns {void} + */ + moveRow(fromIndex: number, toIndex: number, position: string): void; + /** To reorder the column with field name and target index values * @param {string} you can pass a name of column to reorder. * @param {string} you can pass a target column index to be inserted. @@ -38651,6 +38668,10 @@ declare namespace ej { */ rowDragStop?(e: RowDragStopEventArgs): void; + /** Triggered before row drop action begins. + */ + rowDropActionBegin?(e: RowDropActionBeginEventArgs): void; + /** Triggered before selecting a cell */ cellSelecting?(e: CellSelectingEventArgs): void; @@ -39378,6 +39399,45 @@ declare namespace ej { type?: string; } + export interface RowDropActionBeginEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the row which we start to drag. + */ + draggedRow?: any; + + /** Returns the row index which we start to drag. + */ + draggedRowIndex?: number; + + /** Returns the multiple dragged row collection for multiple reorder + */ + draggedRecords?: any[]; + + /** Returns the drop position. + */ + dropPosition?: string; + + /** Returns the row which we are dropped to row. + */ + targetRow?: any; + + /** Returns the row index which we are dropped to row. + */ + targetRowIndex?: number; + + /** Returns the TreeGrid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; + } + export interface CellSelectingEventArgs { /** Returns the cancel option value. @@ -42693,6 +42753,8 @@ declare namespace ej { XLSort: Spreadsheet.XLSort; + XLSparkline: Spreadsheet.XLSparkline; + XLValidate: Spreadsheet.XLValidate; } export namespace Spreadsheet { @@ -43547,6 +43609,35 @@ declare namespace ej { sortByRange(range: any[]|string, columnName: string, direction: any): boolean; } + export interface XLSparkline { + + /** This method used for creating the sparkline chart for specified range in spreadsheet. + * @param {string} Pass the data range + * @param {string} Pass the location range + * @param {string} Pass the sparkline chart type + * @param {any} Pass the sparkline chart options + * @param {number} Pass the sheetIndex + * @returns {void} + */ + createSparkline(dataRange: string, locationRange: string, type: string, options: any, sheetIndex: number): void; + + /** This method used to change the sparkline color and marker point color in the spreadsheet. + * @param {string} Pass the sparkline ID + * @param {any} Pass the sparkline options + * @param {number} Optional. Pass the sheet index + * @returns {void} + */ + changePointColor(sparklineId: string, option: any, sheetIdx: number): void; + + /** This method used to change the sparkline type in the spreadsheet. + * @param {string} Pass the sparkline ID + * @param {string} Pass the sparkline type + * @param {number} Optional. Pass the sheet index + * @returns {void} + */ + changeType(sparklineId: string, type: string, sheetIdx: number): void; + } + export interface XLValidate { /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. @@ -43737,6 +43828,11 @@ declare namespace ej { */ allowSorting?: boolean; + /** Gets or sets a value that indicates whether to enable the sparkline feature in the Spreadsheet. + * @Default {false} + */ + allowSparkline?: boolean; + /** Gets or sets a value that indicates whether to enable or disable undo and redo feature in the Spreadsheet. * @Default {true} */ diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 6d8adebae2..740ff1308c 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -6,6 +6,7 @@ // Chris Krycho // Theron Cross // Martin Feckie +// Alex LaFroscia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -3408,6 +3409,7 @@ declare module '@ember/application/resolver' { declare module '@ember/array' { import Ember from 'ember'; + type EmberArray = Ember.Array; const EmberArray: typeof Ember.Array; export default EmberArray; export const A: typeof Ember.A; @@ -3417,6 +3419,7 @@ declare module '@ember/array' { declare module '@ember/array/mutable' { import Ember from 'ember'; + type MutableArray = Ember.MutableArray; const MutableArray: typeof Ember.MutableArray; export default MutableArray; } @@ -3496,6 +3499,7 @@ declare module '@ember/engine/instance' { declare module '@ember/enumerable' { import Ember from 'ember'; + type Enumerable = Ember.Enumerable; const Enumerable: typeof Ember.Enumerable; export default Enumerable; } @@ -3584,6 +3588,7 @@ declare module '@ember/object/core' { declare module '@ember/object/evented' { import Ember from 'ember'; + type Evented = Ember.Evented; const Evented: typeof Ember.Evented; export default Evented; export const on: typeof Ember.on; @@ -3610,6 +3615,7 @@ declare module '@ember/object/mixin' { declare module '@ember/object/observable' { import Ember from 'ember'; + type Observable = Ember.Observable; const Observable: typeof Ember.Observable; export default Observable; } @@ -3622,6 +3628,7 @@ declare module '@ember/object/observers' { declare module '@ember/object/promise-proxy-mixin' { import Ember from 'ember'; + type PromiseProxyMixin = Ember.PromiseProxyMixin; const PromiseProxyMixin: typeof Ember.PromiseProxyMixin; export default PromiseProxyMixin; } diff --git a/types/escape-regexp/escape-regexp-tests.ts b/types/escape-regexp/escape-regexp-tests.ts new file mode 100644 index 0000000000..086ff36348 --- /dev/null +++ b/types/escape-regexp/escape-regexp-tests.ts @@ -0,0 +1,22 @@ +import escapeRegExp = require('escape-regexp'); + +// $ExpectType string +escapeRegExp('aaa'); + +// $ExpectError +escapeRegExp(); + +// $ExpectError +escapeRegExp({}); + +// $ExpectError +escapeRegExp(1); + +// $ExpectError +escapeRegExp([]); + +// $ExpectError +escapeRegExp(null); + +// $ExpectError +escapeRegExp(undefined); diff --git a/types/escape-regexp/index.d.ts b/types/escape-regexp/index.d.ts new file mode 100644 index 0000000000..b1a0ff1edf --- /dev/null +++ b/types/escape-regexp/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for escape-regexp 0.0 +// Project: https://www.npmjs.com/package/escape-regexp +// Definitions by: Vilim Stubičan +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +declare function escapeRegExp(str: string): string; + +export = escapeRegExp; diff --git a/types/escape-regexp/tsconfig.json b/types/escape-regexp/tsconfig.json new file mode 100644 index 0000000000..1037db1961 --- /dev/null +++ b/types/escape-regexp/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", + "escape-regexp-tests.ts" + ] +} diff --git a/types/escape-regexp/tslint.json b/types/escape-regexp/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/escape-regexp/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts new file mode 100644 index 0000000000..979c34394d --- /dev/null +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -0,0 +1,29 @@ +import { ElementHandle, Page } from "puppeteer"; + +const testGlobal = async (instance: ElementHandle | Page) => { + await expect(instance).toClick("selector"); + await expect(instance).toClick("selector", { polling: "mutation", text: "text" }); + await expect(instance).toClick("selector", { polling: "raf", timeout: 777 }); + + await expect(instance).toDisplayDialog(async () => {}); + + await expect(instance).toFill("selector", "value"); + await expect(instance).toFill("selector", "value", { polling: 777 }); + + await expect(instance).toMatchElement("selector", "value"); + await expect(instance).toMatchElement("selector", "value", { polling: "mutation" }); + + await expect(instance).toSelect("selector", "valueOrText"); + await expect(instance).toSelect("selector", "valueOrText", { polling: "raf" }); + + await expect(instance).toUploadFile("selector", "filePath"); + await expect(instance).toUploadFile("selector", "filePath", { timeout: 777 }); +}; + +const testImported = async (instance: ElementHandle | Page) => { + const expectPuppeteer = await import("expect-puppeteer"); + + await expectPuppeteer(instance).toClick("selector"); + await expect(instance).toClick("selector", { polling: "mutation", text: "text" }); + await expect(instance).toClick("selector", { polling: "raf", timeout: 777 }); +}; diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts new file mode 100644 index 0000000000..12f19c785d --- /dev/null +++ b/types/expect-puppeteer/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for expect-puppeteer 2.2 +// Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/expect-puppeteer +// Definitions by: Josh Goldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +/// + +import { ElementHandle, Page } from "puppeteer"; + +/** + * Interval at which pageFunctions may be executed. + */ +type ExpectPolling = number | "mutation" | "raf"; + +/** + * Configures how to poll for an element. + */ +interface ExpectTimingActions { + /** + * An interval at which the pageFunction is executed. Defaults to "raf". + */ + polling?: ExpectPolling; + + /** + * Maximum time to wait for in milliseconds. Defaults to 500. + */ + timeout?: number; +} + +interface ExpectToClickOptions extends ExpectTimingActions { + /** + * A text or a RegExp to match in element textContent. + */ + text?: string | RegExp; +} + +interface ExpectPuppeteer { + toClick(selector: string, options?: ExpectToClickOptions): Promise; + toDisplayDialog(block: () => Promise): Promise; + toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; + toMatchElement(selector: string, value: string, options?: ExpectTimingActions): Promise; + toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise; + toUploadFile(selector: string, filePath: string, options?: ExpectTimingActions): Promise; +} + +declare global { + namespace jest { + // tslint:disable-next-line no-empty-interface + interface Matchers extends ExpectPuppeteer { } + } +} + +declare function expectPuppeteer(instance: ElementHandle | Page): ExpectPuppeteer; +export = expectPuppeteer; diff --git a/types/expect-puppeteer/tsconfig.json b/types/expect-puppeteer/tsconfig.json new file mode 100644 index 0000000000..7ca516e3c2 --- /dev/null +++ b/types/expect-puppeteer/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "expect-puppeteer-tests.ts" + ] +} diff --git a/types/expect-puppeteer/tslint.json b/types/expect-puppeteer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/expect-puppeteer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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/express-flash/express-flash-tests.ts b/types/express-flash/express-flash-tests.ts new file mode 100644 index 0000000000..c6212c6906 --- /dev/null +++ b/types/express-flash/express-flash-tests.ts @@ -0,0 +1,12 @@ +import express = require('express'); +import flash = require('express-flash'); + +const app = express(); + +app.use(flash()); + +app.use((req) => { + req.flash(); + req.flash('message'); + req.flash('event', 'message'); +}); diff --git a/types/express-flash/index.d.ts b/types/express-flash/index.d.ts new file mode 100644 index 0000000000..e0b00b8d80 --- /dev/null +++ b/types/express-flash/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for express-flash 0.0 +// Project: https://github.com/RGBboy/express-flash +// Definitions by: Ian Mobley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +import express = require('express'); +declare function flash(): express.RequestHandler; +export = flash; diff --git a/types/express-flash/tsconfig.json b/types/express-flash/tsconfig.json new file mode 100644 index 0000000000..5fbfc5aefd --- /dev/null +++ b/types/express-flash/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", + "express-flash-tests.ts" + ] +} diff --git a/types/express-flash/tslint.json b/types/express-flash/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/express-flash/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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 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(); +} diff --git a/types/gitlab/ApiBase.d.ts b/types/gitlab/ApiBase.d.ts new file mode 100644 index 0000000000..7187ce4352 --- /dev/null +++ b/types/gitlab/ApiBase.d.ts @@ -0,0 +1,31 @@ +import { ApiBaseOptions } from './ApiBase'; +import { Labels } from './Models/Labels'; +import { Users } from './Models/Users'; +import { Notes } from './Models/Notes'; +import { Issues } from './Models/Issues'; +import { Projects } from './Models/Projects'; +import { Groups } from './Models/Groups'; + +export interface ApiBaseOptions { + url?: string; + token?: string; + oauth_token?: string; + base_url?: string; + auth?: any; + [key: string]: any; +} + +export class ApiBase { + constructor(options: ApiBaseOptions); + readonly client: this; + readonly groups: Groups + readonly projects: Projects + readonly issues: Issues + readonly notes: Notes + readonly users: Users + readonly labels: Labels + options: ApiBaseOptions; + + handleOptions(): void; + init(): object; +} diff --git a/types/gitlab/ApiBaseHTTP.d.ts b/types/gitlab/ApiBaseHTTP.d.ts new file mode 100644 index 0000000000..7ed5fb0d69 --- /dev/null +++ b/types/gitlab/ApiBaseHTTP.d.ts @@ -0,0 +1,12 @@ +import { ApiBase } from './ApiBase'; + +export class ApiBaseHTTP extends ApiBase { + prepare_opts(opts: T): T; + fn_wrapper(fn: T): T; + get(path: string, fn?: Function): any; + get(path: string, query?: object, fn?: Function): any; + delete(path: string, fn?: Function): any; + post(path: string, data?: object, fn?: Function): any; + put(path: string, data?: object, fn?: Function): any; + patch(path: string, data?: object, fn?: Function): any; +} diff --git a/types/gitlab/ApiV3.d.ts b/types/gitlab/ApiV3.d.ts new file mode 100644 index 0000000000..bd3d02557b --- /dev/null +++ b/types/gitlab/ApiV3.d.ts @@ -0,0 +1,5 @@ +import { ApiBaseHTTP } from './ApiBaseHTTP'; + +export class ApiV3 extends ApiBaseHTTP { + +} diff --git a/types/gitlab/BaseModel.d.ts b/types/gitlab/BaseModel.d.ts new file mode 100644 index 0000000000..ca6eb4e7c6 --- /dev/null +++ b/types/gitlab/BaseModel.d.ts @@ -0,0 +1,17 @@ +export class BaseModel { + load(model: string): object; + get(path: string, fn?: Function): any; + get(path: string, query?: object, fn?: Function): any; + delete(path: string, fn?: Function): any; + post(path: string, data?: object, fn?: Function): any; + put(path: string, data?: object, fn?: Function): any; + patch(path: string, data?: object, fn?: Function): any; +} + +export interface DefParams { + page?: number; + per_page?: number; + [key: string]: any; +} + +export type TId = number | string; diff --git a/types/gitlab/Models/Groups.d.ts b/types/gitlab/Models/Groups.d.ts new file mode 100644 index 0000000000..1b528039f0 --- /dev/null +++ b/types/gitlab/Models/Groups.d.ts @@ -0,0 +1,27 @@ +import { BaseModel, DefParams } from "../BaseModel"; + +interface IAccessLevels { + GUEST: number + REPORTER: number + DEVELOPER: number + MASTER: number + OWNER: number +} + +export class Groups extends BaseModel { + readonly access_levels: IAccessLevels; + + init(): object; + all(fn?: Function): any; + all(params?: DefParams, fn?: Function): any; + show(groupId: number, fn?: Function): any; + listProjects(groupId: number, fn?: Function): any; + listMembers(groupId: number, fn?: Function): any; + addMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; + editMember(groupId: number, userId: number, accessLevel: IAccessLevels[keyof IAccessLevels], fn?: Function): any; + removeMember(groupId: number, userId: number, fn?: Function): any; + create(params?: object, fn?: Function): any; + addProject(groupId: number, projectId: number, fn?: Function): any; + deleteGroup(groupId: number, fn?: Function): any; + search(nameOrPath: string, fn?: Function): any; +} diff --git a/types/gitlab/Models/IssueNotes.d.ts b/types/gitlab/Models/IssueNotes.d.ts new file mode 100644 index 0000000000..de1821b1df --- /dev/null +++ b/types/gitlab/Models/IssueNotes.d.ts @@ -0,0 +1,6 @@ +import { BaseModel, TId, DefParams } from '../BaseModel'; + +export class IssueNotes extends BaseModel{ + all(projectId: TId, issueId: number, fn?: Function): any + all(projectId: TId, issueId: number, params?: DefParams, fn?: Function): any +} diff --git a/types/gitlab/Models/Issues.d.ts b/types/gitlab/Models/Issues.d.ts new file mode 100644 index 0000000000..e751b6a002 --- /dev/null +++ b/types/gitlab/Models/Issues.d.ts @@ -0,0 +1,12 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class Issues extends BaseModel { + all(fn?: Function): any; + all(params?: object, fn?: Function): any; + show(projectId: TId, issueId: TId, fn?: Function): any; + create(projectId: TId, params?: object, fn?: Function): any; + edit(projectId: TId, issueId: TId, params?: object, fn?: Function): any; + remove(projectId: TId, issueId: TId, fn?: Function): any; + subscribe(projectId: TId, issueId: TId, params?: object, fn?: Function): any; + unsubscribe(projectId: TId, issueId: TId, fn?: Function): any; +} diff --git a/types/gitlab/Models/Labels.d.ts b/types/gitlab/Models/Labels.d.ts new file mode 100644 index 0000000000..63f1110b4d --- /dev/null +++ b/types/gitlab/Models/Labels.d.ts @@ -0,0 +1,5 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class Labels extends BaseModel { + create(projectId: TId, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/Notes.d.ts b/types/gitlab/Models/Notes.d.ts new file mode 100644 index 0000000000..95b9cd623e --- /dev/null +++ b/types/gitlab/Models/Notes.d.ts @@ -0,0 +1,5 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class Notes extends BaseModel { + create(projectId: TId, issueId: number, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/Pipelines.d.ts b/types/gitlab/Models/Pipelines.d.ts new file mode 100644 index 0000000000..f65a9e7d25 --- /dev/null +++ b/types/gitlab/Models/Pipelines.d.ts @@ -0,0 +1,5 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class Pipelines extends BaseModel { + all(projectId: TId, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectBuilds.d.ts b/types/gitlab/Models/ProjectBuilds.d.ts new file mode 100644 index 0000000000..df7c33c32a --- /dev/null +++ b/types/gitlab/Models/ProjectBuilds.d.ts @@ -0,0 +1,13 @@ +import { BaseModel, TId, DefParams } from '../BaseModel'; + +interface IShowBuildParam { + projectId: TId; + [key: string]: any; +} + +export class ProjectBuilds extends BaseModel { + listBuilds(projectId: TId, fn?: Function): any; + listBuilds(projectId: TId, params?: DefParams, fn?: Function): any; + showBuild(projectId: TId, buildId: string, fn?: Function): any; + triggerBuild(params?: IShowBuildParam, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectDeployKeys.d.ts b/types/gitlab/Models/ProjectDeployKeys.d.ts new file mode 100644 index 0000000000..3be9d66bc4 --- /dev/null +++ b/types/gitlab/Models/ProjectDeployKeys.d.ts @@ -0,0 +1,7 @@ +import { BaseModel, TId } from '../BaseModel'; + +export class ProjectKeys extends BaseModel { + listKeys(projectId: TId, fn?: Function): any; + getKey(projectId: TId, keyId: number, fn?: Function): any; + addKey(projectId: TId, params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectHooks.d.ts b/types/gitlab/Models/ProjectHooks.d.ts new file mode 100644 index 0000000000..ce0878eec9 --- /dev/null +++ b/types/gitlab/Models/ProjectHooks.d.ts @@ -0,0 +1,16 @@ +import { BaseModel, TId } from '../BaseModel'; + +interface IAddParam { + url: string; + [key: string]: any; +} + +type HooksCb = (hooks: any[]) => any; + +export class ProjectHooks extends BaseModel { + list(projectId: TId, fn?: HooksCb): any; + show(projectId: TId, hookId: number, fn?: Function): any; + add(projectId: TId, params: IAddParam | string, fn?: Function): any; + update(projectId: TId, hookId: number, url: string, fn?: Function): any; + remove(projectId: TId, hookId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectIssues.d.ts b/types/gitlab/Models/ProjectIssues.d.ts new file mode 100644 index 0000000000..8f7fc439a6 --- /dev/null +++ b/types/gitlab/Models/ProjectIssues.d.ts @@ -0,0 +1,9 @@ +import { IssueNotes } from './IssueNotes'; +import { BaseModel, TId, DefParams } from '../BaseModel'; + +export class ProjectIssues extends BaseModel { + readonly notes: IssueNotes; + + list(projectId: TId, fn?: Function): any; + list(projectId: TId, params?: DefParams, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectLabels.d.ts b/types/gitlab/Models/ProjectLabels.d.ts new file mode 100644 index 0000000000..2f6ca1dabc --- /dev/null +++ b/types/gitlab/Models/ProjectLabels.d.ts @@ -0,0 +1,6 @@ +import { BaseModel, TId, DefParams } from '../BaseModel'; + +export class ProjectLabels extends BaseModel { + all(projectId: TId, fn?: Function): any; + all(projectId: TId, params?: DefParams, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMembers.d.ts b/types/gitlab/Models/ProjectMembers.d.ts new file mode 100644 index 0000000000..25aa87332a --- /dev/null +++ b/types/gitlab/Models/ProjectMembers.d.ts @@ -0,0 +1,12 @@ +import { BaseModel, TId } from '../BaseModel'; + +type MenberCb = (menber: any) => any; +type MenbersCb = (menbers: any[]) => any; + +export class ProjectMembers extends BaseModel { + list(projectId: TId, fn?: MenbersCb): any; + show(projectId: TId, userId: number, fn?: MenberCb): any; + add(projectId: TId, userId: number, accessLevel: number,fn?: Function): any; + update(projectId: TId, userId: number, accessLevel: number, fn?: Function): any; + remove(projectId: TId, userId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMergeRequests.d.ts b/types/gitlab/Models/ProjectMergeRequests.d.ts new file mode 100644 index 0000000000..37b2ab33e6 --- /dev/null +++ b/types/gitlab/Models/ProjectMergeRequests.d.ts @@ -0,0 +1,11 @@ +import { BaseModel, TId, DefParams } from '../BaseModel'; + +export class ProjectMergeRequests extends BaseModel { + list(projectId: TId, fn?: Function): any; + list(projectId: TId, params?: DefParams, fn?: Function): any; + show(projectId: TId, mergerequestId: number, fn?: Function): any; + add(projectId: TId, sourceBranch: string, targetBranch: string, assigneeId: number, title: string, fn?: Function): any; + update(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; + comment(projectId: TId, mergerequestId: number, note: any, fn?: Function): any; + merge(projectId: TId, mergerequestId: number, params: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectMilestones.d.ts b/types/gitlab/Models/ProjectMilestones.d.ts new file mode 100644 index 0000000000..d36d1c016a --- /dev/null +++ b/types/gitlab/Models/ProjectMilestones.d.ts @@ -0,0 +1,12 @@ +import { BaseModel, TId } from '../BaseModel'; + +type MilestonesCb = (milestones: any[]) => any; +type MilestoneCb = (milestones: any) => any; + +export class ProjectMilestones extends BaseModel { + list(projectId: TId, fn?: MilestonesCb): any; + all(projectId: TId, fn?: MilestonesCb): any; + show(projectId: TId, milestoneId: number, fn?: MilestoneCb): any; + add(projectId: TId, title: string, description: string, due_date: any, fn?: Function): any; + update(projectId: TId, milestoneId: number, title: string, description: string, due_date: any, state_event: any, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectRepository.d.ts b/types/gitlab/Models/ProjectRepository.d.ts new file mode 100644 index 0000000000..7bef1b6212 --- /dev/null +++ b/types/gitlab/Models/ProjectRepository.d.ts @@ -0,0 +1,39 @@ +import { BaseModel, TId } from '../BaseModel'; + +interface ShowFileParams { + file_path: string; + ref?: any; + file_id?: any; + [key: string]: any; +} + +interface AddTagParams { + id: TId; + tag_name: string; + ref: string; + message?: string; + release_description?: string; +} + +export class ProjectRepository extends BaseModel { + listBranches(projectId: TId, fn?: Function): any; + showBranch(projectId: TId, branchId: string, fn?: Function): any; + protectBranch(projectId: TId, branchId: string, params: object, fn?: Function): any; + unprotectBranch(projectId: TId, branchId: string, fn?: Function): any; + createBranch(params: object, fn?: Function): any; + deleteBranch(projectId: TId, branchId: string, fn?: Function): any; + addTag(params: AddTagParams, fn?: Function): any; + deleteTag(projectId: TId, tagName: string, fn?: Function): any; + showTag(projectId: TId, tagName: string, fn?: Function): any; + listTags(projectId: TId, fn?: Function): any; + listCommits(projectId: TId, fn?: Function): any; + showCommit(projectId: TId, sha: string, fn?: Function): any; + diffCommit(projectId: TId, sha: string, fn?: Function): any; + listTree(projectId: TId, fn?: Function): any; + listTree(projectId: TId, params?: object, fn?: Function): any; + showFile(projectId: TId, fn?: Function): any; + showFile(projectId: TId, params?: ShowFileParams, fn?: Function): any; + createFile(params?: object, fn?: Function): any; + updateFile(params?: object, fn?: Function): any; + compare(params?: object, fn?: Function): any; +} diff --git a/types/gitlab/Models/ProjectServices.d.ts b/types/gitlab/Models/ProjectServices.d.ts new file mode 100644 index 0000000000..25c59ae400 --- /dev/null +++ b/types/gitlab/Models/ProjectServices.d.ts @@ -0,0 +1,9 @@ +import { BaseModel, TId } from './../BaseModel'; + +type ServiceCb = (service: any) => any; + +export class ProjectServices extends BaseModel { + show(projectId: TId, serviceName: string, fn?: ServiceCb): any; + update(projectId: TId, serviceName: string, params: object, fn?: ServiceCb): any; + remove(projectId: TId, serviceName: string, fn?: ServiceCb): any; +} diff --git a/types/gitlab/Models/Projects.d.ts b/types/gitlab/Models/Projects.d.ts new file mode 100644 index 0000000000..9ba8faa551 --- /dev/null +++ b/types/gitlab/Models/Projects.d.ts @@ -0,0 +1,55 @@ +import { Runners } from './Runners'; +import { Pipelines } from './Pipelines'; +import { ProjectBuilds } from './ProjectBuilds'; +import { ProjectMergeRequests } from './ProjectMergeRequests'; +import { ProjectKeys } from './ProjectDeployKeys'; +import { ProjectMilestones } from './ProjectMilestones'; +import { ProjectRepository } from './ProjectRepository'; +import { ProjectLabels } from './ProjectLabels'; +import { ProjectIssues } from './ProjectIssues'; +import { ProjectHooks } from './ProjectHooks'; +import { ProjectMembers } from './ProjectMembers'; +import { BaseModel, DefParams, TId } from '../BaseModel'; +import { ProjectServices } from './ProjectServices'; + +type ProjectsCb = (projects: any[]) => any; + +export class Projects extends BaseModel { + + readonly members: ProjectMembers; + readonly hooks: ProjectHooks; + readonly issues: ProjectIssues; + readonly labels: ProjectLabels; + readonly repository: ProjectRepository; + readonly milestones: ProjectMilestones; + readonly deploy_keys: ProjectKeys; + readonly merge_requests: ProjectMergeRequests; + readonly services: ProjectServices; + readonly builds: ProjectBuilds; + readonly pipelines: Pipelines; + readonly runners: Runners; + + + all(fn?: ProjectsCb): any; + all(params?: DefParams, fn?: ProjectsCb): any; + allAdmin(fn?: Function): any; + allAdmin(params?: DefParams, fn?: Function): any; + show(projectId: TId, fn?: Function): any; + create(params: object, fn?: Function): any; + create_for_user(params: object, fn?: Function): any; + edit(projectId: TId, params: object, fn?: Function): any; + addMember(params?: object, fn?: Function): any; + editMember(params?: object, fn?: Function): any; + listMembers(params?: object, fn?: Function): any; + listCommits(params?: object, fn?: Function): any; + listTags(params?: object, fn?: Function): any; + remove(projectId: TId, fn?: Function): any; + fork(params?: object, fn?: Function): any; + share(params?: object, fn?: Function): any; + search(projectName: string, fn?: Function): any; + search(projectName: string, params?: object, fn?: Function): any; + listTriggers(projectId: TId, fn?: Function): any; + showTrigger(projectId: TId, token: string, fn?: Function): any; + createTrigger(params?: object, fn?: Function): any; + removeTrigger(projectId: TId, token: string, fn?: Function): any; +} diff --git a/types/gitlab/Models/Runners.d.ts b/types/gitlab/Models/Runners.d.ts new file mode 100644 index 0000000000..1656fe0c5d --- /dev/null +++ b/types/gitlab/Models/Runners.d.ts @@ -0,0 +1,11 @@ +import { BaseModel, DefParams, TId } from '../BaseModel'; + +export class Runners extends BaseModel { + all(projectId?: TId, fn?: Function): any; + all(projectId?: TId, params?: object, fn?: Function): any; + show(runnerId: number, fn?: Function): any; + update(runnerId: number, attributes: any, fn?: Function): any; + remove(runnerId: number, projectId: any, enable: any, fn?: Function): any; + enable(projectId: TId, runnerId: number, fn?: Function): any; + disable(projectId: TId, runnerId: number, fn?: Function): any; +} diff --git a/types/gitlab/Models/UserKeys.d.ts b/types/gitlab/Models/UserKeys.d.ts new file mode 100644 index 0000000000..5182b5a2d1 --- /dev/null +++ b/types/gitlab/Models/UserKeys.d.ts @@ -0,0 +1,6 @@ +import { BaseModel, DefParams, TId } from '../BaseModel'; + +export class UserKeys extends BaseModel { + all(userId?: TId, fn?: Function): any; + addKey(userId: string, title: string, key: any, fn?: Function): any; +} diff --git a/types/gitlab/Models/Users.d.ts b/types/gitlab/Models/Users.d.ts new file mode 100644 index 0000000000..e4572ac659 --- /dev/null +++ b/types/gitlab/Models/Users.d.ts @@ -0,0 +1,17 @@ +import { BaseModel, DefParams, TId } from '../BaseModel'; +import { UserKeys } from './UserKeys'; + +type UsersCb = (users: any[]) => any; +type UserCb = (user: any) => any; + +export class Users extends BaseModel { + readonly keys: UserKeys; + + all(fn?: UsersCb): any; + all(params?: DefParams, fn?: UsersCb): any; + current(fn?: Function): any; + show(userId: number, fn?: UserCb): any; + create(params?: DefParams, fn?: Function): any; + session(email: string, password: string, fn?: Function): any; + search(emailOrUsername: string, fn?: Function): any; +} diff --git a/types/gitlab/gitlab-tests.ts b/types/gitlab/gitlab-tests.ts new file mode 100644 index 0000000000..00ab2c761e --- /dev/null +++ b/types/gitlab/gitlab-tests.ts @@ -0,0 +1,20 @@ +import * as lib from "gitlab"; + +const gitlab = lib({ + url: 'http://example.com', + token: 'abcdefghij123456' +}); + +const v3 = new lib.ApiV3({ }); + +// From README + +// Listing users +gitlab.users.all((users) => { }); + +// Listing projects +gitlab.projects.all((projects) => { }); + +// From examples/delet-service + +gitlab.projects.services.remove("pid", "name", (service) => { }); diff --git a/types/gitlab/index.d.ts b/types/gitlab/index.d.ts new file mode 100644 index 0000000000..1ff52505ee --- /dev/null +++ b/types/gitlab/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for gitlab 1.8 +// Project: https://github.com/node-gitlab/node-gitlab#readme +// Definitions by: sam +// AryloYeung +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import { ApiV3 } from "./ApiV3"; +import { ApiBaseOptions } from "./ApiBase"; + +declare namespace Gitlib { + const ApiV3: new(options: ApiBaseOptions) => ApiV3; +} + +declare function Gitlib(options: ApiBaseOptions): ApiV3; + +export = Gitlib; diff --git a/types/gitlab/tsconfig.json b/types/gitlab/tsconfig.json new file mode 100644 index 0000000000..f1297faf67 --- /dev/null +++ b/types/gitlab/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", + "gitlab-tests.ts" + ] +} diff --git a/types/gitlab/tslint.json b/types/gitlab/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/gitlab/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } 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, diff --git a/types/graphql/error/GraphQLError.d.ts b/types/graphql/error/GraphQLError.d.ts index a4aa3f17c6..0be931bee0 100644 --- a/types/graphql/error/GraphQLError.d.ts +++ b/types/graphql/error/GraphQLError.d.ts @@ -1,6 +1,7 @@ import { getLocation } from "../language"; import { ASTNode } from "../language/ast"; import { Source } from "../language/source"; +import { SourceLocation } from "../language/location"; /** * A GraphQLError describes an Error found during the parse, validate, or @@ -13,6 +14,8 @@ export class GraphQLError extends Error { * A message describing the Error for debugging purposes. * * Enumerable, and appears in the result of JSON.stringify(). + * + * Note: should be treated as readonly, despite invariant usage. */ message: string; @@ -26,7 +29,7 @@ export class GraphQLError extends Error { * * Enumerable, and appears in the result of JSON.stringify(). */ - locations?: Array<{ line: number; column: number }> | undefined; + readonly locations: ReadonlyArray | undefined; /** * An array describing the JSON-path into the execution response which @@ -34,41 +37,41 @@ export class GraphQLError extends Error { * * Enumerable, and appears in the result of JSON.stringify(). */ - path?: Array | undefined; + readonly path: ReadonlyArray | undefined; /** * An array of GraphQL AST Nodes corresponding to this error. */ - nodes?: ASTNode[] | undefined; + readonly nodes: ReadonlyArray | undefined; /** * The source GraphQL document corresponding to this error. */ - source?: Source | undefined; + readonly source: Source | undefined; /** * An array of character offsets within the source GraphQL document * which correspond to this error. */ - positions?: number[] | undefined; + readonly positions: ReadonlyArray | undefined; /** * The original error thrown from a field resolver during execution. */ - originalError?: Error; + readonly originalError: Error | void; /** * Extension fields to add to the formatted error. */ - extensions?: { [key: string]: any } | undefined; + readonly extensions: { [key: string]: any } | void; constructor( message: string, - nodes?: any[], - source?: Source, - positions?: number[], - path?: Array, - originalError?: Error, - extensions?: { [key: string]: any } + nodes?: ReadonlyArray | ASTNode | undefined, + source?: Source | void, + positions?: ReadonlyArray | void, + path?: ReadonlyArray | void, + originalError?: Error | void, + extensions?: { [key: string]: any } | void ); } diff --git a/types/graphql/error/formatError.d.ts b/types/graphql/error/formatError.d.ts index a683da0375..7f13117cf0 100644 --- a/types/graphql/error/formatError.d.ts +++ b/types/graphql/error/formatError.d.ts @@ -1,4 +1,5 @@ import { GraphQLError } from "./GraphQLError"; +import { SourceLocation } from "../language/location"; /** * Given a GraphQLError, format it according to the rules described by the @@ -7,12 +8,9 @@ import { GraphQLError } from "./GraphQLError"; export function formatError(error: GraphQLError): GraphQLFormattedError; export interface GraphQLFormattedError { - message: string; - locations?: GraphQLErrorLocation[]; - path?: Array; -} - -export interface GraphQLErrorLocation { - line: number; - column: number; + readonly message: string; + readonly locations: ReadonlyArray | undefined; + readonly path: ReadonlyArray | undefined; + // Extensions + readonly [key: string]: any; } diff --git a/types/graphql/error/index.d.ts b/types/graphql/error/index.d.ts index 8d81175bcc..bed0763ed3 100644 --- a/types/graphql/error/index.d.ts +++ b/types/graphql/error/index.d.ts @@ -1,4 +1,5 @@ export { GraphQLError } from "./GraphQLError"; export { syntaxError } from "./syntaxError"; export { locatedError } from "./locatedError"; -export { formatError, GraphQLFormattedError, GraphQLErrorLocation } from "./formatError"; +export { printError } from "./printError"; +export { formatError, GraphQLFormattedError } from "./formatError"; diff --git a/types/graphql/error/locatedError.d.ts b/types/graphql/error/locatedError.d.ts index c41fd0df50..77dd470c63 100644 --- a/types/graphql/error/locatedError.d.ts +++ b/types/graphql/error/locatedError.d.ts @@ -1,8 +1,13 @@ import { GraphQLError } from "./GraphQLError"; +import { ASTNode } from "../language/ast"; /** * Given an arbitrary Error, presumably thrown while attempting to execute a * GraphQL operation, produce a new GraphQLError aware of the location in the * document responsible for the original Error. */ -export function locatedError(originalError: Error, nodes: T[], path: Array): GraphQLError; +export function locatedError( + originalError: Error, + nodes: ReadonlyArray, + path: ReadonlyArray +): GraphQLError; diff --git a/types/graphql/error/printError.d.ts b/types/graphql/error/printError.d.ts new file mode 100644 index 0000000000..924682f471 --- /dev/null +++ b/types/graphql/error/printError.d.ts @@ -0,0 +1,7 @@ +import { GraphQLError } from "./GraphQLError"; + +/** + * Prints a GraphQLError to a string, representing useful location information + * about the error's position in the source. + */ +export function printError(error: GraphQLError): string; diff --git a/types/graphql/execution/execute.d.ts b/types/graphql/execution/execute.d.ts index 387a3d4d73..424bb62b5a 100644 --- a/types/graphql/execution/execute.d.ts +++ b/types/graphql/execution/execute.d.ts @@ -1,6 +1,12 @@ import { GraphQLError, locatedError } from "../error"; import { GraphQLSchema } from "../type/schema"; -import { GraphQLField, GraphQLFieldResolver, ResponsePath } from "../type/definition"; +import { + GraphQLField, + GraphQLFieldResolver, + ResponsePath, + GraphQLObjectType, + GraphQLResolveInfo, +} from "../type/definition"; import { DirectiveNode, DocumentNode, @@ -10,6 +16,8 @@ import { InlineFragmentNode, FragmentDefinitionNode, } from "../language/ast"; +import { MaybePromise } from "../jsutils/MaybePromise"; + /** * Data that must be available at all points during query execution. * @@ -20,6 +28,7 @@ export interface ExecutionContext { schema: GraphQLSchema; fragments: { [key: string]: FragmentDefinitionNode }; rootValue: any; + contextValue: any; operation: OperationDefinitionNode; variableValues: { [key: string]: any }; fieldResolver: GraphQLFieldResolver; @@ -27,15 +36,14 @@ export interface ExecutionContext { } /** - * The result of execution. `data` is the result of executing the - * query, `extensions` represents additional metadata, `errors` is - * null if no errors occurred, and is a - * non-empty array if an error occurred. + * The result of GraphQL execution. + * + * - `errors` is included when any errors occurred as a non-empty array. + * - `data` is the result of a successful execution of the query. */ export interface ExecutionResult { + errors?: ReadonlyArray; data?: { [key: string]: any }; - extensions?: { [key: string]: any }; - errors?: GraphQLError[]; } export type ExecutionArgs = { @@ -43,41 +51,114 @@ export type ExecutionArgs = { document: DocumentNode; rootValue?: any; contextValue?: any; - variableValues?: { [key: string]: any }; - operationName?: string; - fieldResolver?: GraphQLFieldResolver; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; }; /** * Implements the "Evaluating requests" section of the GraphQL specification. * - * Returns a Promise that will eventually be resolved and never rejected. + * Returns either a synchronous ExecutionResult (if all encountered resolvers + * are synchronous), or a Promise of an ExecutionResult that will eventually be + * resolved and never rejected. * * If the arguments to this function do not result in a legal execution context, * a GraphQLError will be thrown immediately explaining the invalid input. * * Accepts either an object with named arguments, or individual arguments. */ -export function execute(args: ExecutionArgs): Promise; +export function execute(args: ExecutionArgs): MaybePromise; export function execute( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver -): Promise; + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): MaybePromise; /** * Given a ResponsePath (found in the `path` entry in the information provided * as the last argument to a field resolver), return an Array of the path keys. */ -export function responsePathAsArray(path: ResponsePath): Array; +export function responsePathAsArray(path: ResponsePath): ReadonlyArray; -export function addPath(prev: ResponsePath, key: string | number): any; +/** + * Given a ResponsePath and a key, return a new ResponsePath containing the + * new key. + */ +export function addPath( + prev: ResponsePath | undefined, + key: string | number +): { prev: ResponsePath | undefined; key: string | number }; + +/** + * Essential assertions before executing to provide developer feedback for + * improper use of the GraphQL library. + */ +export function assertValidExecutionArguments( + schema: GraphQLSchema, + document: DocumentNode, + rawVariableValues: { [key: string]: any } | void +): void; + +/** + * Constructs a ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * Throws a GraphQLError if a valid execution context cannot be created. + */ +export function buildExecutionContext( + schema: GraphQLSchema, + document: DocumentNode, + rootValue: any, + contextValue: any, + rawVariableValues: { [key: string]: any } | void, + operationName: string | void, + fieldResolver: GraphQLFieldResolver | void +): ReadonlyArray | ExecutionContext; + +/** + * Extracts the root type of the operation from the schema. + */ +export function getOperationRootType(schema: GraphQLSchema, operation: OperationDefinitionNode): GraphQLObjectType; + +/** + * Given a selectionSet, adds all of the fields in that selection to + * the passed in map of fields, and returns it at the end. + * + * CollectFields requires the "runtime type" of an object. For a field which + * returns an Interface or Union type, the "runtime type" will be the actual + * Object type returned by that field. + */ +export function collectFields( + exeContext: ExecutionContext, + runtimeType: GraphQLObjectType, + selectionSet: SelectionSetNode, + fields: { [key: string]: Array }, + visitedFragmentNames: { [key: string]: boolean } +): { [key: string]: Array }; + +export function buildResolveInfo( + exeContext: ExecutionContext, + fieldDef: GraphQLField, + fieldNodes: ReadonlyArray, + parentType: GraphQLObjectType, + path: ResponsePath +): GraphQLResolveInfo; + +// Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` +// function. Returns the result of resolveFn or the abrupt-return Error object. +export function resolveFieldValueOrError( + exeContext: ExecutionContext, + fieldDef: GraphQLField, + fieldNodes: ReadonlyArray, + resolveFn: GraphQLFieldResolver, + source: TSource, + info: GraphQLResolveInfo +): Error | any; /** * If a resolve function is not given, then a default resolve behavior is used @@ -86,3 +167,18 @@ export function addPath(prev: ResponsePath, key: string | number): any; * of calling that function while passing along args and context. */ export const defaultFieldResolver: GraphQLFieldResolver; + +/** + * This method looks up the field on the given type defintion. + * It has special casing for the two introspection fields, __schema + * and __typename. __typename is special because it can always be + * queried as a field, even in situations where no other fields + * are allowed, like on a Union. __schema could get automatically + * added to the query type, but that would require mutating type + * definitions, which would cause issues. + */ +export function getFieldDef( + schema: GraphQLSchema, + parentType: GraphQLObjectType, + fieldName: string +): GraphQLField | void; diff --git a/types/graphql/execution/values.d.ts b/types/graphql/execution/values.d.ts index d8e1ec2e7e..fb629325e8 100644 --- a/types/graphql/execution/values.d.ts +++ b/types/graphql/execution/values.d.ts @@ -1,27 +1,41 @@ +import { GraphQLError } from "../error"; import { GraphQLInputType, GraphQLField, GraphQLArgument } from "../type/definition"; import { GraphQLDirective } from "../type/directives"; import { GraphQLSchema } from "../type/schema"; import { FieldNode, DirectiveNode, VariableDefinitionNode } from "../language/ast"; +interface CoercedVariableValues { + errors: ReadonlyArray | undefined; + coerced: { [key: string]: any } | undefined; +} + /** * Prepares an object map of variableValues of the correct type based on the * provided variable definitions and arbitrary input. If the input cannot be * parsed to match the variable definitions, a GraphQLError will be thrown. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getVariableValues( schema: GraphQLSchema, varDefNodes: VariableDefinitionNode[], inputs: { [key: string]: any } -): { [key: string]: any }; +): CoercedVariableValues; /** * Prepares an object map of argument values given a list of argument * definitions and list of argument AST nodes. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getArgumentValues( def: GraphQLField | GraphQLDirective, node: FieldNode | DirectiveNode, - variableValues?: { [key: string]: any } + variableValues?: { [key: string]: any } | void ): { [key: string]: any }; /** @@ -30,9 +44,15 @@ export function getArgumentValues( * of variable values. * * If the directive does not exist on the node, returns undefined. + * + * Note: The returned value is a plain Object with a prototype, since it is + * exposed to user code. Care should be taken to not pull values from the + * Object prototype. */ export function getDirectiveValues( directiveDef: GraphQLDirective, - node: { directives?: Array }, - variableValues?: { [key: string]: any } -): void | { [key: string]: any }; + node: { + readonly directives?: ReadonlyArray; + }, + variableValues?: { [key: string]: any } | void +): undefined | { [key: string]: any }; diff --git a/types/graphql/graphql.d.ts b/types/graphql/graphql.d.ts index 386cdd9e1b..7282ea80f2 100644 --- a/types/graphql/graphql.d.ts +++ b/types/graphql/graphql.d.ts @@ -33,25 +33,40 @@ import { ExecutionResult } from "./execution/execute"; * If not provided, the default field resolver is used (which looks for a * value or method on the source value with the field's name). */ -export function graphql(args: { +export interface GraphQLArgs { schema: GraphQLSchema; - source: string | Source; + source: Source | string; rootValue?: any; contextValue?: any; - variableValues?: { - [key: string]: any; - }; - operationName?: string; - fieldResolver?: GraphQLFieldResolver; -}): Promise; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; +} + +export function graphql(args: GraphQLArgs): Promise; export function graphql( schema: GraphQLSchema, - source: string | Source, + source: Source | string, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void ): Promise; + +/** + * The graphqlSync function also fulfills GraphQL operations by parsing, + * validating, and executing a GraphQL document along side a GraphQL schema. + * However, it guarantees to complete synchronously (or throw an error) assuming + * that all field resolvers are also synchronous. + */ +export function graphqlSync(args: GraphQLArgs): ExecutionResult; +export function graphqlSync( + schema: GraphQLSchema, + source: Source | string, + rootValue?: any, + contextValue?: any, + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): ExecutionResult; diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index 017f006787..68e04d104d 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for graphql 0.12 +// Type definitions for graphql 0.13 // Project: https://www.npmjs.com/package/graphql // Definitions by: TonyYang // Caleb Meredith @@ -17,15 +17,221 @@ // TypeScript Version: 2.3 // The primary entry point into fulfilling a GraphQL request. -export { graphql } from "./graphql"; +export { graphql, graphqlSync, GraphQLArgs } from "./graphql"; // Create and operate on GraphQL type definitions and schema. -export * from "./type"; +export { + GraphQLSchema, + // Definitions + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLList, + GraphQLNonNull, + GraphQLDirective, + // "Enum" of Type Kinds + TypeKind, + // Scalars + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, + // Built-in Directives defined by the Spec + specifiedDirectives, + GraphQLIncludeDirective, + GraphQLSkipDirective, + GraphQLDeprecatedDirective, + // Constant Deprecation Reason + DEFAULT_DEPRECATION_REASON, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, + // GraphQL Types for introspection. + introspectionTypes, + __Schema, + __Directive, + __DirectiveLocation, + __Type, + __Field, + __InputValue, + __EnumValue, + __TypeKind, + // Predicates + isSchema, + isDirective, + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + isSpecifiedScalarType, + isIntrospectionType, + isSpecifiedDirective, + // Assertions + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Validate GraphQL schema. + validateSchema, + assertValidSchema, + // type + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + Thunk, + GraphQLSchemaConfig, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLEnumTypeConfig, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInterfaceTypeConfig, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, + GraphQLDirectiveConfig, +} from "./type"; // Parse and operate on GraphQL language source files. -export * from "./language"; - -export * from "./subscription"; +export { + Source, + getLocation, + // Parse + parse, + parseValue, + parseType, + // Print + print, + // Visit + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + Kind, + TokenKind, + DirectiveLocation, + BREAK, + // type + Lexer, + ParseOptions, + SourceLocation, + // Visitor utilities + ASTVisitor, + Visitor, + VisitFn, + VisitorKeyMap, + // AST nodes + Location, + Token, + ASTNode, + ASTKindToNode, + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + OperationTypeNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ObjectValueNode, + ObjectFieldNode, + DirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + ObjectTypeExtensionNode, + DirectiveDefinitionNode, + KindEnum, + TokenKindEnum, + DirectiveLocationEnum, +} from "./language"; // Execute GraphQL queries. export { @@ -33,10 +239,13 @@ export { defaultFieldResolver, responsePathAsArray, getDirectiveValues, + // type ExecutionArgs, ExecutionResult, } from "./execution"; +export { subscribe, createSourceEventStream } from "./subscription"; + // Validate GraphQL queries. export { validate, @@ -44,8 +253,6 @@ export { // All validation rules in the GraphQL Specification. specifiedRules, // Individual validation rules. - ArgumentsOfCorrectTypeRule, - DefaultValuesOfCorrectTypeRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, @@ -68,44 +275,60 @@ export { UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, + ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, + VariablesDefaultValueAllowedRule, VariablesInAllowedPositionRule, } from "./validation"; // Create and format GraphQL errors. -export { GraphQLError, formatError, GraphQLFormattedError, GraphQLErrorLocation } from "./error"; +export { GraphQLError, formatError, printError, GraphQLFormattedError } from "./error"; // Utilities for operating on GraphQL type schema and parsed sources. export { - // The GraphQL query recommended for a full schema introspection. + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. + getIntrospectionQuery, + // Deprecated: use getIntrospectionQuery introspectionQuery, // Gets the target Operation from a Document getOperationAST, + // Convert a GraphQLSchema to an IntrospectionQuery + introspectionFromSchema, // Build a GraphQLSchema from an introspection result. buildClientSchema, // Build a GraphQLSchema from a parsed GraphQL Schema language AST. buildASTSchema, // Build a GraphQLSchema from a GraphQL schema language document. buildSchema, - // Get the description of an AST node + // Get the description from a schema AST node. getDescription, // Extends an existing GraphQLSchema from a parsed GraphQL Schema // language AST. extendSchema, + // Sort a GraphQLSchema. + lexicographicSortSchema, // Print a GraphQLSchema to GraphQL Schema language. printSchema, + // Prints the built-in introspection schema in the Schema Language + // format. + printIntrospectionSchema, // Print a GraphQLType to GraphQL Schema language. printType, // Create a GraphQLType from a GraphQL language AST. typeFromAST, - // Create a JavaScript value from a GraphQL language AST. + // Create a JavaScript value from a GraphQL language AST with a Type. valueFromAST, + // Create a JavaScript value from a GraphQL language AST without a Type. + valueFromASTUntyped, // Create a GraphQL language AST from a JavaScript value. astFromValue, // A helper to use within recursive-descent visitors which need to be aware of // the GraphQL type system. TypeInfo, - // Determine if JavaScript values adhere to a GraphQL type. + // Coerces a JavaScript value to a GraphQL type, or produces errors. + coerceValue, + // @deprecated use coerceValue isValidJSValue, // Determine if AST values adhere to a GraphQL type. isValidLiteralValue, @@ -119,22 +342,35 @@ export { doTypesOverlap, // Asserts a string is a valid GraphQL name. assertValidName, + // Determine if a string is a valid GraphQL name. + isValidNameError, // Compares two GraphQLSchemas and detects breaking changes. findBreakingChanges, + findDangerousChanges, + BreakingChangeType, + DangerousChangeType, // Report all deprecated usage within a GraphQL document. findDeprecatedUsages, + // type + BuildSchemaOptions, BreakingChange, + DangerousChange, + IntrospectionOptions, IntrospectionDirective, IntrospectionEnumType, IntrospectionEnumValue, IntrospectionField, IntrospectionInputObjectType, + IntrospectionInputType, + IntrospectionInputTypeRef, IntrospectionInputValue, IntrospectionInterfaceType, IntrospectionListTypeRef, IntrospectionNamedTypeRef, IntrospectionNonNullTypeRef, IntrospectionObjectType, + IntrospectionOutputType, + IntrospectionOutputTypeRef, IntrospectionQuery, IntrospectionScalarType, IntrospectionSchema, diff --git a/types/graphql/jsutils/MaybePromise.d.ts b/types/graphql/jsutils/MaybePromise.d.ts new file mode 100644 index 0000000000..5eb85a3f92 --- /dev/null +++ b/types/graphql/jsutils/MaybePromise.d.ts @@ -0,0 +1 @@ +export type MaybePromise = Promise | T; diff --git a/types/graphql/language/ast.d.ts b/types/graphql/language/ast.d.ts index 21dbe83361..21601385ff 100644 --- a/types/graphql/language/ast.d.ts +++ b/types/graphql/language/ast.d.ts @@ -1,4 +1,5 @@ import { Source } from "./source"; +import { TokenKindEnum } from "./lexer"; /** * Contains a range of UTF-8 character offsets and token references that @@ -8,57 +9,29 @@ export interface Location { /** * The character offset at which this Node begins. */ - start: number; + readonly start: number; /** * The character offset at which this Node ends. */ - end: number; + readonly end: number; /** * The Token at which this Node begins. */ - startToken: Token; + readonly startToken: Token; /** * The Token at which this Node ends. */ - endToken: Token; + readonly endToken: Token; /** * The Source document the AST represents. */ - source: Source; + readonly source: Source; } -/** - * Represents the different kinds of tokens in a GraphQL document. - * This type is not inlined in `Token` to fix syntax highlighting on GitHub - * *only*. - */ -type TokenKind = - | "" - | "" - | "!" - | "$" - | "(" - | ")" - | "..." - | ":" - | "=" - | "@" - | "[" - | "]" - | "{" - | "|" - | "}" - | "Name" - | "Int" - | "Float" - | "String" - | "BlockString" - | "Comment"; - /** * Represents a range of characters represented by a lexical token * within a Source. @@ -67,40 +40,40 @@ export interface Token { /** * The kind of Token. */ - kind: TokenKind; + readonly kind: TokenKindEnum; /** * The character offset at which this Node begins. */ - start: number; + readonly start: number; /** * The character offset at which this Node ends. */ - end: number; + readonly end: number; /** * The 1-indexed line number on which this Token appears. */ - line: number; + readonly line: number; /** * The 1-indexed column number at which this Token begins. */ - column: number; + readonly column: number; /** * For non-punctuation tokens, represents the interpreted value of the token. */ - value: string | undefined; + readonly value: string | undefined; /** * Tokens exist as nodes in a double-linked-list amongst all tokens * including ignored tokens. is always the first node and * the last. */ - prev?: Token; - next?: Token; + readonly prev: Token | null; + readonly next: Token | null; } /** @@ -201,17 +174,17 @@ export interface ASTKindToNode { // Name export interface NameNode { - kind: "Name"; - loc?: Location; - value: string; + readonly kind: "Name"; + readonly loc?: Location; + readonly value: string; } // Document export interface DocumentNode { - kind: "Document"; - loc?: Location; - definitions: DefinitionNode[]; + readonly kind: "Document"; + readonly loc?: Location; + readonly definitions: ReadonlyArray; } export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode; // experimental non-spec addition. @@ -219,84 +192,83 @@ export type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode export type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode; export interface OperationDefinitionNode { - kind: "OperationDefinition"; - loc?: Location; - operation: OperationTypeNode; - name?: NameNode; - variableDefinitions?: VariableDefinitionNode[]; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly kind: "OperationDefinition"; + readonly loc?: Location; + readonly operation: OperationTypeNode; + readonly name?: NameNode; + readonly variableDefinitions?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } -// Note: subscription is an experimental non-spec addition. export type OperationTypeNode = "query" | "mutation" | "subscription"; export interface VariableDefinitionNode { - kind: "VariableDefinition"; - loc?: Location; - variable: VariableNode; - type: TypeNode; - defaultValue?: ValueNode; + readonly kind: "VariableDefinition"; + readonly loc?: Location; + readonly variable: VariableNode; + readonly type: TypeNode; + readonly defaultValue?: ValueNode; } export interface VariableNode { - kind: "Variable"; - loc?: Location; - name: NameNode; + readonly kind: "Variable"; + readonly loc?: Location; + readonly name: NameNode; } export interface SelectionSetNode { kind: "SelectionSet"; loc?: Location; - selections: SelectionNode[]; + selections: ReadonlyArray; } export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; export interface FieldNode { - kind: "Field"; - loc?: Location; - alias?: NameNode; - name: NameNode; - arguments?: ArgumentNode[]; - directives?: DirectiveNode[]; - selectionSet?: SelectionSetNode; + readonly kind: "Field"; + readonly loc?: Location; + readonly alias?: NameNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly selectionSet?: SelectionSetNode; } export interface ArgumentNode { - kind: "Argument"; - loc?: Location; - name: NameNode; - value: ValueNode; + readonly kind: "Argument"; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ValueNode; } // Fragments export interface FragmentSpreadNode { - kind: "FragmentSpread"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "FragmentSpread"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface InlineFragmentNode { - kind: "InlineFragment"; - loc?: Location; - typeCondition?: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly kind: "InlineFragment"; + readonly loc?: Location; + readonly typeCondition?: NamedTypeNode; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } export interface FragmentDefinitionNode { - kind: "FragmentDefinition"; - loc?: Location; - name: NameNode; + readonly kind: "FragmentDefinition"; + readonly loc?: Location; + readonly name: NameNode; // Note: fragment variable definitions are experimental and may be changed // or removed in the future. - variableDefinitions?: VariableDefinitionNode[]; - typeCondition: NamedTypeNode; - directives?: DirectiveNode[]; - selectionSet: SelectionSetNode; + readonly variableDefinitions?: ReadonlyArray; + readonly typeCondition: NamedTypeNode; + readonly directives?: ReadonlyArray; + readonly selectionSet: SelectionSetNode; } // Values @@ -313,66 +285,67 @@ export type ValueNode = | ObjectValueNode; export interface IntValueNode { - kind: "IntValue"; - loc?: Location; - value: string; + readonly kind: "IntValue"; + readonly loc?: Location; + readonly value: string; } export interface FloatValueNode { - kind: "FloatValue"; - loc?: Location; - value: string; + readonly kind: "FloatValue"; + readonly loc?: Location; + readonly value: string; } export interface StringValueNode { - kind: "StringValue"; - loc?: Location; - value: string; + readonly kind: "StringValue"; + readonly loc?: Location; + readonly value: string; + readonly block?: boolean; } export interface BooleanValueNode { - kind: "BooleanValue"; - loc?: Location; - value: boolean; + readonly kind: "BooleanValue"; + readonly loc?: Location; + readonly value: boolean; } export interface NullValueNode { - kind: "NullValue"; - loc?: Location; + readonly kind: "NullValue"; + readonly loc?: Location; } export interface EnumValueNode { - kind: "EnumValue"; - loc?: Location; - value: string; + readonly kind: "EnumValue"; + readonly loc?: Location; + readonly value: string; } export interface ListValueNode { - kind: "ListValue"; - loc?: Location; - values: ValueNode[]; + readonly kind: "ListValue"; + readonly loc?: Location; + readonly values: ReadonlyArray; } export interface ObjectValueNode { - kind: "ObjectValue"; - loc?: Location; - fields: ObjectFieldNode[]; + readonly kind: "ObjectValue"; + readonly loc?: Location; + readonly fields: ReadonlyArray; } export interface ObjectFieldNode { - kind: "ObjectField"; - loc?: Location; - name: NameNode; - value: ValueNode; + readonly kind: "ObjectField"; + readonly loc?: Location; + readonly name: NameNode; + readonly value: ValueNode; } // Directives export interface DirectiveNode { - kind: "Directive"; - loc?: Location; - name: NameNode; - arguments?: ArgumentNode[]; + readonly kind: "Directive"; + readonly loc?: Location; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; } // Type Reference @@ -380,21 +353,21 @@ export interface DirectiveNode { export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; export interface NamedTypeNode { - kind: "NamedType"; - loc?: Location; - name: NameNode; + readonly kind: "NamedType"; + readonly loc?: Location; + readonly name: NameNode; } export interface ListTypeNode { - kind: "ListType"; - loc?: Location; - type: TypeNode; + readonly kind: "ListType"; + readonly loc?: Location; + readonly type: TypeNode; } export interface NonNullTypeNode { - kind: "NonNullType"; - loc?: Location; - type: NamedTypeNode | ListTypeNode; + readonly kind: "NonNullType"; + readonly loc?: Location; + readonly type: NamedTypeNode | ListTypeNode; } // Type System Definition @@ -406,19 +379,21 @@ export type TypeSystemDefinitionNode = | DirectiveDefinitionNode; export interface SchemaDefinitionNode { - kind: "SchemaDefinition"; - loc?: Location; - directives: DirectiveNode[]; - operationTypes: OperationTypeDefinitionNode[]; + readonly kind: "SchemaDefinition"; + readonly loc?: Location; + readonly directives: ReadonlyArray; + readonly operationTypes: ReadonlyArray; } export interface OperationTypeDefinitionNode { - kind: "OperationTypeDefinition"; - loc?: Location; - operation: OperationTypeNode; - type: NamedTypeNode; + readonly kind: "OperationTypeDefinition"; + readonly loc?: Location; + readonly operation: OperationTypeNode; + readonly type: NamedTypeNode; } +// Type Definition + export type TypeDefinitionNode = | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode @@ -428,87 +403,89 @@ export type TypeDefinitionNode = | InputObjectTypeDefinitionNode; export interface ScalarTypeDefinitionNode { - kind: "ScalarTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "ScalarTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface ObjectTypeDefinitionNode { - kind: "ObjectTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + readonly kind: "ObjectTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } export interface FieldDefinitionNode { - kind: "FieldDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments: InputValueDefinitionNode[]; - type: TypeNode; - directives?: DirectiveNode[]; + readonly kind: "FieldDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly type: TypeNode; + readonly directives?: ReadonlyArray; } export interface InputValueDefinitionNode { - kind: "InputValueDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - type: TypeNode; - defaultValue?: ValueNode; - directives?: DirectiveNode[]; + readonly kind: "InputValueDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly type: TypeNode; + readonly defaultValue?: ValueNode; + readonly directives?: ReadonlyArray; } export interface InterfaceTypeDefinitionNode { - kind: "InterfaceTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: FieldDefinitionNode[]; + readonly kind: "InterfaceTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } export interface UnionTypeDefinitionNode { - kind: "UnionTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - types: NamedTypeNode[]; + readonly kind: "UnionTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly types?: ReadonlyArray; } export interface EnumTypeDefinitionNode { - kind: "EnumTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - values: EnumValueDefinitionNode[]; + readonly kind: "EnumTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly values?: ReadonlyArray; } export interface EnumValueDefinitionNode { - kind: "EnumValueDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; + readonly kind: "EnumValueDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; } export interface InputObjectTypeDefinitionNode { - kind: "InputObjectTypeDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - directives?: DirectiveNode[]; - fields: InputValueDefinitionNode[]; + readonly kind: "InputObjectTypeDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; } +// Type Extensions + export type TypeExtensionNode = | ScalarTypeExtensionNode | ObjectTypeExtensionNode @@ -517,61 +494,61 @@ export type TypeExtensionNode = | EnumTypeExtensionNode | InputObjectTypeExtensionNode; -export type ScalarTypeExtensionNode = { - kind: "ScalarTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; -}; +export interface ScalarTypeExtensionNode { + readonly kind: "ScalarTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; +} -export type ObjectTypeExtensionNode = { - kind: "ObjectTypeExtension"; - loc?: Location; - name: NameNode; - interfaces?: NamedTypeNode[]; - directives?: DirectiveNode[]; - fields?: FieldDefinitionNode[]; -}; +export interface ObjectTypeExtensionNode { + readonly kind: "ObjectTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly interfaces?: ReadonlyArray; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} -export type InterfaceTypeExtensionNode = { - kind: "InterfaceTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields?: FieldDefinitionNode[]; -}; +export interface InterfaceTypeExtensionNode { + readonly kind: "InterfaceTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} -export type UnionTypeExtensionNode = { - kind: "UnionTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - types?: NamedTypeNode[]; -}; +export interface UnionTypeExtensionNode { + readonly kind: "UnionTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly types?: ReadonlyArray; +} -export type EnumTypeExtensionNode = { - kind: "EnumTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - values?: EnumValueDefinitionNode[]; -}; +export interface EnumTypeExtensionNode { + readonly kind: "EnumTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly values?: ReadonlyArray; +} -export type InputObjectTypeExtensionNode = { - kind: "InputObjectTypeExtension"; - loc?: Location; - name: NameNode; - directives?: DirectiveNode[]; - fields?: InputValueDefinitionNode[]; -}; +export interface InputObjectTypeExtensionNode { + readonly kind: "InputObjectTypeExtension"; + readonly loc?: Location; + readonly name: NameNode; + readonly directives?: ReadonlyArray; + readonly fields?: ReadonlyArray; +} // Directive Definitions export interface DirectiveDefinitionNode { - kind: "DirectiveDefinition"; - loc?: Location; - description?: StringValueNode; - name: NameNode; - arguments?: InputValueDefinitionNode[]; - locations: NameNode[]; + readonly kind: "DirectiveDefinition"; + readonly loc?: Location; + readonly description?: StringValueNode; + readonly name: NameNode; + readonly arguments?: ReadonlyArray; + readonly locations: ReadonlyArray; } diff --git a/types/graphql/language/blockStringValue.d.ts b/types/graphql/language/blockStringValue.d.ts new file mode 100644 index 0000000000..64fb87dafd --- /dev/null +++ b/types/graphql/language/blockStringValue.d.ts @@ -0,0 +1,7 @@ +/** + * Produces the value of a block string from its parsed raw value, similar to + * Coffeescript's block string, Python's docstring trim or Ruby's strip_heredoc. + * + * This implements the GraphQL spec's BlockStringValue() static algorithm. + */ +export default function blockStringValue(rawString: string): string; diff --git a/types/graphql/language/directiveLocation.d.ts b/types/graphql/language/directiveLocation.d.ts new file mode 100644 index 0000000000..16c42d7877 --- /dev/null +++ b/types/graphql/language/directiveLocation.d.ts @@ -0,0 +1,34 @@ +/** + * The set of allowed directive location values. + */ +export const DirectiveLocation: _DirectiveLocation; + +// @internal +type _DirectiveLocation = { + // Request Definitions + QUERY: "QUERY"; + MUTATION: "MUTATION"; + SUBSCRIPTION: "SUBSCRIPTION"; + FIELD: "FIELD"; + FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; + FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; + INLINE_FRAGMENT: "INLINE_FRAGMENT"; + + // Type System Definitions + SCHEMA: "SCHEMA"; + SCALAR: "SCALAR"; + OBJECT: "OBJECT"; + FIELD_DEFINITION: "FIELD_DEFINITION"; + ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION"; + INTERFACE: "INTERFACE"; + UNION: "UNION"; + ENUM: "ENUM"; + ENUM_VALUE: "ENUM_VALUE"; + INPUT_OBJECT: "INPUT_OBJECT"; + INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"; +}; + +/** + * The enum type representing the directive location values. + */ +export type DirectiveLocationEnum = _DirectiveLocation[keyof _DirectiveLocation]; diff --git a/types/graphql/language/index.d.ts b/types/graphql/language/index.d.ts index db088e6925..e36dcbbb91 100644 --- a/types/graphql/language/index.d.ts +++ b/types/graphql/language/index.d.ts @@ -1,9 +1,74 @@ -export * from "./ast"; -export { getLocation } from "./location"; -import * as Kind from "./kinds"; -export { Kind }; -export { createLexer, TokenKind, Lexer } from "./lexer"; +export { getLocation, SourceLocation } from "./location"; +export { Kind, KindEnum } from "./kinds"; +export { createLexer, TokenKind, Lexer, TokenKindEnum } from "./lexer"; export { parse, parseValue, parseType, ParseOptions } from "./parser"; export { print } from "./printer"; export { Source } from "./source"; -export { visit, visitInParallel, visitWithTypeInfo, getVisitFn, BREAK } from "./visitor"; +export { + visit, + visitInParallel, + visitWithTypeInfo, + getVisitFn, + BREAK, + // type + ASTVisitor, + Visitor, + VisitFn, + VisitorKeyMap, +} from "./visitor"; + +export { + Location, + Token, + ASTNode, + ASTKindToNode, + // Each kind of AST node + NameNode, + DocumentNode, + DefinitionNode, + ExecutableDefinitionNode, + OperationDefinitionNode, + OperationTypeNode, + VariableDefinitionNode, + VariableNode, + SelectionSetNode, + SelectionNode, + FieldNode, + ArgumentNode, + FragmentSpreadNode, + InlineFragmentNode, + FragmentDefinitionNode, + ValueNode, + IntValueNode, + FloatValueNode, + StringValueNode, + BooleanValueNode, + NullValueNode, + EnumValueNode, + ListValueNode, + ObjectValueNode, + ObjectFieldNode, + DirectiveNode, + TypeNode, + NamedTypeNode, + ListTypeNode, + NonNullTypeNode, + TypeSystemDefinitionNode, + SchemaDefinitionNode, + OperationTypeDefinitionNode, + TypeDefinitionNode, + ScalarTypeDefinitionNode, + ObjectTypeDefinitionNode, + FieldDefinitionNode, + InputValueDefinitionNode, + InterfaceTypeDefinitionNode, + UnionTypeDefinitionNode, + EnumTypeDefinitionNode, + EnumValueDefinitionNode, + InputObjectTypeDefinitionNode, + TypeExtensionNode, + ObjectTypeExtensionNode, + DirectiveDefinitionNode, +} from "./ast"; + +export { DirectiveLocation, DirectiveLocationEnum } from "./directiveLocation"; diff --git a/types/graphql/language/kinds.d.ts b/types/graphql/language/kinds.d.ts index 2e7db3ad87..768f00addd 100644 --- a/types/graphql/language/kinds.d.ts +++ b/types/graphql/language/kinds.d.ts @@ -1,72 +1,74 @@ -// Name +/** + * The set of allowed kind values for AST nodes. + */ +export const Kind: _Kind; -export const NAME: "Name"; +// @internal +type _Kind = { + // Name + NAME: "Name"; -// Document + // Document + DOCUMENT: "Document"; + OPERATION_DEFINITION: "OperationDefinition"; + VARIABLE_DEFINITION: "VariableDefinition"; + VARIABLE: "Variable"; + SELECTION_SET: "SelectionSet"; + FIELD: "Field"; + ARGUMENT: "Argument"; -export const DOCUMENT: "Document"; -export const OPERATION_DEFINITION: "OperationDefinition"; -export const VARIABLE_DEFINITION: "VariableDefinition"; -export const VARIABLE: "Variable"; -export const SELECTION_SET: "SelectionSet"; -export const FIELD: "Field"; -export const ARGUMENT: "Argument"; + // Fragments + FRAGMENT_SPREAD: "FragmentSpread"; + INLINE_FRAGMENT: "InlineFragment"; + FRAGMENT_DEFINITION: "FragmentDefinition"; -// Fragments + // Values + INT: "IntValue"; + FLOAT: "FloatValue"; + STRING: "StringValue"; + BOOLEAN: "BooleanValue"; + NULL: "NullValue"; + ENUM: "EnumValue"; + LIST: "ListValue"; + OBJECT: "ObjectValue"; + OBJECT_FIELD: "ObjectField"; -export const FRAGMENT_SPREAD: "FragmentSpread"; -export const INLINE_FRAGMENT: "InlineFragment"; -export const FRAGMENT_DEFINITION: "FragmentDefinition"; + // Directives + DIRECTIVE: "Directive"; -// Values + // Types + NAMED_TYPE: "NamedType"; + LIST_TYPE: "ListType"; + NON_NULL_TYPE: "NonNullType"; -export const INT: "IntValue"; -export const FLOAT: "FloatValue"; -export const STRING: "StringValue"; -export const BOOLEAN: "BooleanValue"; -export const NULL: "NullValue"; -export const ENUM: "EnumValue"; -export const LIST: "ListValue"; -export const OBJECT: "ObjectValue"; -export const OBJECT_FIELD: "ObjectField"; + // Type System Definitions + SCHEMA_DEFINITION: "SchemaDefinition"; + OPERATION_TYPE_DEFINITION: "OperationTypeDefinition"; -// Directives + // Type Definitions + SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition"; + OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition"; + FIELD_DEFINITION: "FieldDefinition"; + INPUT_VALUE_DEFINITION: "InputValueDefinition"; + INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition"; + UNION_TYPE_DEFINITION: "UnionTypeDefinition"; + ENUM_TYPE_DEFINITION: "EnumTypeDefinition"; + ENUM_VALUE_DEFINITION: "EnumValueDefinition"; + INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition"; -export const DIRECTIVE: "Directive"; + // Type Extensions + SCALAR_TYPE_EXTENSION: "ScalarTypeExtension"; + OBJECT_TYPE_EXTENSION: "ObjectTypeExtension"; + INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension"; + UNION_TYPE_EXTENSION: "UnionTypeExtension"; + ENUM_TYPE_EXTENSION: "EnumTypeExtension"; + INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"; -// Types + // Directive Definitions + DIRECTIVE_DEFINITION: "DirectiveDefinition"; +}; -export const NAMED_TYPE: "NamedType"; -export const LIST_TYPE: "ListType"; -export const NON_NULL_TYPE: "NonNullType"; - -// Type System Definitions - -export const SCHEMA_DEFINITION: "SchemaDefinition"; -export const OPERATION_TYPE_DEFINITION: "OperationTypeDefinition"; - -// Type Definitions - -export const SCALAR_TYPE_DEFINITION: "ScalarTypeDefinition"; -export const OBJECT_TYPE_DEFINITION: "ObjectTypeDefinition"; -export const FIELD_DEFINITION: "FieldDefinition"; -export const INPUT_VALUE_DEFINITION: "InputValueDefinition"; -export const INTERFACE_TYPE_DEFINITION: "InterfaceTypeDefinition"; -export const UNION_TYPE_DEFINITION: "UnionTypeDefinition"; -export const ENUM_TYPE_DEFINITION: "EnumTypeDefinition"; -export const ENUM_VALUE_DEFINITION: "EnumValueDefinition"; -export const INPUT_OBJECT_TYPE_DEFINITION: "InputObjectTypeDefinition"; - -// Type Extensions - -export const TYPE_EXTENSION_DEFINITION: "TypeExtensionDefinition"; -export const SCALAR_TYPE_EXTENSION: "ScalarTypeExtension"; -export const OBJECT_TYPE_EXTENSION: "ObjectTypeExtension"; -export const INTERFACE_TYPE_EXTENSION: "InterfaceTypeExtension"; -export const UNION_TYPE_EXTENSION: "UnionTypeExtension"; -export const ENUM_TYPE_EXTENSION: "EnumTypeExtension"; -export const INPUT_OBJECT_TYPE_EXTENSION: "InputObjectTypeExtension"; - -// Directive Definitions - -export const DIRECTIVE_DEFINITION: "DirectiveDefinition"; +/** + * The enum type representing the possible kind values of AST nodes. + */ +export type KindEnum = _Kind[keyof _Kind]; diff --git a/types/graphql/language/lexer.d.ts b/types/graphql/language/lexer.d.ts index 27db5b04cc..19a57d3a11 100644 --- a/types/graphql/language/lexer.d.ts +++ b/types/graphql/language/lexer.d.ts @@ -43,17 +43,27 @@ export interface Lexer { * Advances the token stream to the next non-ignored token. */ advance(): Token; + + /** + * Looks ahead and returns the next non-ignored token, but does not change + * the Lexer's state. + */ + lookahead(): Token; } /** * An exported enum describing the different kinds of tokens that the * lexer emits. */ -export const TokenKind: { +export const TokenKind: _TokenKind; + +// @internal +type _TokenKind = { SOF: ""; EOF: ""; BANG: "!"; DOLLAR: "$"; + AMP: "&"; PAREN_L: "("; PAREN_R: ")"; SPREAD: "..."; @@ -69,9 +79,15 @@ export const TokenKind: { INT: "Int"; FLOAT: "Float"; STRING: "String"; + BLOCK_STRING: "BlockString"; COMMENT: "Comment"; }; +/** + * The enum type representing the token kinds values. + */ +export type TokenKindEnum = _TokenKind[keyof _TokenKind]; + /** * A helper function to describe a token as a string for debugging */ diff --git a/types/graphql/language/location.d.ts b/types/graphql/language/location.d.ts index 4d7a13e314..6090531718 100644 --- a/types/graphql/language/location.d.ts +++ b/types/graphql/language/location.d.ts @@ -1,8 +1,15 @@ import { Source } from "./source"; +/** + * Represents a location in a Source. + */ export interface SourceLocation { - line: number; - column: number; + readonly line: number; + readonly column: number; } +/** + * Takes a Source and a UTF-8 character offset, and returns the corresponding + * line and column as a SourceLocation. + */ export function getLocation(source: Source, position: number): SourceLocation; diff --git a/types/graphql/language/parser.d.ts b/types/graphql/language/parser.d.ts index 3cdb3462ae..b07db1ff38 100644 --- a/types/graphql/language/parser.d.ts +++ b/types/graphql/language/parser.d.ts @@ -65,7 +65,7 @@ export function parse(source: string | Source, options?: ParseOptions): Document * This is useful within tools that operate upon GraphQL Values directly and * in isolation of complete GraphQL documents. */ -export function parseValue(source: Source | string, options?: ParseOptions): ValueNode; +export function parseValue(source: string | Source, options?: ParseOptions): ValueNode; /** * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for @@ -77,7 +77,7 @@ export function parseValue(source: Source | string, options?: ParseOptions): Val * * Consider providing the results to the utility function: typeFromAST(). */ -export function parseType(source: Source | string, options?: ParseOptions): TypeNode; +export function parseType(source: string | Source, options?: ParseOptions): TypeNode; export function parseConstValue(lexer: Lexer): ValueNode; diff --git a/types/graphql/language/source.d.ts b/types/graphql/language/source.d.ts index 80e68f5557..26d89640c3 100644 --- a/types/graphql/language/source.d.ts +++ b/types/graphql/language/source.d.ts @@ -1,5 +1,19 @@ +interface Location { + line: number; + column: number; +} + +/** + * A representation of source input to GraphQL. + * `name` and `locationOffset` are optional. They are useful for clients who + * store GraphQL documents in source files; for example, if the GraphQL input + * starts at line 40 in a file named Foo.graphql, it might be useful for name to + * be "Foo.graphql" and location to be `{ line: 40, column: 0 }`. + * line and column in locationOffset are 1-indexed + */ export class Source { body: string; name: string; - constructor(body: string, name?: string); + locationOffset: Location; + constructor(body: string, name?: string, locationOffset?: Location); } diff --git a/types/graphql/language/visitor.d.ts b/types/graphql/language/visitor.d.ts index 320d181e4a..a137fa318e 100644 --- a/types/graphql/language/visitor.d.ts +++ b/types/graphql/language/visitor.d.ts @@ -1,55 +1,160 @@ -export const QueryDocumentKeys: { - Name: any[]; - Document: string[]; - OperationDefinition: string[]; - VariableDefinition: string[]; - Variable: string[]; - SelectionSet: string[]; - Field: string[]; - Argument: string[]; +import { ASTNode, ASTKindToNode } from "./ast"; +import { TypeInfo } from "../utilities/TypeInfo"; - FragmentSpread: string[]; - InlineFragment: string[]; - FragmentDefinition: string[]; +interface EnterLeave { + readonly enter?: T; + readonly leave?: T; +} - IntValue: number[]; - FloatValue: number[]; - StringValue: string[]; - BooleanValue: boolean[]; - NullValue: null[]; - EnumValue: any[]; - ListValue: string[]; - ObjectValue: string[]; - ObjectField: string[]; +type EnterLeaveVisitor = EnterLeave< + VisitFn | { [K in keyof KindToNode]?: VisitFn } +>; - Directive: string[]; - - NamedType: string[]; - ListType: string[]; - NonNullType: string[]; - - ObjectTypeDefinition: string[]; - FieldDefinition: string[]; - InputValueDefinition: string[]; - InterfaceTypeDefinition: string[]; - UnionTypeDefinition: string[]; - ScalarTypeDefinition: string[]; - EnumTypeDefinition: string[]; - EnumValueDefinition: string[]; - InputObjectTypeDefinition: string[]; - TypeExtensionDefinition: string[]; +type ShapeMapVisitor = { + [K in keyof KindToNode]?: VisitFn | EnterLeave> }; +export type ASTVisitor = Visitor; +export type Visitor = + | EnterLeaveVisitor + | ShapeMapVisitor; + +/** + * A visitor is comprised of visit functions, which are called on each node + * during the visitor's traversal. + */ +export type VisitFn = ( + // The current node being visiting. + node: TVisitedNode, + // The index or key to this node from the parent node or Array. + key: string | number | undefined, + // The parent immediately above this node, which may be an Array. + parent: TAnyNode | ReadonlyArray | undefined, + // The key path to get to this node from the root node. + path: ReadonlyArray, + // All nodes and Arrays visited before reaching this node. + // These correspond to array indices in `path`. + // Note: ancestors includes arrays which contain the visited node. + ancestors: ReadonlyArray> +) => any; + +/** + * A KeyMap describes each the traversable properties of each kind of node. + */ +export type VisitorKeyMap = { [P in keyof T]: ReadonlyArray }; + +export const QueryDocumentKeys: { [key: string]: string[] }; + export const BREAK: any; -export function visit(root: any, visitor: any, keyMap?: any): any; +/** + * visit() will walk through an AST using a depth first traversal, calling + * the visitor's enter function at each node in the traversal, and calling the + * leave function after visiting that node and all of its child nodes. + * + * By returning different values from the enter and leave functions, the + * behavior of the visitor can be altered, including skipping over a sub-tree of + * the AST (by returning false), editing the AST by returning a value or null + * to remove the value, or to stop the whole traversal by returning BREAK. + * + * When using visit() to edit an AST, the original AST will not be modified, and + * a new version of the AST with the changes applied will be returned from the + * visit function. + * + * const editedAST = visit(ast, { + * enter(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: skip visiting this node + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * }, + * leave(node, key, parent, path, ancestors) { + * // @return + * // undefined: no action + * // false: no action + * // visitor.BREAK: stop visiting altogether + * // null: delete this node + * // any value: replace this node with the returned value + * } + * }); + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the kinds of AST nodes, or + * enter/leave visitors at a named key, leading to four permutations of + * visitor API: + * + * 1) Named visitors triggered when entering a node a specific kind. + * + * visit(ast, { + * Kind(node) { + * // enter the "Kind" node + * } + * }) + * + * 2) Named visitors that trigger upon entering and leaving a node of + * a specific kind. + * + * visit(ast, { + * Kind: { + * enter(node) { + * // enter the "Kind" node + * } + * leave(node) { + * // leave the "Kind" node + * } + * } + * }) + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * visit(ast, { + * enter(node) { + * // enter any node + * }, + * leave(node) { + * // leave any node + * } + * }) + * + * 4) Parallel visitors for entering and leaving nodes of a specific kind. + * + * visit(ast, { + * enter: { + * Kind(node) { + * // enter the "Kind" node + * } + * }, + * leave: { + * Kind(node) { + * // leave the "Kind" node + * } + * } + * }) + */ +export function visit( + root: ASTNode, + visitor: Visitor, + visitorKeys?: VisitorKeyMap // default: QueryDocumentKeys +): any; -export function visitInParallel(visitors: any): any; +/** + * Creates a new visitor instance which delegates to many visitors to run in + * parallel. Each visitor will be visited for each node before moving on. + * + * If a prior visitor edits a node, no following visitors will see that node. + */ +export function visitInParallel(visitors: Array>): Visitor; -export function visitWithTypeInfo(typeInfo: any, visitor: any): any; +/** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ +export function visitWithTypeInfo(typeInfo: TypeInfo, visitor: Visitor): Visitor; /** * Given a visitor instance, if it is leaving or not, and a node kind, return * the function the visitor runtime should call. */ -export function getVisitFn(visitor: any, kind: any, isLeaving: any): any; +export function getVisitFn(visitor: Visitor, kind: string, isLeaving: boolean): VisitFn | void; diff --git a/types/graphql/subscription/subscribe.d.ts b/types/graphql/subscription/subscribe.d.ts index c4eec87ac9..a9fe6b565e 100644 --- a/types/graphql/subscription/subscribe.d.ts +++ b/types/graphql/subscription/subscribe.d.ts @@ -3,27 +3,72 @@ import { DocumentNode } from "../language/ast"; import { GraphQLFieldResolver } from "../type/definition"; import { ExecutionResult } from "../execution/execute"; +/** + * Implements the "Subscribe" algorithm described in the GraphQL specification. + * + * Returns a Promise which resolves to either an AsyncIterator (if successful) + * or an ExecutionResult (client error). The promise will be rejected if a + * server error occurs. + * + * If the client-provided arguments to this function do not result in a + * compliant subscription, a GraphQL Response (ExecutionResult) with + * descriptive errors and no data will be returned. + * + * If the the source stream could not be created due to faulty subscription + * resolver logic or underlying systems, the promise will resolve to a single + * ExecutionResult containing `errors` and no `data`. + * + * If the operation succeeded, the promise resolves to an AsyncIterator, which + * yields a stream of ExecutionResults representing the response stream. + * + * Accepts either an object with named arguments, or individual arguments. + */ +export function subscribe(args: { + schema: GraphQLSchema; + document: DocumentNode; + rootValue?: any; + contextValue?: any; + variableValues?: { [key: string]: any } | void; + operationName?: string | void; + fieldResolver?: GraphQLFieldResolver | void; + subscribeFieldResolver?: GraphQLFieldResolver | void; +}): Promise | ExecutionResult>; + export function subscribe( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver, - subscribeFieldResolver?: GraphQLFieldResolver + variableValues?: { [key: string]: any } | void, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void, + subscribeFieldResolver?: GraphQLFieldResolver | void ): Promise | ExecutionResult>; +/** + * Implements the "CreateSourceEventStream" algorithm described in the + * GraphQL specification, resolving the subscription source event stream. + * + * Returns a Promise. + * + * If the client-provided invalid arguments, the source stream could not be + * created, or the resolver did not return an AsyncIterable, this function will + * will throw an error, which should be caught and handled by the caller. + * + * A Source Event Stream represents a sequence of events, each of which triggers + * a GraphQL execution for that event. + * + * This may be useful when hosting the stateful subscription service in a + * different process or machine than the stateless GraphQL execution engine, + * or otherwise separating these two steps. For more on this, see the + * "Supporting Subscriptions at Scale" information in the GraphQL specification. + */ export function createSourceEventStream( schema: GraphQLSchema, document: DocumentNode, rootValue?: any, contextValue?: any, - variableValues?: { - [key: string]: any; - }, - operationName?: string, - fieldResolver?: GraphQLFieldResolver -): Promise>; + variableValues?: { [key: string]: any }, + operationName?: string | void, + fieldResolver?: GraphQLFieldResolver | void +): Promise | ExecutionResult>; diff --git a/types/graphql/type/definition.d.ts b/types/graphql/type/definition.d.ts index b31ac6bbed..ed87af50ad 100644 --- a/types/graphql/type/definition.d.ts +++ b/types/graphql/type/definition.d.ts @@ -1,3 +1,4 @@ +import { MaybePromise } from "../jsutils/MaybePromise"; import { ScalarTypeDefinitionNode, ObjectTypeDefinitionNode, @@ -8,7 +9,8 @@ import { EnumTypeDefinitionNode, EnumValueDefinitionNode, InputObjectTypeDefinitionNode, - TypeExtensionNode, + ObjectTypeExtensionNode, + InterfaceTypeExtensionNode, OperationDefinitionNode, FieldNode, FragmentDefinitionNode, @@ -33,6 +35,38 @@ export function isType(type: any): type is GraphQLType; export function assertType(type: any): GraphQLType; +export function isScalarType(type: GraphQLType): type is GraphQLScalarType; + +export function assertScalarType(type: GraphQLType): GraphQLScalarType; + +export function isObjectType(type: GraphQLType): type is GraphQLObjectType; + +export function assertObjectType(type: GraphQLType): GraphQLObjectType; + +export function isInterfaceType(type: GraphQLType): type is GraphQLInterfaceType; + +export function assertInterfaceType(type: GraphQLType): GraphQLInterfaceType; + +export function isUnionType(type: GraphQLType): type is GraphQLUnionType; + +export function assertUnionType(type: GraphQLType): GraphQLUnionType; + +export function isEnumType(type: GraphQLType): type is GraphQLEnumType; + +export function assertEnumType(type: GraphQLType): GraphQLEnumType; + +export function isInputObjectType(type: GraphQLType): type is GraphQLInputObjectType; + +export function assertInputObjectType(type: GraphQLType): GraphQLInputObjectType; + +export function isListType(type: GraphQLType): type is GraphQLList; + +export function assertListType(type: GraphQLType): GraphQLList; + +export function isNonNullType(type: GraphQLType): type is GraphQLNonNull; + +export function assertNonNullType(type: GraphQLType): GraphQLNonNull; + /** * These types may be used as input types for arguments and directives. */ @@ -97,6 +131,66 @@ export function isAbstractType(type: GraphQLType): type is GraphQLAbstractType; export function assertAbstractType(type: GraphQLType): GraphQLAbstractType; +/** + * List Modifier + * + * A list is a kind of type marker, a wrapping type which points to another + * type. Lists are often created within the context of defining the fields of + * an object type. + * + * Example: + * + * const PersonType = new GraphQLObjectType({ + * name: 'Person', + * fields: () => ({ + * parents: { type: new GraphQLList(Person) }, + * children: { type: new GraphQLList(Person) }, + * }) + * }) + * + */ +export class GraphQLList { + readonly ofType: T; + constructor(type: T); + toString(): string; + toJSON(): string; + inspect(): string; +} + +/** + * Non-Null Modifier + * + * A non-null is a kind of type marker, a wrapping type which points to another + * type. Non-null types enforce that their values are never null and can ensure + * an error is raised if this ever occurs during a request. It is useful for + * fields which you can make a strong guarantee on non-nullability, for example + * usually the id field of a database row will never be null. + * + * Example: + * + * const RowType = new GraphQLObjectType({ + * name: 'Row', + * fields: () => ({ + * id: { type: new GraphQLNonNull(GraphQLString) }, + * }) + * }) + * + * Note: the enforcement of non-nullability occurs within the executor. + */ +export class GraphQLNonNull { + readonly ofType: T; + constructor(type: T); + toString(): string; + toJSON(): string; + inspect(): string; +} + +export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; + +export function isWrappingType(type: GraphQLType): type is GraphQLWrappingType; + +export function assertWrappingType(type: GraphQLType): GraphQLWrappingType; + /** * These types can all accept null as a value. */ @@ -109,7 +203,13 @@ export type GraphQLNullableType = | GraphQLInputObjectType | GraphQLList; -export function getNullableType(type: T): T & GraphQLNullableType; +export function isNullableType(type: GraphQLType): type is GraphQLNullableType; + +export function assertNullableType(type: GraphQLType): GraphQLNullableType; + +export function getNullableType(type: void): undefined; +export function getNullableType(type: T): T; +export function getNullableType(type: GraphQLNonNull): T; /** * These named types do not include modifiers like List or NonNull. @@ -122,10 +222,11 @@ export type GraphQLNamedType = | GraphQLEnumType | GraphQLInputObjectType; -export function isNamedType(type: GraphQLType): boolean; +export function isNamedType(type: GraphQLType): type is GraphQLNamedType; export function assertNamedType(type: GraphQLType): GraphQLNamedType; +export function getNamedType(type: void): undefined; export function getNamedType(type: GraphQLType): GraphQLNamedType; /** @@ -153,8 +254,8 @@ export type Thunk = (() => T) | T; */ export class GraphQLScalarType { name: string; - description: string; - astNode?: ScalarTypeDefinitionNode; + description: string | void; + astNode?: ScalarTypeDefinitionNode | void; constructor(config: GraphQLScalarTypeConfig); // Serializes an internal value to include in a response. @@ -164,18 +265,20 @@ export class GraphQLScalarType { parseValue(value: any): any; // Parses an externally provided literal value to use as an input. - parseLiteral(valueNode: ValueNode): any; + parseLiteral(valueNode: ValueNode, variables?: { [key: string]: any } | void): any; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLScalarTypeConfig { name: string; - description?: string; - astNode?: ScalarTypeDefinitionNode; - serialize(value: any): TExternal | null | undefined; - parseValue?(value: any): TInternal | null | undefined; - parseLiteral?(valueNode: ValueNode): TInternal | null | undefined; + description?: string | void; + astNode?: ScalarTypeDefinitionNode | void; + serialize(value: any): TExternal | void; + parseValue?(value: any): TInternal | void; + parseLiteral?(valueNode: ValueNode, variables: { [key: string]: any } | void): TInternal | void; } /** @@ -217,38 +320,40 @@ export interface GraphQLScalarTypeConfig { */ export class GraphQLObjectType { name: string; - description: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes: Array; - isTypeOf: GraphQLIsTypeOfFn; + description: string | void; + astNode: ObjectTypeDefinitionNode | void; + extensionASTNodes: ReadonlyArray | void; + isTypeOf: GraphQLIsTypeOfFn | void; constructor(config: GraphQLObjectTypeConfig); getFields(): GraphQLFieldMap; getInterfaces(): GraphQLInterfaceType[]; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLObjectTypeConfig { name: string; - interfaces?: Thunk; + interfaces?: Thunk; fields: Thunk>; - isTypeOf?: GraphQLIsTypeOfFn; - description?: string; - astNode?: ObjectTypeDefinitionNode; - extensionASTNodes?: Array; + isTypeOf?: GraphQLIsTypeOfFn | void; + description?: string | void; + astNode?: ObjectTypeDefinitionNode | void; + extensionASTNodes?: ReadonlyArray | void; } export type GraphQLTypeResolver = ( value: TSource, context: TContext, info: GraphQLResolveInfo -) => GraphQLObjectType | string | Promise; +) => MaybePromise; export type GraphQLIsTypeOfFn = ( source: TSource, context: TContext, info: GraphQLResolveInfo -) => boolean | Promise; +) => MaybePromise; export type GraphQLFieldResolver = ( source: TSource, @@ -258,68 +363,69 @@ export type GraphQLFieldResolver any; export interface GraphQLResolveInfo { - fieldName: string; - fieldNodes: FieldNode[]; - returnType: GraphQLOutputType; - parentType: GraphQLCompositeType; - path: ResponsePath; - schema: GraphQLSchema; - fragments: { [fragmentName: string]: FragmentDefinitionNode }; - rootValue: any; - operation: OperationDefinitionNode; - variableValues: { [variableName: string]: any }; + readonly fieldName: string; + readonly fieldNodes: ReadonlyArray; + readonly returnType: GraphQLOutputType; + readonly parentType: GraphQLObjectType; + readonly path: ResponsePath; + readonly schema: GraphQLSchema; + readonly fragments: { [key: string]: FragmentDefinitionNode }; + readonly rootValue: any; + readonly operation: OperationDefinitionNode; + readonly variableValues: { [variableName: string]: any }; } -export type ResponsePath = { prev: ResponsePath; key: string | number } | undefined; +export type ResponsePath = { + readonly prev: ResponsePath | undefined; + readonly key: string | number; +}; export interface GraphQLFieldConfig { type: GraphQLOutputType; args?: GraphQLFieldConfigArgumentMap; resolve?: GraphQLFieldResolver; subscribe?: GraphQLFieldResolver; - deprecationReason?: string; - description?: string; - astNode?: FieldDefinitionNode; + deprecationReason?: string | void; + description?: string | void; + astNode?: FieldDefinitionNode | void; } -export interface GraphQLFieldConfigArgumentMap { - [argName: string]: GraphQLArgumentConfig; -} +export type GraphQLFieldConfigArgumentMap = { [key: string]: GraphQLArgumentConfig }; export interface GraphQLArgumentConfig { type: GraphQLInputType; defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLFieldConfigMap { - [fieldName: string]: GraphQLFieldConfig; -} +export type GraphQLFieldConfigMap = { + [key: string]: GraphQLFieldConfig; +}; -export interface GraphQLField { +export interface GraphQLField { name: string; - description: string; + description: string | void; type: GraphQLOutputType; args: GraphQLArgument[]; resolve?: GraphQLFieldResolver; subscribe?: GraphQLFieldResolver; isDeprecated?: boolean; - deprecationReason?: string; - astNode?: FieldDefinitionNode; + deprecationReason?: string | void; + astNode?: FieldDefinitionNode | void; } export interface GraphQLArgument { name: string; type: GraphQLInputType; defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLFieldMap { - [fieldName: string]: GraphQLField; -} +export type GraphQLFieldMap = { + [key: string]: GraphQLField; +}; /** * Interface Type Definition @@ -341,15 +447,18 @@ export interface GraphQLFieldMap { */ export class GraphQLInterfaceType { name: string; - description: string; - astNode?: InterfaceTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + description: string | void; + astNode?: InterfaceTypeDefinitionNode | void; + extensionASTNodes: ReadonlyArray | void; + resolveType: GraphQLTypeResolver | void; constructor(config: GraphQLInterfaceTypeConfig); getFields(): GraphQLFieldMap; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLInterfaceTypeConfig { @@ -360,9 +469,10 @@ export interface GraphQLInterfaceTypeConfig { * the default implementation will call `isTypeOf` on each implementing * Object type. */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: InterfaceTypeDefinitionNode; + resolveType?: GraphQLTypeResolver | void; + description?: string | void; + astNode?: InterfaceTypeDefinitionNode | void; + extensionASTNodes?: ReadonlyArray | void; } /** @@ -390,15 +500,17 @@ export interface GraphQLInterfaceTypeConfig { */ export class GraphQLUnionType { name: string; - description: string; - astNode?: UnionTypeDefinitionNode; - resolveType: GraphQLTypeResolver; + description: string | void; + astNode?: UnionTypeDefinitionNode | void; + resolveType: GraphQLTypeResolver | void; constructor(config: GraphQLUnionTypeConfig); getTypes(): GraphQLObjectType[]; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLUnionTypeConfig { @@ -409,9 +521,9 @@ export interface GraphQLUnionTypeConfig { * the default implementation will call `isTypeOf` on each implementing * Object type. */ - resolveType?: GraphQLTypeResolver; - description?: string; - astNode?: UnionTypeDefinitionNode; + resolveType?: GraphQLTypeResolver | void; + description?: string | void; + astNode?: UnionTypeDefinitionNode | void; } /** @@ -437,43 +549,42 @@ export interface GraphQLUnionTypeConfig { */ export class GraphQLEnumType { name: string; - description: string; - astNode?: EnumTypeDefinitionNode; + description: string | void; + astNode: EnumTypeDefinitionNode | void; constructor(config: GraphQLEnumTypeConfig); getValues(): GraphQLEnumValue[]; - getValue(name: string): GraphQLEnumValue; - isValidValue(value: any): boolean; - serialize(value: any): string; + getValue(name: string): GraphQLEnumValue | void; + serialize(value: any): string | void; parseValue(value: any): any; - parseLiteral(valueNode: ValueNode): any; + parseLiteral(valueNode: ValueNode, _variables: { [key: string]: any } | void): any; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLEnumTypeConfig { name: string; values: GraphQLEnumValueConfigMap; - description?: string; - astNode?: EnumTypeDefinitionNode; + description?: string | void; + astNode?: EnumTypeDefinitionNode | void; } -export interface GraphQLEnumValueConfigMap { - [valueName: string]: GraphQLEnumValueConfig; -} +export type GraphQLEnumValueConfigMap = { [key: string]: GraphQLEnumValueConfig }; export interface GraphQLEnumValueConfig { value?: any; - deprecationReason?: string; - description?: string; - astNode?: EnumValueDefinitionNode; + deprecationReason?: string | void; + description?: string | void; + astNode?: EnumValueDefinitionNode | void; } export interface GraphQLEnumValue { name: string; - description: string; + description: string | void; isDeprecated?: boolean; - deprecationReason: string; - astNode?: EnumValueDefinitionNode; + deprecationReason: string | void; + astNode?: EnumValueDefinitionNode | void; value: any; } @@ -499,91 +610,39 @@ export interface GraphQLEnumValue { */ export class GraphQLInputObjectType { name: string; - description: string; - astNode?: InputObjectTypeDefinitionNode; + description: string | void; + astNode: InputObjectTypeDefinitionNode | void; constructor(config: GraphQLInputObjectTypeConfig); getFields(): GraphQLInputFieldMap; toString(): string; + toJSON(): string; + inspect(): string; } export interface GraphQLInputObjectTypeConfig { name: string; fields: Thunk; - description?: string; - astNode?: InputObjectTypeDefinitionNode; + description?: string | void; + astNode?: InputObjectTypeDefinitionNode | void; } export interface GraphQLInputFieldConfig { type: GraphQLInputType; defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLInputFieldConfigMap { - [fieldName: string]: GraphQLInputFieldConfig; -} +export type GraphQLInputFieldConfigMap = { + [key: string]: GraphQLInputFieldConfig; +}; export interface GraphQLInputField { name: string; type: GraphQLInputType; defaultValue?: any; - description?: string; - astNode?: InputValueDefinitionNode; + description?: string | void; + astNode?: InputValueDefinitionNode | void; } -export interface GraphQLInputFieldMap { - [fieldName: string]: GraphQLInputField; -} - -/** - * List Modifier - * - * A list is a kind of type marker, a wrapping type which points to another - * type. Lists are often created within the context of defining the fields of - * an object type. - * - * Example: - * - * const PersonType = new GraphQLObjectType({ - * name: 'Person', - * fields: () => ({ - * parents: { type: new GraphQLList(Person) }, - * children: { type: new GraphQLList(Person) }, - * }) - * }) - * - */ -export class GraphQLList { - ofType: T; - constructor(type: T); - toString(): string; -} - -/** - * Non-Null Modifier - * - * A non-null is a kind of type marker, a wrapping type which points to another - * type. Non-null types enforce that their values are never null and can ensure - * an error is raised if this ever occurs during a request. It is useful for - * fields which you can make a strong guarantee on non-nullability, for example - * usually the id field of a database row will never be null. - * - * Example: - * - * const RowType = new GraphQLObjectType({ - * name: 'Row', - * fields: () => ({ - * id: { type: new GraphQLNonNull(GraphQLString) }, - * }) - * }) - * - * Note: the enforcement of non-nullability occurs within the executor. - */ -export class GraphQLNonNull { - ofType: T; - - constructor(type: T); - - toString(): string; -} +export type GraphQLInputFieldMap = { [key: string]: GraphQLInputField }; diff --git a/types/graphql/type/directives.d.ts b/types/graphql/type/directives.d.ts index bf1fc8df16..f6e19f674d 100644 --- a/types/graphql/type/directives.d.ts +++ b/types/graphql/type/directives.d.ts @@ -1,30 +1,11 @@ import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from "./definition"; import { DirectiveDefinitionNode } from "../language/ast"; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -export const DirectiveLocation: { - // Operations - QUERY: "QUERY"; - MUTATION: "MUTATION"; - SUBSCRIPTION: "SUBSCRIPTION"; - FIELD: "FIELD"; - FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION"; - FRAGMENT_SPREAD: "FRAGMENT_SPREAD"; - INLINE_FRAGMENT: "INLINE_FRAGMENT"; - // Schema Definitions - SCHEMA: "SCHEMA"; - SCALAR: "SCALAR"; - OBJECT: "OBJECT"; - FIELD_DEFINITION: "FIELD_DEFINITION"; - ARGUMENT_DEFINITION: "ARGUMENT_DEFINITION"; - INTERFACE: "INTERFACE"; - UNION: "UNION"; - ENUM: "ENUM"; - ENUM_VALUE: "ENUM_VALUE"; - INPUT_OBJECT: "INPUT_OBJECT"; - INPUT_FIELD_DEFINITION: "INPUT_FIELD_DEFINITION"; -}; - -export type DirectiveLocationEnum = keyof typeof DirectiveLocation; +/** + * Test if the given value is a GraphQL directive. + */ +export function isDirective(directive: any): directive is GraphQLDirective; /** * Directives are used by the GraphQL runtime as a way of modifying execution @@ -32,20 +13,20 @@ export type DirectiveLocationEnum = keyof typeof DirectiveLocation; */ export class GraphQLDirective { name: string; - description?: string; + description: string | void; locations: DirectiveLocationEnum[]; args: GraphQLArgument[]; - astNode?: DirectiveDefinitionNode; + astNode: DirectiveDefinitionNode | void; constructor(config: GraphQLDirectiveConfig); } export interface GraphQLDirectiveConfig { name: string; - description?: string; + description?: string | void; locations: DirectiveLocationEnum[]; - args?: GraphQLFieldConfigArgumentMap; - astNode?: DirectiveDefinitionNode; + args?: GraphQLFieldConfigArgumentMap | void; + astNode?: DirectiveDefinitionNode | void; } /** @@ -71,4 +52,6 @@ export const GraphQLDeprecatedDirective: GraphQLDirective; /** * The full list of specified directives. */ -export const specifiedDirectives: GraphQLDirective[]; +export const specifiedDirectives: ReadonlyArray; + +export function isSpecifiedDirective(directive: GraphQLDirective): boolean; diff --git a/types/graphql/type/index.d.ts b/types/graphql/type/index.d.ts index 551ade35e7..c498f648e4 100644 --- a/types/graphql/type/index.d.ts +++ b/types/graphql/type/index.d.ts @@ -1,29 +1,133 @@ -// GraphQL Schema definition -export { GraphQLSchema } from "./schema"; - -export * from "./definition"; +export { + // Predicate + isSchema, + // GraphQL Schema definition + GraphQLSchema, + GraphQLSchemaConfig, +} from "./schema"; export { - // "Enum" of Directive Locations - DirectiveLocation, + // Predicates + isType, + isScalarType, + isObjectType, + isInterfaceType, + isUnionType, + isEnumType, + isInputObjectType, + isListType, + isNonNullType, + isInputType, + isOutputType, + isLeafType, + isCompositeType, + isAbstractType, + isWrappingType, + isNullableType, + isNamedType, + // Assertions + assertType, + assertScalarType, + assertObjectType, + assertInterfaceType, + assertUnionType, + assertEnumType, + assertInputObjectType, + assertListType, + assertNonNullType, + assertInputType, + assertOutputType, + assertLeafType, + assertCompositeType, + assertAbstractType, + assertWrappingType, + assertNullableType, + assertNamedType, + // Un-modifiers + getNullableType, + getNamedType, + // Definitions + GraphQLScalarType, + GraphQLObjectType, + GraphQLInterfaceType, + GraphQLUnionType, + GraphQLEnumType, + GraphQLInputObjectType, + // Type Wrappers + GraphQLList, + GraphQLNonNull, + // type + GraphQLType, + GraphQLInputType, + GraphQLOutputType, + GraphQLLeafType, + GraphQLCompositeType, + GraphQLAbstractType, + GraphQLWrappingType, + GraphQLNullableType, + GraphQLNamedType, + Thunk, + GraphQLArgument, + GraphQLArgumentConfig, + GraphQLEnumTypeConfig, + GraphQLEnumValue, + GraphQLEnumValueConfig, + GraphQLEnumValueConfigMap, + GraphQLField, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLFieldConfigMap, + GraphQLFieldMap, + GraphQLFieldResolver, + GraphQLInputField, + GraphQLInputFieldConfig, + GraphQLInputFieldConfigMap, + GraphQLInputFieldMap, + GraphQLInputObjectTypeConfig, + GraphQLInterfaceTypeConfig, + GraphQLIsTypeOfFn, + GraphQLObjectTypeConfig, + GraphQLResolveInfo, + ResponsePath, + GraphQLScalarTypeConfig, + GraphQLTypeResolver, + GraphQLUnionTypeConfig, +} from "./definition"; + +export { + // Predicate + isDirective, // Directives Definition GraphQLDirective, // Built-in Directives defined by the Spec + isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, // Constant Deprecation Reason DEFAULT_DEPRECATION_REASON, + // type + GraphQLDirectiveConfig, } from "./directives"; // Common built-in scalar instances. -export { GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID } from "./scalars"; +export { + isSpecifiedScalarType, + specifiedScalarTypes, + GraphQLInt, + GraphQLFloat, + GraphQLString, + GraphQLBoolean, + GraphQLID, +} from "./scalars"; export { // "Enum" of Type Kinds TypeKind, // GraphQL Types for introspection. + isIntrospectionType, + introspectionTypes, __Schema, __Directive, __DirectiveLocation, @@ -38,4 +142,4 @@ export { TypeNameMetaFieldDef, } from "./introspection"; -export { DirectiveLocationEnum } from "./directives"; +export { validateSchema, assertValidSchema } from "./validate"; diff --git a/types/graphql/type/introspection.d.ts b/types/graphql/type/introspection.d.ts index 042c3e2b6b..beed0ebeb2 100644 --- a/types/graphql/type/introspection.d.ts +++ b/types/graphql/type/introspection.d.ts @@ -35,6 +35,11 @@ export const __TypeKind: GraphQLEnumType; * Note that these are GraphQLField and not GraphQLFieldConfig, * so the format for args is different. */ + export const SchemaMetaFieldDef: GraphQLField; export const TypeMetaFieldDef: GraphQLField; export const TypeNameMetaFieldDef: GraphQLField; + +export const introspectionTypes: ReadonlyArray; + +export function isIntrospectionType(type: any): boolean; diff --git a/types/graphql/type/scalars.d.ts b/types/graphql/type/scalars.d.ts index 287d99602a..1476bf7ab8 100644 --- a/types/graphql/type/scalars.d.ts +++ b/types/graphql/type/scalars.d.ts @@ -5,3 +5,7 @@ export const GraphQLFloat: GraphQLScalarType; export const GraphQLString: GraphQLScalarType; export const GraphQLBoolean: GraphQLScalarType; export const GraphQLID: GraphQLScalarType; + +export const specifiedScalarTypes: ReadonlyArray; + +export function isSpecifiedScalarType(type: GraphQLScalarType): boolean; diff --git a/types/graphql/type/schema.d.ts b/types/graphql/type/schema.d.ts index bdd1089756..a7bb94f5c5 100644 --- a/types/graphql/type/schema.d.ts +++ b/types/graphql/type/schema.d.ts @@ -3,6 +3,11 @@ import { GraphQLType, GraphQLNamedType, GraphQLAbstractType } from "./definition import { SchemaDefinitionNode } from "../language/ast"; import { GraphQLDirective } from "./directives"; +/** + * Test if the given value is a GraphQL schema. + */ +export function isSchema(schema: any): schema is GraphQLSchema; + /** * Schema Definition * @@ -30,31 +35,26 @@ import { GraphQLDirective } from "./directives"; * */ export class GraphQLSchema { - astNode?: SchemaDefinitionNode; - // private _queryType: GraphQLObjectType; - // private _mutationType: GraphQLObjectType; - // private _subscriptionType: GraphQLObjectType; - // private _directives: Array; - // private _typeMap: TypeMap; - // private _implementations: { [interfaceName: string]: Array }; - // private _possibleTypeMap: { [abstractName: string]: { [possibleName: string]: boolean } }; + astNode: SchemaDefinitionNode | void; constructor(config: GraphQLSchemaConfig); - getQueryType(): GraphQLObjectType; - getMutationType(): GraphQLObjectType | null | undefined; - getSubscriptionType(): GraphQLObjectType | null | undefined; - getTypeMap(): { [typeName: string]: GraphQLNamedType }; - getType(name: string): GraphQLNamedType; - getPossibleTypes(abstractType: GraphQLAbstractType): GraphQLObjectType[]; + getQueryType(): GraphQLObjectType | void; + getMutationType(): GraphQLObjectType | void; + getSubscriptionType(): GraphQLObjectType | void; + getTypeMap(): TypeMap; + getType(name: string): GraphQLNamedType | void; + getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray; isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean; - getDirectives(): GraphQLDirective[]; - getDirective(name: string): GraphQLDirective; + getDirectives(): ReadonlyArray; + getDirective(name: string): GraphQLDirective | void; } -export type GraphQLSchemaValidationOptions = { +type TypeMap = { [key: string]: GraphQLNamedType }; + +export interface GraphQLSchemaValidationOptions { /** * When building a schema from a GraphQL service's introspection result, it * might be safe to assume the schema is valid. Set to true to assume the @@ -72,14 +72,14 @@ export type GraphQLSchemaValidationOptions = { * This option is provided to ease adoption and may be removed in a future * major release. */ - allowedLegacyNames?: ReadonlyArray; -}; - -export interface GraphQLSchemaConfig { - query: GraphQLObjectType; - mutation?: GraphQLObjectType; - subscription?: GraphQLObjectType; - types?: GraphQLNamedType[]; - directives?: GraphQLDirective[]; - astNode?: SchemaDefinitionNode; + allowedLegacyNames?: ReadonlyArray | void; +} + +export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { + query: GraphQLObjectType | void; + mutation?: GraphQLObjectType | void; + subscription?: GraphQLObjectType | void; + types?: GraphQLNamedType[] | void; + directives?: GraphQLDirective[] | void; + astNode?: SchemaDefinitionNode | void; } diff --git a/types/graphql/type/validate.d.ts b/types/graphql/type/validate.d.ts new file mode 100644 index 0000000000..e23f9e6386 --- /dev/null +++ b/types/graphql/type/validate.d.ts @@ -0,0 +1,17 @@ +import { GraphQLSchema } from "./schema"; +import { GraphQLError } from "../error/GraphQLError"; + +/** + * Implements the "Type Validation" sub-sections of the specification's + * "Type System" section. + * + * Validation runs synchronously, returning an array of encountered errors, or + * an empty array if no errors were encountered and the Schema is valid. + */ +export function validateSchema(schema: GraphQLSchema): ReadonlyArray; + +/** + * Utility function which asserts a schema is valid by throwing an error if + * it is invalid. + */ +export function assertValidSchema(schema: GraphQLSchema): void; diff --git a/types/graphql/utilities/TypeInfo.d.ts b/types/graphql/utilities/TypeInfo.d.ts index 8b1ddc6206..1c2f139642 100644 --- a/types/graphql/utilities/TypeInfo.d.ts +++ b/types/graphql/utilities/TypeInfo.d.ts @@ -22,22 +22,26 @@ export class TypeInfo { // NOTE: this experimental optional second parameter is only needed in order // to support non-spec-compliant codebases. You should never need to use it. // It may disappear in the future. - getFieldDefFn?: getFieldDef + getFieldDefFn?: getFieldDef, + // Initial type may be provided in rare cases to facilitate traversals + // beginning somewhere other than documents. + initialType?: GraphQLType ); - getType(): GraphQLOutputType; - getParentType(): GraphQLCompositeType; - getInputType(): GraphQLInputType; - getFieldDef(): GraphQLField; - getDirective(): GraphQLDirective; - getArgument(): GraphQLArgument; - getEnumValue(): GraphQLEnumValue; + getType(): GraphQLOutputType | void; + getParentType(): GraphQLCompositeType | void; + getInputType(): GraphQLInputType | void; + getParentInputType(): GraphQLInputType | void; + getFieldDef(): GraphQLField | void; + getDirective(): GraphQLDirective | void; + getArgument(): GraphQLArgument | void; + getEnumValue(): GraphQLEnumValue | void; enter(node: ASTNode): any; leave(node: ASTNode): any; } -export type getFieldDef = ( +type getFieldDef = ( schema: GraphQLSchema, parentType: GraphQLType, fieldNode: FieldNode -) => GraphQLField; +) => GraphQLField | void; diff --git a/types/graphql/utilities/assertValidName.d.ts b/types/graphql/utilities/assertValidName.d.ts index 5ca2310a26..19f81e3991 100644 --- a/types/graphql/utilities/assertValidName.d.ts +++ b/types/graphql/utilities/assertValidName.d.ts @@ -1,2 +1,12 @@ -// Helper to assert that provided names are valid. -export function assertValidName(name: string): void; +import { GraphQLError } from "../error/GraphQLError"; +import { ASTNode } from "../language/ast"; + +/** + * Upholds the spec rules about naming. + */ +export function assertValidName(name: string): string; + +/** + * Returns an Error if a name is invalid. + */ +export function isValidNameError(name: string, node?: ASTNode | undefined): GraphQLError | undefined; diff --git a/types/graphql/utilities/astFromValue.d.ts b/types/graphql/utilities/astFromValue.d.ts index 57f7f977ad..9c2198e6d6 100644 --- a/types/graphql/utilities/astFromValue.d.ts +++ b/types/graphql/utilities/astFromValue.d.ts @@ -1,16 +1,4 @@ -import { - ValueNode, - /* - TODO: - IntValueNode, - FloatValueNode, - StringValueNode, - BooleanValueNode, - EnumValueNode, - ListValueNode, - ObjectValueNode, - */ -} from "../language/ast"; +import { ValueNode } from "../language/ast"; import { GraphQLInputType } from "../type/definition"; /** @@ -27,7 +15,7 @@ import { GraphQLInputType } from "../type/definition"; * | String | String / Enum Value | * | Number | Int / Float | * | Mixed | Enum Value | + * | null | NullValue | * */ -// TODO: this should set overloads according to above the table -export function astFromValue(value: any, type: GraphQLInputType): ValueNode; // Warning: there is a code in bottom: throw new TypeError +export function astFromValue(value: any, type: GraphQLInputType): ValueNode | void; diff --git a/types/graphql/utilities/buildASTSchema.d.ts b/types/graphql/utilities/buildASTSchema.d.ts index 4d256fe180..ebff50b4f7 100644 --- a/types/graphql/utilities/buildASTSchema.d.ts +++ b/types/graphql/utilities/buildASTSchema.d.ts @@ -1,6 +1,18 @@ -import { DocumentNode, Location, StringValueNode } from "../language/ast"; +import { + DocumentNode, + Location, + StringValueNode, + TypeDefinitionNode, + NamedTypeNode, + DirectiveDefinitionNode, + FieldDefinitionNode, +} from "../language/ast"; +import { GraphQLNamedType, GraphQLFieldConfig } from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; import { Source } from "../language/source"; import { GraphQLSchema, GraphQLSchemaValidationOptions } from "../type/schema"; +import { ParseOptions } from "../language/parser"; +import blockStringValue from "../language/blockStringValue"; interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { /** @@ -22,8 +34,29 @@ interface BuildSchemaOptions extends GraphQLSchemaValidationOptions { * * Given that AST it constructs a GraphQLSchema. The resulting schema * has no resolve methods, so execution will use default resolvers. + * + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * */ -export function buildASTSchema(ast: DocumentNode): GraphQLSchema; +export function buildASTSchema(ast: DocumentNode, options?: BuildSchemaOptions): GraphQLSchema; + +type TypeDefinitionsMap = { [key: string]: TypeDefinitionNode }; +type TypeResolver = (typeRef: NamedTypeNode) => GraphQLNamedType; + +export class ASTDefinitionBuilder { + constructor(typeDefinitionsMap: TypeDefinitionsMap, options: BuildSchemaOptions | void, resolveType: TypeResolver); + + buildTypes(nodes: ReadonlyArray): Array; + + buildType(node: NamedTypeNode | TypeDefinitionNode): GraphQLNamedType; + + buildDirective(directiveNode: DirectiveDefinitionNode): GraphQLDirective; + + buildField(field: FieldDefinitionNode): GraphQLFieldConfig; +} /** * Given an ast node, returns its string description. @@ -35,12 +68,12 @@ export function buildASTSchema(ast: DocumentNode): GraphQLSchema; * */ export function getDescription( - node: { description?: StringValueNode; loc?: Location }, - options: BuildSchemaOptions -): string; + node: { readonly description?: StringValueNode; readonly loc?: Location }, + options: BuildSchemaOptions | void +): string | undefined; /** * A helper function to build a GraphQLSchema directly from a source * document. */ -export function buildSchema(source: string | Source): GraphQLSchema; +export function buildSchema(source: string | Source, options?: BuildSchemaOptions & ParseOptions): GraphQLSchema; diff --git a/types/graphql/utilities/buildClientSchema.d.ts b/types/graphql/utilities/buildClientSchema.d.ts index 80516c2111..128c34ca48 100644 --- a/types/graphql/utilities/buildClientSchema.d.ts +++ b/types/graphql/utilities/buildClientSchema.d.ts @@ -11,5 +11,8 @@ interface Options extends GraphQLSchemaValidationOptions {} * tools, but cannot be used to execute a query, as introspection does not * represent the "resolver", "parse" or "serialize" functions or any other * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. */ export function buildClientSchema(introspection: IntrospectionQuery, options?: Options): GraphQLSchema; diff --git a/types/graphql/utilities/coerceValue.d.ts b/types/graphql/utilities/coerceValue.d.ts new file mode 100644 index 0000000000..081eea4a32 --- /dev/null +++ b/types/graphql/utilities/coerceValue.d.ts @@ -0,0 +1,22 @@ +import { GraphQLError } from "../error"; +import { ASTNode } from "../language/ast"; +import { GraphQLInputType } from "../type/definition"; + +interface CoercedValue { + readonly errors: ReadonlyArray | undefined; + readonly value: any; +} + +interface Path { + readonly prev: Path | undefined; + readonly key: string | number; +} + +/** + * Coerces a JavaScript value given a GraphQL Type. + * + * Returns either a value which is valid for the provided type or a list of + * encountered coercion errors. + * + */ +export function coerceValue(value: any, type: GraphQLInputType, blameNode?: ASTNode, path?: Path): CoercedValue; diff --git a/types/graphql/utilities/concatAST.d.ts b/types/graphql/utilities/concatAST.d.ts index 6e4c33aed5..08c5104076 100644 --- a/types/graphql/utilities/concatAST.d.ts +++ b/types/graphql/utilities/concatAST.d.ts @@ -5,4 +5,4 @@ import { DocumentNode } from "../language/ast"; * concatenate the ASTs together into batched AST, useful for validating many * GraphQL source files which together represent one conceptual application. */ -export function concatAST(asts: DocumentNode[]): DocumentNode; +export function concatAST(asts: ReadonlyArray): DocumentNode; diff --git a/types/graphql/utilities/extendSchema.d.ts b/types/graphql/utilities/extendSchema.d.ts index 027c4d5745..7cde767ed7 100644 --- a/types/graphql/utilities/extendSchema.d.ts +++ b/types/graphql/utilities/extendSchema.d.ts @@ -1,5 +1,17 @@ import { DocumentNode } from "../language/ast"; import { GraphQLSchema } from "../type/schema"; +import { GraphQLSchemaValidationOptions } from "../type/schema"; + +interface Options extends GraphQLSchemaValidationOptions { + /** + * Descriptions are defined as preceding string literals, however an older + * experimental version of the SDL supported preceding comments as + * descriptions. Set to true to enable this deprecated behavior. + * + * Default: false + */ + commentDescriptions?: boolean; +} /** * Produces a new schema given an existing schema and a document which may @@ -12,5 +24,11 @@ import { GraphQLSchema } from "../type/schema"; * * This algorithm copies the provided schema, applying extensions while * producing the copy. The original schema remains unaltered. + * + * Accepts options as a third argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * */ -export function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode): GraphQLSchema; +export function extendSchema(schema: GraphQLSchema, documentAST: DocumentNode, options?: Options): GraphQLSchema; diff --git a/types/graphql/utilities/findBreakingChanges.d.ts b/types/graphql/utilities/findBreakingChanges.d.ts index 37b98dae34..84f1bea158 100644 --- a/types/graphql/utilities/findBreakingChanges.d.ts +++ b/types/graphql/utilities/findBreakingChanges.d.ts @@ -8,27 +8,50 @@ import { GraphQLUnionType, GraphQLNamedType, } from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; import { GraphQLSchema } from "../type/schema"; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -export const BreakingChangeType: { +export const BreakingChangeType : _BreakingChangeType; + +// @internal +type _BreakingChangeType = { FIELD_CHANGED_KIND: "FIELD_CHANGED_KIND"; FIELD_REMOVED: "FIELD_REMOVED"; TYPE_CHANGED_KIND: "TYPE_CHANGED_KIND"; TYPE_REMOVED: "TYPE_REMOVED"; TYPE_REMOVED_FROM_UNION: "TYPE_REMOVED_FROM_UNION"; VALUE_REMOVED_FROM_ENUM: "VALUE_REMOVED_FROM_ENUM"; + ARG_REMOVED: "ARG_REMOVED"; + ARG_CHANGED_KIND: "ARG_CHANGED_KIND"; + NON_NULL_ARG_ADDED: "NON_NULL_ARG_ADDED"; + NON_NULL_INPUT_FIELD_ADDED: "NON_NULL_INPUT_FIELD_ADDED"; + INTERFACE_REMOVED_FROM_OBJECT: "INTERFACE_REMOVED_FROM_OBJECT"; + DIRECTIVE_REMOVED: "DIRECTIVE_REMOVED"; + DIRECTIVE_ARG_REMOVED: "DIRECTIVE_ARG_REMOVED"; + DIRECTIVE_LOCATION_REMOVED: "DIRECTIVE_LOCATION_REMOVED"; + NON_NULL_DIRECTIVE_ARG_ADDED: "NON_NULL_DIRECTIVE_ARG_ADDED"; }; -export type BreakingChangeKey = - | "FIELD_CHANGED_KIND" - | "FIELD_REMOVED" - | "TYPE_CHANGED_KIND" - | "TYPE_REMOVED" - | "TYPE_REMOVED_FROM_UNION" - | "VALUE_REMOVED_FROM_ENUM"; +export const DangerousChangeType: _DangerousChangeType; + +// @internal +type _DangerousChangeType = { + ARG_DEFAULT_VALUE_CHANGE: "ARG_DEFAULT_VALUE_CHANGE"; + VALUE_ADDED_TO_ENUM: "VALUE_ADDED_TO_ENUM"; + INTERFACE_ADDED_TO_OBJECT: "INTERFACE_ADDED_TO_OBJECT"; + TYPE_ADDED_TO_UNION: "TYPE_ADDED_TO_UNION"; + NULLABLE_INPUT_FIELD_ADDED: "NULLABLE_INPUT_FIELD_ADDED"; + NULLABLE_ARG_ADDED: "NULLABLE_ARG_ADDED"; +}; export interface BreakingChange { - type: BreakingChangeKey; + type: keyof _BreakingChangeType; + description: string; +} + +export interface DangerousChange { + type: keyof _DangerousChangeType; description: string; } @@ -36,35 +59,102 @@ export interface BreakingChange { * Given two schemas, returns an Array containing descriptions of all the types * of breaking changes covered by the other functions down below. */ -export function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findBreakingChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + */ +export function findDangerousChanges(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing an entire type. */ -export function findRemovedTypes(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findRemovedTypes(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to changing the type of a type. */ -export function findTypesThatChangedKind(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findTypesThatChangedKind(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** - * Given two schemas, returns an Array containing descriptions of any breaking - * changes in the newSchema related to the fields on a type. This includes if - * a field has been removed from a type or if a field has changed type. + * Given two schemas, returns an Array containing descriptions of any + * breaking or dangerous changes in the newSchema related to arguments + * (such as removal or change of type of an argument, or a change in an + * argument's default value). */ -export function findFieldsThatChangedType(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findArgChanges( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): { + breakingChanges: Array; + dangerousChanges: Array; +}; + +export function findFieldsThatChangedTypeOnObjectOrInterfaceTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findFieldsThatChangedTypeOnInputObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): { + breakingChanges: Array; + dangerousChanges: Array; +}; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing types from a union type. */ -export function findTypesRemovedFromUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findTypesRemovedFromUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of any dangerous + * changes in the newSchema related to adding types to a union type. + */ +export function findTypesAddedToUnions(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; /** * Given two schemas, returns an Array containing descriptions of any breaking * changes in the newSchema related to removing values from an enum type. */ -export function findValuesRemovedFromEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): BreakingChange[]; +export function findValuesRemovedFromEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +/** + * Given two schemas, returns an Array containing descriptions of any dangerous + * changes in the newSchema related to adding values to an enum type. + */ +export function findValuesAddedToEnums(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findInterfacesRemovedFromObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findInterfacesAddedToObjectTypes( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findRemovedDirectives(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findRemovedDirectiveArgs(oldSchema: GraphQLSchema, newSchema: GraphQLSchema): Array; + +export function findAddedNonNullDirectiveArgs( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; + +export function findRemovedLocationsForDirective( + oldDirective: GraphQLDirective, + newDirective: GraphQLDirective +): Array; + +export function findRemovedDirectiveLocations( + oldSchema: GraphQLSchema, + newSchema: GraphQLSchema +): Array; diff --git a/types/graphql/utilities/getOperationAST.d.ts b/types/graphql/utilities/getOperationAST.d.ts index 5a1e0dc7a7..81e9bd4cbe 100644 --- a/types/graphql/utilities/getOperationAST.d.ts +++ b/types/graphql/utilities/getOperationAST.d.ts @@ -5,4 +5,7 @@ import { DocumentNode, OperationDefinitionNode } from "../language/ast"; * name. If a name is not provided, an operation is only returned if only one is * provided in the document. */ -export function getOperationAST(documentAST: DocumentNode, operationName?: string): OperationDefinitionNode; +export function getOperationAST( + documentAST: DocumentNode, + operationName: string | void +): OperationDefinitionNode | void; diff --git a/types/graphql/utilities/index.d.ts b/types/graphql/utilities/index.d.ts index 91777235d1..f571c3ab76 100644 --- a/types/graphql/utilities/index.d.ts +++ b/types/graphql/utilities/index.d.ts @@ -1,9 +1,17 @@ // The GraphQL query recommended for a full schema introspection. -export { introspectionQuery } from "./introspectionQuery"; export { + getIntrospectionQuery, + // Deprecated, use getIntrospectionQuery() + introspectionQuery, +} from "./introspectionQuery"; + +export { + IntrospectionOptions, IntrospectionQuery, IntrospectionSchema, IntrospectionType, + IntrospectionInputType, + IntrospectionOutputType, IntrospectionScalarType, IntrospectionObjectType, IntrospectionInterfaceType, @@ -11,6 +19,8 @@ export { IntrospectionEnumType, IntrospectionInputObjectType, IntrospectionTypeRef, + IntrospectionInputTypeRef, + IntrospectionOutputTypeRef, IntrospectionNamedTypeRef, IntrospectionListTypeRef, IntrospectionNonNullTypeRef, @@ -23,24 +33,33 @@ export { // Gets the target Operation from a Document export { getOperationAST } from "./getOperationAST"; +// Convert a GraphQLSchema to an IntrospectionQuery +export { introspectionFromSchema } from "./introspectionFromSchema"; + // Build a GraphQLSchema from an introspection result. export { buildClientSchema } from "./buildClientSchema"; // Build a GraphQLSchema from GraphQL Schema language. -export { buildASTSchema, buildSchema, getDescription } from "./buildASTSchema"; +export { buildASTSchema, buildSchema, getDescription, BuildSchemaOptions } from "./buildASTSchema"; // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. export { extendSchema } from "./extendSchema"; +// Sort a GraphQLSchema. +export { lexicographicSortSchema } from "./lexicographicSortSchema"; + // Print a GraphQLSchema to GraphQL Schema language. export { printSchema, printType, printIntrospectionSchema } from "./schemaPrinter"; // Create a GraphQLType from a GraphQL language AST. export { typeFromAST } from "./typeFromAST"; -// Create a JavaScript value from a GraphQL language AST. +// Create a JavaScript value from a GraphQL language AST with a type. export { valueFromAST } from "./valueFromAST"; +// Create a JavaScript value from a GraphQL language AST without a type. +export { valueFromASTUntyped } from "./valueFromASTUntyped"; + // Create a GraphQL language AST from a JavaScript value. export { astFromValue } from "./astFromValue"; @@ -48,7 +67,10 @@ export { astFromValue } from "./astFromValue"; // the GraphQL type system. export { TypeInfo } from "./TypeInfo"; -// Determine if JavaScript values adhere to a GraphQL type. +// Coerces a JavaScript value to a GraphQL type, or produces errors. +export { coerceValue } from "./coerceValue"; + +// @deprecated use coerceValue export { isValidJSValue } from "./isValidJSValue"; // Determine if AST values adhere to a GraphQL type. @@ -64,11 +86,17 @@ export { separateOperations } from "./separateOperations"; export { isEqualType, isTypeSubTypeOf, doTypesOverlap } from "./typeComparators"; // Asserts that a string is a valid GraphQL name -export { assertValidName } from "./assertValidName"; +export { assertValidName, isValidNameError } from "./assertValidName"; // Compares two GraphQLSchemas and detects breaking changes. -export { findBreakingChanges } from "./findBreakingChanges"; -export { BreakingChange } from "./findBreakingChanges"; +export { + BreakingChangeType, + DangerousChangeType, + findBreakingChanges, + findDangerousChanges, + BreakingChange, + DangerousChange, +} from "./findBreakingChanges"; // Report all deprecated usage within a GraphQL document. export { findDeprecatedUsages } from "./findDeprecatedUsages"; diff --git a/types/graphql/utilities/introspectionFromSchema.d.ts b/types/graphql/utilities/introspectionFromSchema.d.ts new file mode 100644 index 0000000000..8733a35087 --- /dev/null +++ b/types/graphql/utilities/introspectionFromSchema.d.ts @@ -0,0 +1,13 @@ +import { GraphQLSchema } from "../type/schema"; +import { IntrospectionQuery, IntrospectionOptions } from "./introspectionQuery"; + +/** + * Build an IntrospectionQuery from a GraphQLSchema + * + * IntrospectionQuery is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of buildClientSchema. The primary use case is outside + * of the server context, for instance when doing schema comparisons. + */ +export function introspectionFromSchema(schema: GraphQLSchema, options: IntrospectionOptions): IntrospectionQuery; diff --git a/types/graphql/utilities/introspectionQuery.d.ts b/types/graphql/utilities/introspectionQuery.d.ts index 10c3b0a200..750fe0d99c 100644 --- a/types/graphql/utilities/introspectionQuery.d.ts +++ b/types/graphql/utilities/introspectionQuery.d.ts @@ -1,110 +1,25 @@ -import { DirectiveLocationEnum } from "../type/directives"; +import { DirectiveLocationEnum } from "../language/directiveLocation"; -/* -query IntrospectionQuery { - __schema { - queryType { name } - mutationType { name } - subscriptionType { name } - types { - ...FullType - } - directives { - name - description - locations - args { - ...InputValue - } - } - } +export interface IntrospectionOptions { + // Whether to include descriptions in the introspection result. + // Default: true + descriptions: boolean; } -fragment FullType on __Type { - kind - name - description - fields(includeDeprecated: true) { - name - description - args { - ...InputValue - } - type { - ...TypeRef - } - isDeprecated - deprecationReason - } - inputFields { - ...InputValue - } - interfaces { - ...TypeRef - } - enumValues(includeDeprecated: true) { - name - description - isDeprecated - deprecationReason - } - possibleTypes { - ...TypeRef - } -} +export function getIntrospectionQuery(options?: IntrospectionOptions): string; -fragment InputValue on __InputValue { - name - description - type { ...TypeRef } - defaultValue -} - -fragment TypeRef on __Type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } -} -*/ export const introspectionQuery: string; export interface IntrospectionQuery { - __schema: IntrospectionSchema; + readonly __schema: IntrospectionSchema; } export interface IntrospectionSchema { - queryType: IntrospectionNamedTypeRef; - mutationType?: IntrospectionNamedTypeRef; - subscriptionType?: IntrospectionNamedTypeRef; - types: IntrospectionType[]; - directives: IntrospectionDirective[]; + readonly queryType: IntrospectionNamedTypeRef; + readonly mutationType: IntrospectionNamedTypeRef | void; + readonly subscriptionType: IntrospectionNamedTypeRef | void; + readonly types: ReadonlyArray; + readonly directives: ReadonlyArray; } export type IntrospectionType = @@ -115,92 +30,114 @@ export type IntrospectionType = | IntrospectionEnumType | IntrospectionInputObjectType; +export type IntrospectionOutputType = + | IntrospectionScalarType + | IntrospectionObjectType + | IntrospectionInterfaceType + | IntrospectionUnionType + | IntrospectionEnumType; + +export type IntrospectionInputType = IntrospectionScalarType | IntrospectionEnumType | IntrospectionInputObjectType; + export interface IntrospectionScalarType { - kind: "SCALAR"; - name: string; - description?: string; + readonly kind: "SCALAR"; + readonly name: string; + readonly description?: string | void; } export interface IntrospectionObjectType { - kind: "OBJECT"; - name: string; - description?: string; - fields: IntrospectionField[]; - interfaces: IntrospectionNamedTypeRef[]; + readonly kind: "OBJECT"; + readonly name: string; + readonly description?: string | void; + readonly fields: ReadonlyArray; + readonly interfaces: ReadonlyArray>; } export interface IntrospectionInterfaceType { - kind: "INTERFACE"; - name: string; - description?: string; - fields: IntrospectionField[]; - possibleTypes: IntrospectionNamedTypeRef[]; + readonly kind: "INTERFACE"; + readonly name: string; + readonly description?: string | void; + readonly fields: ReadonlyArray; + readonly possibleTypes: ReadonlyArray>; } export interface IntrospectionUnionType { - kind: "UNION"; - name: string; - description?: string; - possibleTypes: IntrospectionNamedTypeRef[]; + readonly kind: "UNION"; + readonly name: string; + readonly description?: string | void; + readonly possibleTypes: ReadonlyArray>; } export interface IntrospectionEnumType { - kind: "ENUM"; - name: string; - description?: string; - enumValues: IntrospectionEnumValue[]; + readonly kind: "ENUM"; + readonly name: string; + readonly description?: string | void; + readonly enumValues: ReadonlyArray; } export interface IntrospectionInputObjectType { - kind: "INPUT_OBJECT"; - name: string; - description?: string; - inputFields: IntrospectionInputValue[]; + readonly kind: "INPUT_OBJECT"; + readonly name: string; + readonly description?: string | void; + readonly inputFields: ReadonlyArray; } -export type IntrospectionTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | IntrospectionNonNullTypeRef; - -export interface IntrospectionNamedTypeRef { - kind: string; - name: string; +export interface IntrospectionListTypeRef { + readonly kind: "LIST"; + readonly ofType: T; } -export interface IntrospectionListTypeRef { - kind: "LIST"; - ofType?: IntrospectionTypeRef; +export interface IntrospectionNonNullTypeRef { + readonly kind: "NON_NULL"; + readonly ofType: T; } -export interface IntrospectionNonNullTypeRef { - kind: "NON_NULL"; - ofType?: IntrospectionTypeRef; +export type IntrospectionTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; + +export type IntrospectionOutputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; + +export type IntrospectionInputTypeRef = + | IntrospectionNamedTypeRef + | IntrospectionListTypeRef + | IntrospectionNonNullTypeRef | IntrospectionListTypeRef>; + +export interface IntrospectionNamedTypeRef { + readonly kind: T["kind"]; + readonly name: string; } export interface IntrospectionField { - name: string; - description?: string; - args: IntrospectionInputValue[]; - type: IntrospectionTypeRef; - isDeprecated: boolean; - deprecationReason?: string; + readonly name: string; + readonly description?: string | void; + readonly args: ReadonlyArray; + readonly type: IntrospectionOutputTypeRef; + readonly isDeprecated: boolean; + readonly deprecationReason?: string | void; } export interface IntrospectionInputValue { - name: string; - description?: string; - type: IntrospectionTypeRef; - defaultValue?: string; + readonly name: string; + readonly description?: string | void; + readonly type: IntrospectionInputTypeRef; + readonly defaultValue?: string | void; } export interface IntrospectionEnumValue { - name: string; - description?: string; - isDeprecated: boolean; - deprecationReason?: string; + readonly name: string; + readonly description?: string | void; + readonly isDeprecated: boolean; + readonly deprecationReason?: string | void; } export interface IntrospectionDirective { - name: string; - description?: string; - locations: DirectiveLocationEnum[]; - args: IntrospectionInputValue[]; + readonly name: string; + readonly description?: string | void; + readonly locations: ReadonlyArray; + readonly args: ReadonlyArray; } diff --git a/types/graphql/utilities/isValidJSValue.d.ts b/types/graphql/utilities/isValidJSValue.d.ts index 557429c7f4..d45d104ffd 100644 --- a/types/graphql/utilities/isValidJSValue.d.ts +++ b/types/graphql/utilities/isValidJSValue.d.ts @@ -1,8 +1,6 @@ import { GraphQLInputType } from "../type/definition"; /** - * Given a JavaScript value and a GraphQL type, determine if the value will be - * accepted for that type. This is primarily useful for validating the - * runtime values of query variables. + * Deprecated. Use coerceValue() directly for richer information. */ export function isValidJSValue(value: any, type: GraphQLInputType): string[]; diff --git a/types/graphql/utilities/isValidLiteralValue.d.ts b/types/graphql/utilities/isValidLiteralValue.d.ts index bf54f6bb22..6a9275bce9 100644 --- a/types/graphql/utilities/isValidLiteralValue.d.ts +++ b/types/graphql/utilities/isValidLiteralValue.d.ts @@ -1,11 +1,10 @@ +import { GraphQLError } from "../error/GraphQLError"; import { ValueNode } from "../language/ast"; import { GraphQLInputType } from "../type/definition"; /** - * Utility for validators which determines if a value literal AST is valid given - * an input type. + * Utility which determines if a value literal node is valid for an input type. * - * Note that this only validates literal values, variables are assumed to - * provide values of the correct type. + * Deprecated. Rely on validation for documents containing literal values. */ -export function isValidLiteralValue(type: GraphQLInputType, valueNode: ValueNode): string[]; +export function isValidLiteralValue(type: GraphQLInputType, valueNode: ValueNode): ReadonlyArray; diff --git a/types/graphql/utilities/lexicographicSortSchema.d.ts b/types/graphql/utilities/lexicographicSortSchema.d.ts new file mode 100644 index 0000000000..24ec208bba --- /dev/null +++ b/types/graphql/utilities/lexicographicSortSchema.d.ts @@ -0,0 +1,6 @@ +import { GraphQLSchema } from "../type/schema"; + +/** + * Sort GraphQLSchema. + */ +export function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema; diff --git a/types/graphql/utilities/schemaPrinter.d.ts b/types/graphql/utilities/schemaPrinter.d.ts index d49e6aee58..8e3aefe7fc 100644 --- a/types/graphql/utilities/schemaPrinter.d.ts +++ b/types/graphql/utilities/schemaPrinter.d.ts @@ -1,12 +1,19 @@ import { GraphQLSchema } from "../type/schema"; -import { GraphQLType } from "../type/definition"; +import { GraphQLType, GraphQLNamedType } from "../type/definition"; -export interface PrinterOptions { +export interface Options { commentDescriptions?: boolean; } -export function printSchema(schema: GraphQLSchema, options?: PrinterOptions): string; +/** + * Accepts options as a second argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * + */ +export function printSchema(schema: GraphQLSchema, options?: Options): string; -export function printIntrospectionSchema(schema: GraphQLSchema, options?: PrinterOptions): string; +export function printIntrospectionSchema(schema: GraphQLSchema, options?: Options): string; -export function printType(type: GraphQLType, options?: PrinterOptions): string; +export function printType(type: GraphQLNamedType, options?: Options): string; diff --git a/types/graphql/utilities/separateOperations.d.ts b/types/graphql/utilities/separateOperations.d.ts index 8269b22d75..6035084860 100644 --- a/types/graphql/utilities/separateOperations.d.ts +++ b/types/graphql/utilities/separateOperations.d.ts @@ -1,3 +1,9 @@ import { DocumentNode, OperationDefinitionNode } from "../language/ast"; -export function separateOperations(documentAST: DocumentNode): { [operationName: string]: DocumentNode }; +/** + * separateOperations accepts a single AST document which may contain many + * operations and fragments and returns a collection of AST documents each of + * which contains a single operation as well the fragment definitions it + * refers to. + */ +export function separateOperations(documentAST: DocumentNode): { [key: string]: DocumentNode }; diff --git a/types/graphql/utilities/typeFromAST.d.ts b/types/graphql/utilities/typeFromAST.d.ts index 79b7b24a38..f2adaa7762 100644 --- a/types/graphql/utilities/typeFromAST.d.ts +++ b/types/graphql/utilities/typeFromAST.d.ts @@ -1,5 +1,16 @@ -import { TypeNode } from "../language/ast"; -import { GraphQLType, GraphQLNullableType } from "../type/definition"; +import { TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode } from "../language/ast"; +import { GraphQLType, GraphQLNullableType, GraphQLNamedType, GraphQLList, GraphQLNonNull } from "../type/definition"; import { GraphQLSchema } from "../type/schema"; -export function typeFromAST(schema: GraphQLSchema, typeNode: TypeNode): GraphQLType; +/** + * Given a Schema and an AST node describing a type, return a GraphQLType + * definition which applies to that type. For example, if provided the parsed + * AST node for `[User]`, a GraphQLList instance will be returned, containing + * the type called "User" found in the schema. If a type called "User" is not + * found in the schema, then undefined will be returned. + */ +export function typeFromAST(schema: GraphQLSchema, typeNode: NamedTypeNode): GraphQLNamedType | undefined; + +export function typeFromAST(schema: GraphQLSchema, typeNode: ListTypeNode): GraphQLList | undefined; + +export function typeFromAST(schema: GraphQLSchema, typeNode: NonNullTypeNode): GraphQLNonNull | undefined; diff --git a/types/graphql/utilities/valueFromAST.d.ts b/types/graphql/utilities/valueFromAST.d.ts index e0b06b0506..cd67108aad 100644 --- a/types/graphql/utilities/valueFromAST.d.ts +++ b/types/graphql/utilities/valueFromAST.d.ts @@ -1,10 +1,28 @@ import { GraphQLInputType } from "../type/definition"; import { ValueNode, VariableNode, ListValueNode, ObjectValueNode } from "../language/ast"; +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `undefined` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | JSON Value | + * | -------------------- | ------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Number | + * | Enum Value | Mixed | + * | NullValue | null | + * + */ export function valueFromAST( - valueNode: ValueNode, + valueNode: ValueNode | void, type: GraphQLInputType, - variables?: { - [key: string]: any; - } + variables?: { [key: string]: any } | void ): any; diff --git a/types/graphql/utilities/valueFromASTUntyped.d.ts b/types/graphql/utilities/valueFromASTUntyped.d.ts new file mode 100644 index 0000000000..98d3137694 --- /dev/null +++ b/types/graphql/utilities/valueFromASTUntyped.d.ts @@ -0,0 +1,19 @@ +import { ValueNode } from "../language/ast"; + +/** + * Produces a JavaScript value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | JavaScript Value | + * | -------------------- | ---------------- | + * | Input Object | Object | + * | List | Array | + * | Boolean | Boolean | + * | String / Enum | String | + * | Int / Float | Number | + * | Null | null | + * + */ +export function valueFromASTUntyped(valueNode: ValueNode, variables?: { [key: string]: any } | void): any; diff --git a/types/graphql/validation/ValidationContext.d.ts b/types/graphql/validation/ValidationContext.d.ts new file mode 100644 index 0000000000..0f8a4ea8f7 --- /dev/null +++ b/types/graphql/validation/ValidationContext.d.ts @@ -0,0 +1,63 @@ +import { GraphQLError } from "../error"; +import { + DocumentNode, + OperationDefinitionNode, + VariableNode, + SelectionSetNode, + FragmentSpreadNode, + FragmentDefinitionNode, +} from "../language/ast"; +import { GraphQLSchema } from "../type/schema"; +import { + GraphQLInputType, + GraphQLOutputType, + GraphQLCompositeType, + GraphQLField, + GraphQLArgument, +} from "../type/definition"; +import { GraphQLDirective } from "../type/directives"; +import { TypeInfo } from "../utilities/TypeInfo"; + +type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; +type VariableUsage = { node: VariableNode; type: GraphQLInputType | void }; + +/** + * An instance of this class is passed as the "this" context to all validators, + * allowing access to commonly useful contextual information from within a + * validation rule. + */ +export default class ValidationContext { + constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); + + reportError(error: GraphQLError): undefined; + + getErrors(): ReadonlyArray; + + getSchema(): GraphQLSchema; + + getDocument(): DocumentNode; + + getFragment(name: string): FragmentDefinitionNode | void; + + getFragmentSpreads(node: SelectionSetNode): ReadonlyArray; + + getRecursivelyReferencedFragments(operation: OperationDefinitionNode): ReadonlyArray; + + getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray; + + getRecursiveVariableUsages(operation: OperationDefinitionNode): ReadonlyArray; + + getType(): GraphQLOutputType | void; + + getParentType(): GraphQLCompositeType | void; + + getInputType(): GraphQLInputType | void; + + getParentInputType(): GraphQLInputType | void; + + getFieldDef(): GraphQLField | void; + + getDirective(): GraphQLDirective | void; + + getArgument(): GraphQLArgument | void; +} diff --git a/types/graphql/validation/index.d.ts b/types/graphql/validation/index.d.ts index 4353da53fa..911c592432 100644 --- a/types/graphql/validation/index.d.ts +++ b/types/graphql/validation/index.d.ts @@ -1,12 +1,10 @@ -export { validate, ValidationContext } from "./validate"; +export { validate } from "./validate"; + +import ValidationContext from "./ValidationContext"; +export { ValidationContext }; + export { specifiedRules } from "./specifiedRules"; -// Spec Section: "Argument Values Type Correctness" -export { ArgumentsOfCorrectType as ArgumentsOfCorrectTypeRule } from "./rules/ArgumentsOfCorrectType"; - -// Spec Section: "Variable Default Values Are Correctly Typed" -export { DefaultValuesOfCorrectType as DefaultValuesOfCorrectTypeRule } from "./rules/DefaultValuesOfCorrectType"; - // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" export { FieldsOnCorrectType as FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectType"; @@ -73,8 +71,14 @@ export { UniqueOperationNames as UniqueOperationNamesRule } from "./rules/Unique // Spec Section: "Variable Uniqueness" export { UniqueVariableNames as UniqueVariableNamesRule } from "./rules/UniqueVariableNames"; +// Spec Section: "Values Type Correctness" +export { ValuesOfCorrectType as ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectType"; + // Spec Section: "Variables are Input Types" export { VariablesAreInputTypes as VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypes"; +// Spec Section: "Variables Default Value Is Allowed" +export { VariablesDefaultValueAllowed as VariablesDefaultValueAllowedRule } from "./rules/VariablesDefaultValueAllowed"; + // Spec Section: "All Variable Usages Are Allowed" export { VariablesInAllowedPosition as VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPosition"; diff --git a/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts b/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts deleted file mode 100644 index 235db84162..0000000000 --- a/types/graphql/validation/rules/ArgumentsOfCorrectType.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationContext } from "../index"; - -/** - * Argument values of correct type - * - * A GraphQL document is only valid if all field argument literal values are - * of the type expected by their position. - */ -export function ArgumentsOfCorrectType(context: ValidationContext): any; diff --git a/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts b/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts deleted file mode 100644 index b617538a74..0000000000 --- a/types/graphql/validation/rules/DefaultValuesOfCorrectType.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ValidationContext } from "../index"; - -/** - * Variable default values of correct type - * - * A GraphQL document is only valid if all variable default values are of the - * type expected by their definition. - */ -export function DefaultValuesOfCorrectType(context: ValidationContext): any; diff --git a/types/graphql/validation/rules/ExecutableDefinitions.d.ts b/types/graphql/validation/rules/ExecutableDefinitions.d.ts new file mode 100644 index 0000000000..423e0dcad2 --- /dev/null +++ b/types/graphql/validation/rules/ExecutableDefinitions.d.ts @@ -0,0 +1,12 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function nonExecutableDefinitionMessage(defName: string): string; + +/** + * Executable definitions + * + * A GraphQL document is only valid for execution if all definitions are either + * operation or fragment definitions. + */ +export function ExecutableDefinitions(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/FieldsOnCorrectType.d.ts b/types/graphql/validation/rules/FieldsOnCorrectType.d.ts index 247de1298c..c5c7f053c2 100644 --- a/types/graphql/validation/rules/FieldsOnCorrectType.d.ts +++ b/types/graphql/validation/rules/FieldsOnCorrectType.d.ts @@ -1,4 +1,5 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; /** * Fields on correct type @@ -6,4 +7,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all fields selected are defined by the * parent type, or are an allowed meta field such as __typename. */ -export function FieldsOnCorrectType(context: ValidationContext): any; +export function FieldsOnCorrectType(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts b/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts index 384f43beb3..7c760e331f 100644 --- a/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts +++ b/types/graphql/validation/rules/FragmentsOnCompositeTypes.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function inlineFragmentOnNonCompositeErrorMessage(type: GraphQLType): string; + +export function fragmentOnNonCompositeErrorMessage(fragName: string, type: GraphQLType): string; /** * Fragments on composite type @@ -7,4 +13,4 @@ import { ValidationContext } from "../index"; * can only be spread into a composite type (object, interface, or union), the * type condition must also be a composite type. */ -export function FragmentsOnCompositeTypes(context: ValidationContext): any; +export function FragmentsOnCompositeTypes(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownArgumentNames.d.ts b/types/graphql/validation/rules/KnownArgumentNames.d.ts index bd56137311..9602c34c43 100644 --- a/types/graphql/validation/rules/KnownArgumentNames.d.ts +++ b/types/graphql/validation/rules/KnownArgumentNames.d.ts @@ -1,4 +1,18 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownArgMessage( + argName: string, + fieldName: string, + typeName: string, + suggestedArgs: Array +): string; + +export function unknownDirectiveArgMessage( + argName: string, + directiveName: string, + suggestedArgs: Array +): string; /** * Known argument names @@ -6,4 +20,4 @@ import { ValidationContext } from "../index"; * A GraphQL field is only valid if all supplied arguments are defined by * that field. */ -export function KnownArgumentNames(context: ValidationContext): any; +export function KnownArgumentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownDirectives.d.ts b/types/graphql/validation/rules/KnownDirectives.d.ts index 40e58ce0c3..179e65b9f7 100644 --- a/types/graphql/validation/rules/KnownDirectives.d.ts +++ b/types/graphql/validation/rules/KnownDirectives.d.ts @@ -1,4 +1,9 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownDirectiveMessage(directiveName: string): string; + +export function misplacedDirectiveMessage(directiveName: string, location: string): string; /** * Known directives @@ -6,4 +11,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all `@directives` are known by the * schema and legally positioned. */ -export function KnownDirectives(context: ValidationContext): any; +export function KnownDirectives(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownFragmentNames.d.ts b/types/graphql/validation/rules/KnownFragmentNames.d.ts index c5fa899995..40405f67dd 100644 --- a/types/graphql/validation/rules/KnownFragmentNames.d.ts +++ b/types/graphql/validation/rules/KnownFragmentNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownFragmentMessage(fragName: string): string; /** * Known fragment names @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all `...Fragment` fragment spreads refer * to fragments defined in the same document. */ -export function KnownFragmentNames(context: ValidationContext): any; +export function KnownFragmentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/KnownTypeNames.d.ts b/types/graphql/validation/rules/KnownTypeNames.d.ts index ab8abce9d5..6bef3661f9 100644 --- a/types/graphql/validation/rules/KnownTypeNames.d.ts +++ b/types/graphql/validation/rules/KnownTypeNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unknownTypeMessage(typeName: string, suggestedTypes: Array): string; /** * Known type names @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if referenced types (specifically * variable definitions and fragment conditions) are defined by the type schema. */ -export function KnownTypeNames(context: ValidationContext): any; +export function KnownTypeNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/LoneAnonymousOperation.d.ts b/types/graphql/validation/rules/LoneAnonymousOperation.d.ts index f281df2bce..881814c4d2 100644 --- a/types/graphql/validation/rules/LoneAnonymousOperation.d.ts +++ b/types/graphql/validation/rules/LoneAnonymousOperation.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function anonOperationNotAloneMessage(): string; /** * Lone anonymous operation @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if when it contains an anonymous operation * (the query short-hand) that it contains only that one operation definition. */ -export function LoneAnonymousOperation(context: ValidationContext): any; +export function LoneAnonymousOperation(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoFragmentCycles.d.ts b/types/graphql/validation/rules/NoFragmentCycles.d.ts index 4cce233cd5..f119c5a487 100644 --- a/types/graphql/validation/rules/NoFragmentCycles.d.ts +++ b/types/graphql/validation/rules/NoFragmentCycles.d.ts @@ -1,3 +1,6 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; -export function NoFragmentCycles(context: ValidationContext): any; +export function cycleErrorMessage(fragName: string, spreadNames: Array): string; + +export function NoFragmentCycles(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUndefinedVariables.d.ts b/types/graphql/validation/rules/NoUndefinedVariables.d.ts index 418e3cf2b5..611ad01a9b 100644 --- a/types/graphql/validation/rules/NoUndefinedVariables.d.ts +++ b/types/graphql/validation/rules/NoUndefinedVariables.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function undefinedVarMessage(varName: string, opName: string | void): string; /** * No undefined variables @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL operation is only valid if all variables encountered, both directly * and via fragment spreads, are defined by that operation. */ -export function NoUndefinedVariables(context: ValidationContext): any; +export function NoUndefinedVariables(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUnusedFragments.d.ts b/types/graphql/validation/rules/NoUnusedFragments.d.ts index 7a099e66be..6f757c16c2 100644 --- a/types/graphql/validation/rules/NoUnusedFragments.d.ts +++ b/types/graphql/validation/rules/NoUnusedFragments.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unusedFragMessage(fragName: string): string; /** * No unused fragments @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all fragment definitions are spread * within operations, or spread within other fragments spread within operations. */ -export function NoUnusedFragments(context: ValidationContext): any; +export function NoUnusedFragments(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/NoUnusedVariables.d.ts b/types/graphql/validation/rules/NoUnusedVariables.d.ts index 53692ed494..10282cdacd 100644 --- a/types/graphql/validation/rules/NoUnusedVariables.d.ts +++ b/types/graphql/validation/rules/NoUnusedVariables.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function unusedVariableMessage(varName: string, opName: string | void): string; /** * No unused variables @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL operation is only valid if all variables defined by an operation * are used, either directly or within a spread fragment. */ -export function NoUnusedVariables(context: ValidationContext): any; +export function NoUnusedVariables(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts b/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts index 302617386b..1dfa62a089 100644 --- a/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts +++ b/types/graphql/validation/rules/OverlappingFieldsCanBeMerged.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function fieldsConflictMessage(responseName: string, reason: ConflictReasonMessage): string; /** * Overlapping fields can be merged @@ -7,4 +10,10 @@ import { ValidationContext } from "../index"; * fragments) either correspond to distinct response names or can be merged * without ambiguity. */ -export function OverlappingFieldsCanBeMerged(context: ValidationContext): any; +export function OverlappingFieldsCanBeMerged(context: ValidationContext): ASTVisitor; + +// Field name and reason. +type ConflictReason = [string, string]; + +// Reason is a string, or a nested list of conflicts. +type ConflictReasonMessage = string | Array; diff --git a/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts b/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts index e9e10aca14..f318cb189e 100644 --- a/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts +++ b/types/graphql/validation/rules/PossibleFragmentSpreads.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function typeIncompatibleSpreadMessage(fragName: string, parentType: GraphQLType, fragType: GraphQLType): string; + +export function typeIncompatibleAnonSpreadMessage(parentType: GraphQLType, fragType: GraphQLType): string; /** * Possible fragment spread @@ -7,4 +13,4 @@ import { ValidationContext } from "../index"; * be true: if there is a non-empty intersection of the possible parent types, * and possible types which pass the type condition. */ -export function PossibleFragmentSpreads(context: ValidationContext): any; +export function PossibleFragmentSpreads(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts b/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts index 291a3ab5bc..e442b47f83 100644 --- a/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts +++ b/types/graphql/validation/rules/ProvidedNonNullArguments.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function missingFieldArgMessage(fieldName: string, argName: string, type: GraphQLType): string; + +export function missingDirectiveArgMessage(directiveName: string, argName: string, type: GraphQLType): string; /** * Provided required arguments @@ -6,4 +12,4 @@ import { ValidationContext } from "../index"; * A field or directive is only valid if all required (non-null) field arguments * have been provided. */ -export function ProvidedNonNullArguments(context: ValidationContext): any; +export function ProvidedNonNullArguments(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ScalarLeafs.d.ts b/types/graphql/validation/rules/ScalarLeafs.d.ts index 8505cc2512..5bbf85043a 100644 --- a/types/graphql/validation/rules/ScalarLeafs.d.ts +++ b/types/graphql/validation/rules/ScalarLeafs.d.ts @@ -1,4 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function noSubselectionAllowedMessage(fieldName: string, type: GraphQLType): string; + +export function requiredSubselectionMessage(fieldName: string, type: GraphQLType): string; /** * Scalar leafs @@ -6,4 +12,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is valid only if all leaf fields (fields without * sub selections) are of scalar or enum types. */ -export function ScalarLeafs(context: ValidationContext): any; +export function ScalarLeafs(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts b/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts index d6f8fa2c6b..fef0869710 100644 --- a/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts +++ b/types/graphql/validation/rules/SingleFieldSubscriptions.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function singleFieldOnlyMessage(name: string | void): string; /** * Subscriptions must only include one field. * * A GraphQL subscription is valid only if it contains a single root field. */ -export function SingleFieldSubscriptions(context: ValidationContext): any; +export function SingleFieldSubscriptions(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueArgumentNames.d.ts b/types/graphql/validation/rules/UniqueArgumentNames.d.ts index f4cc750b86..47a59c3362 100644 --- a/types/graphql/validation/rules/UniqueArgumentNames.d.ts +++ b/types/graphql/validation/rules/UniqueArgumentNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateArgMessage(argName: string): string; /** * Unique argument names @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL field or directive is only valid if all supplied arguments are * uniquely named. */ -export function UniqueArgumentNames(context: ValidationContext): any; +export function UniqueArgumentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts b/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts index 80d4a252c6..f3d6327c23 100644 --- a/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts +++ b/types/graphql/validation/rules/UniqueDirectivesPerLocation.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateDirectiveMessage(directiveName: string): string; /** * Unique directive names per location @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL document is only valid if all directives at a given location * are uniquely named. */ -export function UniqueDirectivesPerLocation(context: ValidationContext): any; +export function UniqueDirectivesPerLocation(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueFragmentNames.d.ts b/types/graphql/validation/rules/UniqueFragmentNames.d.ts index 525befc0a9..9a2554200c 100644 --- a/types/graphql/validation/rules/UniqueFragmentNames.d.ts +++ b/types/graphql/validation/rules/UniqueFragmentNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateFragmentNameMessage(fragName: string): string; /** * Unique fragment names * * A GraphQL document is only valid if all defined fragments have unique names. */ -export function UniqueFragmentNames(context: ValidationContext): any; +export function UniqueFragmentNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueInputFieldNames.d.ts b/types/graphql/validation/rules/UniqueInputFieldNames.d.ts index f81fb25e5c..34d5b9845a 100644 --- a/types/graphql/validation/rules/UniqueInputFieldNames.d.ts +++ b/types/graphql/validation/rules/UniqueInputFieldNames.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateInputFieldMessage(fieldName: string): string; /** * Unique input field names @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL input object value is only valid if all supplied fields are * uniquely named. */ -export function UniqueInputFieldNames(context: ValidationContext): any; +export function UniqueInputFieldNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueOperationNames.d.ts b/types/graphql/validation/rules/UniqueOperationNames.d.ts index 5080307d4b..221b1187c2 100644 --- a/types/graphql/validation/rules/UniqueOperationNames.d.ts +++ b/types/graphql/validation/rules/UniqueOperationNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateOperationNameMessage(operationName: string): string; /** * Unique operation names * * A GraphQL document is only valid if all defined operations have unique names. */ -export function UniqueOperationNames(context: ValidationContext): any; +export function UniqueOperationNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/UniqueVariableNames.d.ts b/types/graphql/validation/rules/UniqueVariableNames.d.ts index a0a029d165..d0aaf0404e 100644 --- a/types/graphql/validation/rules/UniqueVariableNames.d.ts +++ b/types/graphql/validation/rules/UniqueVariableNames.d.ts @@ -1,8 +1,11 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function duplicateVariableMessage(variableName: string): string; /** * Unique variable names * * A GraphQL operation is only valid if all its variables are uniquely named. */ -export function UniqueVariableNames(context: ValidationContext): any; +export function UniqueVariableNames(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/ValuesOfCorrectType.d.ts b/types/graphql/validation/rules/ValuesOfCorrectType.d.ts new file mode 100644 index 0000000000..09314835ad --- /dev/null +++ b/types/graphql/validation/rules/ValuesOfCorrectType.d.ts @@ -0,0 +1,16 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function badValueMessage(typeName: string, valueName: string, message?: string): string; + +export function requiredFieldMessage(typeName: string, fieldName: string, fieldTypeName: string): string; + +export function unknownFieldMessage(typeName: string, fieldName: string, message?: string): string; + +/** + * Value literals of correct type + * + * A GraphQL document is only valid if all value literals are of the type + * expected at their position. + */ +export function ValuesOfCorrectType(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesAreInputTypes.d.ts b/types/graphql/validation/rules/VariablesAreInputTypes.d.ts index 79846a3073..32472e15fd 100644 --- a/types/graphql/validation/rules/VariablesAreInputTypes.d.ts +++ b/types/graphql/validation/rules/VariablesAreInputTypes.d.ts @@ -1,4 +1,7 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; + +export function nonInputTypeOnVarMessage(variableName: string, typeName: string): string; /** * Variables are input types @@ -6,4 +9,4 @@ import { ValidationContext } from "../index"; * A GraphQL operation is only valid if all the variables it defines are of * input types (scalar, enum, or input object). */ -export function VariablesAreInputTypes(context: ValidationContext): any; +export function VariablesAreInputTypes(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts b/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts new file mode 100644 index 0000000000..1961eb645e --- /dev/null +++ b/types/graphql/validation/rules/VariablesDefaultValueAllowed.d.ts @@ -0,0 +1,13 @@ +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function defaultForRequiredVarMessage(varName: string, type: GraphQLType, guessType: GraphQLType): string; + +/** + * Variable's default value is allowed + * + * A GraphQL document is only valid if all variable default values are allowed + * due to a variable not being required. + */ +export function VariablesDefaultValueAllowed(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts b/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts index bd302a73b4..f21ed5c7fb 100644 --- a/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts +++ b/types/graphql/validation/rules/VariablesInAllowedPosition.d.ts @@ -1,6 +1,10 @@ -import { ValidationContext } from "../index"; +import ValidationContext from "../ValidationContext"; +import { ASTVisitor } from "../../language/visitor"; +import { GraphQLType } from "../../type/definition"; + +export function badVarPosMessage(varName: string, varType: GraphQLType, expectedType: GraphQLType): string; /** * Variables passed to field arguments conform to type */ -export function VariablesInAllowedPosition(context: ValidationContext): any; +export function VariablesInAllowedPosition(context: ValidationContext): ASTVisitor; diff --git a/types/graphql/validation/specifiedRules.d.ts b/types/graphql/validation/specifiedRules.d.ts index 5afc1a09e5..8e9815377f 100644 --- a/types/graphql/validation/specifiedRules.d.ts +++ b/types/graphql/validation/specifiedRules.d.ts @@ -1,6 +1,90 @@ -import { ValidationContext } from "./validate"; // It needs to check. +// Spec Section: "Executable Definitions" +import { ExecutableDefinitions } from "./rules/ExecutableDefinitions"; + +// Spec Section: "Operation Name Uniqueness" +import { UniqueOperationNames } from "./rules/UniqueOperationNames"; + +// Spec Section: "Lone Anonymous Operation" +import { LoneAnonymousOperation } from "./rules/LoneAnonymousOperation"; + +// Spec Section: "Subscriptions with Single Root Field" +import { SingleFieldSubscriptions } from "./rules/SingleFieldSubscriptions"; + +// Spec Section: "Fragment Spread Type Existence" +import { KnownTypeNames } from "./rules/KnownTypeNames"; + +// Spec Section: "Fragments on Composite Types" +import { FragmentsOnCompositeTypes } from "./rules/FragmentsOnCompositeTypes"; + +// Spec Section: "Variables are Input Types" +import { VariablesAreInputTypes } from "./rules/VariablesAreInputTypes"; + +// Spec Section: "Leaf Field Selections" +import { ScalarLeafs } from "./rules/ScalarLeafs"; + +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" +import { FieldsOnCorrectType } from "./rules/FieldsOnCorrectType"; + +// Spec Section: "Fragment Name Uniqueness" +import { UniqueFragmentNames } from "./rules/UniqueFragmentNames"; + +// Spec Section: "Fragment spread target defined" +import { KnownFragmentNames } from "./rules/KnownFragmentNames"; + +// Spec Section: "Fragments must be used" +import { NoUnusedFragments } from "./rules/NoUnusedFragments"; + +// Spec Section: "Fragment spread is possible" +import { PossibleFragmentSpreads } from "./rules/PossibleFragmentSpreads"; + +// Spec Section: "Fragments must not form cycles" +import { NoFragmentCycles } from "./rules/NoFragmentCycles"; + +// Spec Section: "Variable Uniqueness" +import { UniqueVariableNames } from "./rules/UniqueVariableNames"; + +// Spec Section: "All Variable Used Defined" +import { NoUndefinedVariables } from "./rules/NoUndefinedVariables"; + +// Spec Section: "All Variables Used" +import { NoUnusedVariables } from "./rules/NoUnusedVariables"; + +// Spec Section: "Directives Are Defined" +import { KnownDirectives } from "./rules/KnownDirectives"; + +// Spec Section: "Directives Are Unique Per Location" +import { UniqueDirectivesPerLocation } from "./rules/UniqueDirectivesPerLocation"; + +// Spec Section: "Argument Names" +import { KnownArgumentNames } from "./rules/KnownArgumentNames"; + +// Spec Section: "Argument Uniqueness" +import { UniqueArgumentNames } from "./rules/UniqueArgumentNames"; + +// Spec Section: "Value Type Correctness" +import { ValuesOfCorrectType } from "./rules/ValuesOfCorrectType"; + +// Spec Section: "Argument Optionality" +import { ProvidedNonNullArguments } from "./rules/ProvidedNonNullArguments"; + +// Spec Section: "Variables Default Value Is Allowed" +import { VariablesDefaultValueAllowed } from "./rules/VariablesDefaultValueAllowed"; + +// Spec Section: "All Variable Usages Are Allowed" +import { VariablesInAllowedPosition } from "./rules/VariablesInAllowedPosition"; + +// Spec Section: "Field Selection Merging" +import { OverlappingFieldsCanBeMerged } from "./rules/OverlappingFieldsCanBeMerged"; + +// Spec Section: "Input Object Field Uniqueness" +import { UniqueInputFieldNames } from "./rules/UniqueInputFieldNames"; + +import ValidationContext from "./ValidationContext"; /** * This set includes all validation rules defined by the GraphQL spec. + * + * The order of the rules in this list has been adjusted to lead to the + * most clear output when encountering multiple validation errors. */ export const specifiedRules: Array<(context: ValidationContext) => any>; diff --git a/types/graphql/validation/validate.d.ts b/types/graphql/validation/validate.d.ts index c60c3bf072..9a5092d258 100644 --- a/types/graphql/validation/validate.d.ts +++ b/types/graphql/validation/validate.d.ts @@ -1,23 +1,7 @@ import { GraphQLError } from "../error"; -import { - DocumentNode, - OperationDefinitionNode, - VariableNode, - SelectionSetNode, - FragmentSpreadNode, - FragmentDefinitionNode, -} from "../language/ast"; +import { DocumentNode } from "../language/ast"; import { GraphQLSchema } from "../type/schema"; -import { - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument, -} from "../type/definition"; -import { GraphQLDirective } from "../type/directives"; import { TypeInfo } from "../utilities/TypeInfo"; -import { specifiedRules } from "./specifiedRules"; /** * Implements the "Validation" section of the spec. @@ -31,62 +15,13 @@ import { specifiedRules } from "./specifiedRules"; * Each validation rules is a function which returns a visitor * (see the language/visitor API). Visitor methods are expected to return * GraphQLErrors, or Arrays of GraphQLErrors when invalid. - */ -export function validate(schema: GraphQLSchema, ast: DocumentNode, rules?: any[]): GraphQLError[]; - -/** - * This uses a specialized visitor which runs multiple visitors in parallel, - * while maintaining the visitor skip and break API. * - * @internal + * Optionally a custom TypeInfo instance may be provided. If not provided, one + * will be created from the provided schema. */ -export function visitUsingRules( +export function validate( schema: GraphQLSchema, - typeInfo: TypeInfo, - documentAST: DocumentNode, - rules: any[] -): GraphQLError[]; - -export type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; -export interface VariableUsage { - node: VariableNode; - type: GraphQLInputType; -} - -/** - * An instance of this class is passed as the "this" context to all validators, - * allowing access to commonly useful contextual information from within a - * validation rule. - */ -export class ValidationContext { - constructor(schema: GraphQLSchema, ast: DocumentNode, typeInfo: TypeInfo); - reportError(error: GraphQLError): void; - - getErrors(): GraphQLError[]; - - getSchema(): GraphQLSchema; - - getDocument(): DocumentNode; - - getFragment(name: string): FragmentDefinitionNode; - - getFragmentSpreads(node: SelectionSetNode): FragmentSpreadNode[]; - - getRecursivelyReferencedFragments(operation: OperationDefinitionNode): FragmentDefinitionNode[]; - - getVariableUsages(node: NodeWithSelectionSet): VariableUsage[]; - - getRecursiveVariableUsages(operation: OperationDefinitionNode): VariableUsage[]; - - getType(): GraphQLOutputType; - - getParentType(): GraphQLCompositeType; - - getInputType(): GraphQLInputType; - - getFieldDef(): GraphQLField; - - getDirective(): GraphQLDirective; - - getArgument(): GraphQLArgument; -} + ast: DocumentNode, + rules?: ReadonlyArray, + typeInfo?: TypeInfo +): ReadonlyArray; diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index 3628a7a931..d75da47e5e 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -1143,7 +1143,7 @@ export interface RouteOptionsAccess { * [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-routeoptionscache) */ export type RouteOptionsCache = { - privacy?: 'default' | 'public' | 'privacy'; + privacy?: 'default' | 'public' | 'private'; statuses?: number[]; otherwise?: string; } & ( @@ -2586,7 +2586,7 @@ export interface ServerInjectOptions extends Shot.RequestOptions { /** * sets the initial value of request.app, defaults to {}. */ - app: ApplicationState; + app?: ApplicationState; /** * sets the initial value of request.plugins, defaults to {}. */ diff --git a/types/hellojs/hellojs-tests.ts b/types/hellojs/hellojs-tests.ts index 4a4e068379..8cf42d11e4 100644 --- a/types/hellojs/hellojs-tests.ts +++ b/types/hellojs/hellojs-tests.ts @@ -4,7 +4,8 @@ hello.init({ oauth: { version: 2, auth: '', - grant: '' + grant: '', + response_type: 'id_token token' }, refresh: true, scope_delim: ' ', diff --git a/types/hellojs/index.d.ts b/types/hellojs/index.d.ts index e8efdaf19c..5b23b29e07 100644 --- a/types/hellojs/index.d.ts +++ b/types/hellojs/index.d.ts @@ -53,7 +53,15 @@ declare namespace hello { type HelloJSResponseCallback = (r: any, headers: any) => void; - type HelloJSTokenResponseType = "token" | "code"; + type HelloJSTokenResponseType = + "code" + | "code id_token" + | "code id_token token" + | "code token" + | "id_token" + | "id_token token" + | "none" + | "token"; type HelloJSDisplayType = "popup" | "page" | "none"; diff --git a/types/highcharts/highstock.d.ts b/types/highcharts/highstock.d.ts index d2d81af469..a97ae9effa 100644 --- a/types/highcharts/highstock.d.ts +++ b/types/highcharts/highstock.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Highstock 2.1.5 +// Type definitions for Highstock 2.1.6 // Project: http://www.highcharts.com/ // Definitions by: David Deutsch @@ -87,12 +87,39 @@ declare namespace Highstock { scrollbar?: ScrollbarOptions; } + interface XAxisOptions extends AxisOptions { + ordinal?: boolean; + overscroll?: number; + } + + interface YAxisOptions extends AxisOptions { + height?: number | string; + maxLength?: number | string; + minLength?: number | string; + resize?: { + controlledAxis?: { + next?: Array; + prev?: Array; + }, + cursor?: string; + enabled?: boolean; + lineColor?: string; + lineDashStyle?: string; + lineWidth?: number; + x?: number; + y?: number; + }; + reversedStacks?: boolean; + tooltipValueFormat?: string; + top?: number | string; + } + interface Options extends Highcharts.Options { navigator?: NavigatorOptions; rangeSelector?: RangeSelectorOptions; scrollbar?: ScrollbarOptions; - xAxis?: AxisOptions[] | AxisOptions; - yAxis?: AxisOptions[] | AxisOptions; + xAxis?: XAxisOptions[] |XAxisOptions; + yAxis?: YAxisOptions[] | YAxisOptions; } interface Chart { diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index b793673215..d9258f7a48 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -17,7 +17,7 @@ import through = require('through'); declare namespace inquirer { type Prompts = { [name: string]: PromptModule }; type ChoiceType = string | objects.ChoiceOption | objects.Separator; - type Questions = + type Questions = | Question | ReadonlyArray> | Rx.Observable>; diff --git a/types/jackrabbit/index.d.ts b/types/jackrabbit/index.d.ts new file mode 100644 index 0000000000..ec0ff27fa9 --- /dev/null +++ b/types/jackrabbit/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for jackrabbit 4.3 +// Project: https://github.com/hunterloftis/jackrabbit +// Definitions by: Elvis Adomnica +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import { Connection, Options, Message } from 'amqplib'; + +declare namespace jackrabbit { + function jackrabbit(url: string): JackRabbit; + + interface JackRabbit extends NodeJS.EventEmitter { + default(): Exchange; + direct(name?: string): Exchange; + fanout(name?: string): Exchange; + topic(name?: string): Exchange; + close(callback: (e: Error) => any): void; + getInternals: () => { + amqp: any; + connection: Connection; + }; + } + + enum exchangeType { + direct = 'direct', + fanout = 'fanout', + topic = 'topic', + } + + interface Exchange extends NodeJS.EventEmitter { + name: string; + type: exchangeType; + options: Options.AssertExchange; + queue(options: QueueOptions): Queue; + connect(con: Connection): Exchange; + publish(message: any, options?: PublishOptions): Exchange; + } + + type PublishOptions = Options.Publish & { + key: string; + reply?: AckCallback; + }; + + type QueueOptions = Options.AssertQueue & { + name?: string; + key?: string; + keys?: ReadonlyArray; + prefetch?: number; + }; + + type AckCallback = (data?: any) => void; + + interface Queue extends NodeJS.EventEmitter { + name: string; + options: QueueOptions; + connect(con: Connection): void; + consume: ( + callback: (data: any, ack: AckCallback, nack: () => void, msg: Message) => void, + options?: Options.Consume + ) => void; + cancel(done: any): void; + purge(done: any): void; + } +} + +export default jackrabbit.jackrabbit; diff --git a/types/jackrabbit/jackrabbit-tests.ts b/types/jackrabbit/jackrabbit-tests.ts new file mode 100644 index 0000000000..57bd961259 --- /dev/null +++ b/types/jackrabbit/jackrabbit-tests.ts @@ -0,0 +1,62 @@ +import jackrabbit from 'jackrabbit'; + +const RABBIT_URL = 'amqp://localhost'; + +function onMessage(data: any) {} +function ack() {} + +// $ExpectError +jackrabbit(); +// $ExpectError +jackrabbit(1); + +const rabbit = jackrabbit(RABBIT_URL); + +// test default exchange based on '1-hello-world' example +const defaultExchange = rabbit.default(); +const hello = defaultExchange.queue({ name: 'hello' }); + +defaultExchange.publish('Hello World!', { key: 'hello' }); + +hello.consume(onMessage, { noAck: true }); + +// test fanout exchange based on '3-pubsub' example +const fanoutExchange = rabbit.fanout(); + +fanoutExchange.publish('this is a log'); + +const fanoutQueue = fanoutExchange.queue({ exclusive: true }); +fanoutQueue.consume(onMessage, { noAck: true }); + +// test direct exchange based on '4-routing' example +const directExchange = rabbit.direct('direct_logs'); + +directExchange.publish({ text: 'this is a harmless log' }, { key: 'info' }); +directExchange.publish({ text: 'this one is more important' }, { key: 'warning' }); +directExchange.publish({ text: 'pay attention to me!' }, { key: 'error' }); + +const errorsQueue = directExchange.queue({ exclusive: true, key: 'error' }); +const logsQueue = directExchange.queue({ exclusive: true, keys: ['info', 'warning'] }); + +errorsQueue.consume((onMessage, ack) => {}); +logsQueue.consume((onMessage, ack) => {}); + +// test reply based on '6-rpc' example +const exchange = rabbit.default(); +const rpc = exchange.queue({ name: 'rpc_queue', prefetch: 1, durable: false }); + +exchange.publish( + { n: 40 }, + { + key: 'rpc_queue', + reply: onReply, + } +); + +function onReply(data: any) {} + +rpc.consume(onRequest); + +function onRequest(data: any, reply: (data: any) => void) { + reply({ field: 'value' }); +} diff --git a/types/jackrabbit/tsconfig.json b/types/jackrabbit/tsconfig.json new file mode 100644 index 0000000000..3d053557b2 --- /dev/null +++ b/types/jackrabbit/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "jackrabbit-tests.ts"] +} diff --git a/types/jackrabbit/tslint.json b/types/jackrabbit/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jackrabbit/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jest-environment-puppeteer/index.d.ts b/types/jest-environment-puppeteer/index.d.ts new file mode 100644 index 0000000000..e22bee2f7d --- /dev/null +++ b/types/jest-environment-puppeteer/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for jest-environment-puppeteer 2.2 +// Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/jest-environment-puppeteer +// Definitions by: Josh Goldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Browser, Page } from "puppeteer"; + +declare global { + const browser: Browser; + const page: Page; +} + +export { }; diff --git a/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts b/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts new file mode 100644 index 0000000000..3de8c3661a --- /dev/null +++ b/types/jest-environment-puppeteer/jest-environment-puppeteer-tests.ts @@ -0,0 +1,4 @@ +import * as puppeteer from "puppeteer"; + +const myBrowser: puppeteer.Browser = browser; +const myPage: puppeteer.Page = page; diff --git a/types/jest-environment-puppeteer/tsconfig.json b/types/jest-environment-puppeteer/tsconfig.json new file mode 100644 index 0000000000..ed53d60edd --- /dev/null +++ b/types/jest-environment-puppeteer/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-environment-puppeteer-tests.ts" + ] +} diff --git a/types/jest-environment-puppeteer/tslint.json b/types/jest-environment-puppeteer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-environment-puppeteer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jquery-countto/index.d.ts b/types/jquery-countto/index.d.ts new file mode 100644 index 0000000000..a215abb7d4 --- /dev/null +++ b/types/jquery-countto/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for JQuery CountTo 1.2 +// Project: https://github.com/mhuggins/jquery-countTo +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export interface Options { + /** + * The number to start counting from + */ + from?: number; + + /** + * The number to stop counting at + */ + to?: number; + + /** + * The number of milliseconds it should take to finish counting + */ + speed?: number; + + /** + * he number of milliseconds to wait between refreshing the counter + */ + refreshInterval?: number; + + /** + * The number of decimal places to show when using the default formatter + */ + decimals?: number; + + /** + * A handler that is used to format the current value before rendering to the DOM + */ + formatter: (value: number, options: Options) => string; + + /** + * A callback function that is triggered for every iteration that the counter updates + */ + onUpdate?: (value: number) => void; + + /** + * A callback function that is triggered when counting finishes + */ + onComplete?: (value: number) => void; +} + +export type Method = 'start' | 'stop' | 'toggle' | 'restart'; + +declare global { + interface JQuery { + countTo(methodOrOptions?: Method | Options): JQuery; + } +} diff --git a/types/jquery-countto/jquery-countto-tests.ts b/types/jquery-countto/jquery-countto-tests.ts new file mode 100644 index 0000000000..0bc7998f56 --- /dev/null +++ b/types/jquery-countto/jquery-countto-tests.ts @@ -0,0 +1,29 @@ +import { Options } from "jquery-countto"; + +// Basic usage +$('.timer').countTo(); + +// With options +const options: Options = { + from: 50, + to: 2500, + speed: 1000, + refreshInterval: 50, + formatter: (value: number, options: Options) => { + return value.toFixed(options.decimals); + }, + onUpdate: (value: number) => { + console.log(value); + }, + onComplete: (value: number) => { + console.log(value); + } + }; + +$('.timer').countTo(options); + +// Controls +$('.timer').countTo('start'); +$('.timer').countTo('stop'); +$('.timer').countTo('restart'); +$('.timer').countTo('toggle'); diff --git a/types/jquery-countto/tsconfig.json b/types/jquery-countto/tsconfig.json new file mode 100644 index 0000000000..3d5cf520dd --- /dev/null +++ b/types/jquery-countto/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-countto-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-countto/tslint.json b/types/jquery-countto/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-countto/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file 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; diff --git a/types/jsoneditor-for-react/index.d.ts b/types/jsoneditor-for-react/index.d.ts new file mode 100644 index 0000000000..707f03c63e --- /dev/null +++ b/types/jsoneditor-for-react/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jsoneditor-for-react 0.0 +// Project: https://github.com/mixj93/jsoneditor-for-react#readme +// Definitions by: JoshGoldberg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from "react"; +import JSONEditor, { JSONEditorOptions } from "jsoneditor"; + +export interface ReactJsonEditorProps { + values: {}; +} + +export default class ReactJsoneditor extends React.Component { + private editor?: JSONEditor; + private options?: JSONEditorOptions; +} diff --git a/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx b/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx new file mode 100644 index 0000000000..fc8211e628 --- /dev/null +++ b/types/jsoneditor-for-react/jsoneditor-for-react-tests.tsx @@ -0,0 +1,4 @@ +import * as React from "react"; +import ReactJsonEditor from "jsoneditor-for-react"; + +const component = ; diff --git a/types/jsoneditor-for-react/tsconfig.json b/types/jsoneditor-for-react/tsconfig.json new file mode 100644 index 0000000000..7a855a2dc9 --- /dev/null +++ b/types/jsoneditor-for-react/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsoneditor-for-react-tests.tsx" + ] +} diff --git a/types/jsoneditor-for-react/tslint.json b/types/jsoneditor-for-react/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsoneditor-for-react/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/jss/css.d.ts b/types/jss/css.d.ts new file mode 100644 index 0000000000..2d5e89139a --- /dev/null +++ b/types/jss/css.d.ts @@ -0,0 +1,136 @@ +// These CSS typings adapted from TypeStyle: https://github.com/typestyle/typestyle + +import { Observable } from 'indefinite-observable'; +import * as csstype from 'csstype'; + +type Length = string | number; + +export type ObservableProperties

= { + [K in keyof P]: P[K] | Observable +}; + +export type CSSProperties = + & ObservableProperties> + & ObservableProperties>; + +export interface JssProps { + '@global'?: CSSProperties; + extend?: string; + composes?: string | string[]; +} + +export interface JssExpand { + animation: + | { + delay: CSSProperties['animationDelay']; + direction: CSSProperties['animationDirection']; + duration: CSSProperties['animationDuration']; + iterationCount: CSSProperties['animationIterationCount']; + name: CSSProperties['animationName']; + playState: CSSProperties['animationPlayState']; + timingFunction: CSSProperties['animationTimingFunction']; + } + | CSSProperties['animation']; + background: + | { + attachment: CSSProperties['backgroundAttachment']; + color: CSSProperties['backgroundColor']; + image: CSSProperties['backgroundImage']; + position: + | CSSProperties['backgroundPosition'] + | [csstype.Properties['backgroundPosition'], csstype.Properties['backgroundPosition']]; // Can be written using array e.g. `[0 0]` + repeat: CSSProperties['backgroundRepeat']; + size: + | CSSProperties['backgroundSize'] + | [csstype.Properties['backgroundSize'], csstype.Properties['backgroundSize']]; // Can be written using array e.g. `['center' 'center']` + } + | CSSProperties['background']; + border: + | { + color: CSSProperties['borderColor']; + style: CSSProperties['borderStyle']; + width: CSSProperties['borderWidth']; + } + | CSSProperties['border']; + boxShadow: + | { + x: Length; + y: Length; + blur: Length; + spread: Length; + color: CSSProperties['color']; + inset?: 'inset'; // If you want to add inset you need to write 'inset: 'inset'' + } + | CSSProperties['boxShadow']; + flex: + | { + basis: CSSProperties['flexBasis']; + direction: CSSProperties['flexDirection']; + flow: CSSProperties['flexFlow']; + grow: CSSProperties['flexGrow']; + shrink: CSSProperties['flexShrink']; + wrap: CSSProperties['flexWrap']; + } + | CSSProperties['flex']; + font: + | { + family: CSSProperties['fontFamily']; + size: CSSProperties['fontSize']; + stretch: CSSProperties['fontStretch']; + style: CSSProperties['fontStyle']; + variant: CSSProperties['fontVariant']; + weight: CSSProperties['fontWeight']; + } + | CSSProperties['font']; + listStyle: + | { + image: CSSProperties['listStyleImage']; + position: CSSProperties['listStylePosition']; + type: CSSProperties['listStyleType']; + } + | CSSProperties['listStyle']; + margin: + | { + bottom: CSSProperties['marginBottom']; + left: CSSProperties['marginLeft']; + right: CSSProperties['marginRight']; + top: CSSProperties['marginTop']; + } + | CSSProperties['margin']; + padding: + | { + bottom: CSSProperties['paddingBottom']; + left: CSSProperties['paddingLeft']; + right: CSSProperties['paddingRight']; + top: CSSProperties['paddingTop']; + } + | CSSProperties['padding']; + outline: + | { + color: CSSProperties['outlineColor']; + style: CSSProperties['outlineStyle']; + width: CSSProperties['outlineWidth']; + } + | CSSProperties['outline']; + textShadow: + | { + x: Length; + y: Length; + blur: Length; + color: CSSProperties['color']; + } + | CSSProperties['textShadow']; + transition: + | { + delay: CSSProperties['transitionDelay']; + duration: CSSProperties['transitionDuration']; + property: CSSProperties['transitionProperty']; + timingFunction: CSSProperties['transitionTimingFunction']; + } + | CSSProperties['transition']; +} + +export type JssExpandArr = { [k in keyof JssExpand]?: JssExpand[k] | Array }; + +export type SimpleStyle = CSSProperties & JssProps & JssExpandArr; +export type Style = SimpleStyle | Observable>; diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index 37d2443e4a..0b40c82f8f 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -1,9 +1,15 @@ -// Type definitions for jss 9.3 +// Type definitions for jss 9.5 // Project: https://github.com/cssinjs/jss#readme // Definitions by: Brenton Simpson // Oleg Slobodskoi +// Thomas Crockett // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 2.3 + +import { Style } from './css'; + +export type Styles = Record; +export type Classes = Record; export interface ToCssOptions { indent?: number; @@ -17,13 +23,12 @@ export interface Rule { prop(key: string, value: any): this; toJSON(): string; } -export interface StyleSheet { + +export interface StyleSheet { // Gives auto-completion on the rules declared in `createStyleSheet` without // causing errors for rules added dynamically after creation. - classes: { - [K in keyof T]: string; - } & { [key: string]: string }; - options: any; + classes: Classes; + options: RuleOptions; linked: boolean; attached: boolean; /** @@ -39,21 +44,21 @@ export interface StyleSheet { * Will insert a rule also after the stylesheet has been rendered first time. */ addRule(style: Style, options?: Partial): Rule; - addRule(name: string, style: Style, options?: Partial): Rule; + addRule(name: RuleName, style: Style, options?: Partial): Rule; /** * Create and add rules. * Will render also after Style Sheet was rendered the first time. */ - addRules(styles: { [key: string]: Style }, options?: Partial): Rule[]; + addRules(styles: Partial>, options?: Partial): Rule[]; /** * Get a rule by name. */ - getRule(name: string): Rule; + getRule(name: RuleName): Rule; /** * Delete a rule by name. * Returns `true`: if rule has been deleted from the DOM. */ - deleteRule(name: string): boolean; + deleteRule(name: RuleName): boolean; /** * Get index of a rule. */ @@ -62,39 +67,37 @@ export interface StyleSheet { * Update the function values with a new data. */ update(data?: {}): this; - update(name: string, data: {}): this; + update(name: RuleName, data: {}): this; /** * Convert rules to a CSS string. */ toString(options?: ToCssOptions): string; } -export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; -export interface Style { - [key: string]: any; -} +export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; + export interface JSSPlugin { [key: string]: () => Partial<{ - onCreateRule(name: string, style: Style, options: RuleOptions): Rule, - onProcessRule(rule: Rule, sheet: StyleSheet): void, - onProcessStyle(style: Style, rule: Rule, sheet: StyleSheet): Style, - onProcessSheet(sheet: StyleSheet): void, - onChangeValue(value: any, prop: string, rule: Rule): any, - onUpdate(data: {}, rule: Rule, sheet: StyleSheet): void, + onCreateRule(name: string, style: Style, options: RuleOptions): Rule; + onProcessRule(rule: Rule, sheet: StyleSheet): void; + onProcessStyle(style: Style, rule: Rule, sheet: StyleSheet): Style; + onProcessSheet(sheet: StyleSheet): void; + onChangeValue(value: any, prop: string, rule: Rule): any; + onUpdate(data: {}, rule: Rule, sheet: StyleSheet): void; }>; } export interface JSSOptions { - createGenerateClassName(): GenerateClassName; + createGenerateClassName(): GenerateClassName; plugins: ReadonlyArray; virtual: boolean; insertionPoint: string | HTMLElement; } -export interface RuleFactoryOptions { +export interface RuleFactoryOptions { selector: string; - classes: { [key: string]: string }; - sheet: StyleSheet; + classes: Classes; + sheet: StyleSheet; index: number; jss: JSS; - generateClassName: GenerateClassName; + generateClassName: GenerateClassName; } export interface RuleOptions { index: number; @@ -102,32 +105,32 @@ export interface RuleOptions { } export declare class SheetsRegistry { constructor(); - registry: ReadonlyArray>; + registry: ReadonlyArray; readonly index: number; - add(sheet: StyleSheet): void; + add(sheet: StyleSheet): void; reset(): void; - remove(sheet: StyleSheet): void; + remove(sheet: StyleSheet): void; toString(options?: ToCssOptions): string; } declare class JSS { constructor(options?: Partial); - createStyleSheet( - styles: T, + createStyleSheet( + styles: Partial>, options?: Partial<{ - media: string, - meta: string, - link: boolean, - element: HTMLStyleElement, - index: number, - generateClassName: GenerateClassName, - classNamePrefix: string, + media: string; + meta: string; + link: boolean; + element: HTMLStyleElement; + index: number; + generateClassName: GenerateClassName; + classNamePrefix: string; }>, - ): StyleSheet; - removeStyleSheet(sheet: StyleSheet): this; + ): StyleSheet; + removeStyleSheet(sheet: StyleSheet): this; setup(options?: Partial): this; use(...plugins: JSSPlugin[]): this; - createRule(style: Style, options?: Partial): Rule; - createRule(name: string, style: Style, options?: Partial): Rule; + createRule(style: Style, options?: RuleFactoryOptions): Rule; + createRule(name: Name, style: Style, options?: RuleFactoryOptions): Rule; } /** * Creates a new instance of JSS. diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 0211df99a8..5e9a876036 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -9,13 +9,25 @@ import { const jss = createJSS().setup({}); jss.use({}, {}); // $ExpectType JSS -const styleSheet = jss.createStyleSheet( +const styleSheet = jss.createStyleSheet( { ruleWithMockObservable: { - subscribe() {} + subscribe: observer => { + const next = typeof observer === 'function' ? observer : observer.next; + next({ background: 'blue', display: 'flex' }); + next({ invalidKey: 'blueish' }); // $ExpectError + + // only kebab case allowed in observables + next({ 'align-items': 'center' }); + next({ alignItems: 'center' }); // $ExpectError + return { + unsubscribe() {} + }; + } }, container: { display: 'flex', + 'align-items': 'center', width: 100, opacity: .5, }, @@ -57,14 +69,23 @@ attachedStyleSheet.addRules({ }, }); -attachedStyleSheet.detach(); +styleSheet.addRule('badProperty', { + thisIsNotAValidProperty: 'blah', // $ExpectError +}); -sharedInstance.createStyleSheet({ +styleSheet.addRule('badValue', { // $ExpectError + 'align-items': Symbol(), +}); + +const styleSheet2 = sharedInstance.createStyleSheet({ container: { background: '#000099', } }); +styleSheet2.classes.container; // $ExpectType string +styleSheet2.classes.notAValidKey; // $ExpectError + /* SheetsRegistry test */ const sheetsRegistry = new SheetsRegistry(); sheetsRegistry.add(styleSheet); @@ -72,7 +93,11 @@ sheetsRegistry.add(styleSheet); const secondStyleSheet = jss.createStyleSheet( { ruleWithMockObservable: { - subscribe() {} + subscribe() { + return { + unsubscribe() {} + }; + } }, container2: { display: 'flex', diff --git a/types/jss/package.json b/types/jss/package.json new file mode 100644 index 0000000000..59a8354d7d --- /dev/null +++ b/types/jss/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "dependencies": { + "csstype": "^2.0.0", + "indefinite-observable": "^1.0.1" + } +} diff --git a/types/koa-session/index.d.ts b/types/koa-session/index.d.ts index 8650a07d91..75721a5b2d 100644 --- a/types/koa-session/index.d.ts +++ b/types/koa-session/index.d.ts @@ -156,6 +156,11 @@ declare namespace session { */ rolling?: boolean; + /** + * Renew session when session is nearly expired, so we can always keep user logged in. (default is false) + */ + renew?: boolean; + /** * You can store the session content in external stores(redis, mongodb or other DBs) */ @@ -166,7 +171,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. diff --git a/types/koa/index.d.ts b/types/koa/index.d.ts index 2a5c49f110..07ddadc0c8 100644 --- a/types/koa/index.d.ts +++ b/types/koa/index.d.ts @@ -21,6 +21,7 @@ import * as accepts from "accepts"; import * as Cookies from "cookies"; import { EventEmitter } from "events"; import { IncomingMessage, ServerResponse, Server } from "http"; +import { Http2ServerRequest, Http2ServerResponse } from 'http2'; import httpAssert = require("http-assert"); import * as Keygrip from "keygrip"; import * as compose from "koa-compose"; @@ -500,9 +501,9 @@ declare class Application extends EventEmitter { /** * Return a request handler callback - * for node's native http server. + * for node's native http/http2 server. */ - callback(): (req: IncomingMessage, res: ServerResponse) => void; + callback(): (req: IncomingMessage | Http2ServerRequest, res: ServerResponse | Http2ServerResponse) => void; /** * Initialize a new context. diff --git a/types/leaflet-draw/index.d.ts b/types/leaflet-draw/index.d.ts index 7fd33f2152..62025a7c46 100644 --- a/types/leaflet-draw/index.d.ts +++ b/types/leaflet-draw/index.d.ts @@ -279,7 +279,7 @@ declare module 'leaflet' { * * Default value: L.Icon.Default() */ - icon?: Icon; + icon?: Icon | DivIcon; /** * This should be a high number to ensure that you can draw over all other layers on the map. diff --git a/types/leaflet-draw/leaflet-draw-tests.ts b/types/leaflet-draw/leaflet-draw-tests.ts index 54015fa404..7a51fe401f 100644 --- a/types/leaflet-draw/leaflet-draw-tests.ts +++ b/types/leaflet-draw/leaflet-draw-tests.ts @@ -121,3 +121,18 @@ function testExampleControlOptions() { } }); } + +function testMarkerOptionsIcon() { + const markerIcon = new L.Draw.Marker(map, { + icon: new L.Icon({ + iconUrl: 'my-icon.png', + iconSize: new L.Point(32, 32), + }), + }); + const markerDivIcon = new L.Draw.Marker(map, { + icon: new L.DivIcon({ + className: "marker-icon", + iconSize: new L.Point(32, 32), + }), + }); +} diff --git a/types/mailgun-js/index.d.ts b/types/mailgun-js/index.d.ts new file mode 100644 index 0000000000..0ab5efcf45 --- /dev/null +++ b/types/mailgun-js/index.d.ts @@ -0,0 +1,167 @@ +// Type definitions for mailgun-js 0.16 +// Project: https://github.com/bojand/mailgun-js +// Definitions by: Sampson Oliver +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare const out: Mailgun.MailgunExport; +export = out; + +declare namespace Mailgun { + interface ConstructorParams { + apiKey: string; + publicApiKey?: string; + domain: string; + mute?: boolean; + timeout?: number; + host?: string; + endpoint?: string; + protocol?: string; + port?: number; + retry?: + | number + | { + times: number; + interval: number; + }; + proxy?: string; + } + + interface Error { + statusCode: number; + message: string; + } + + interface AttachmentParams { + data: string | Buffer | NodeJS.ReadWriteStream; + filename?: string; + knownLength?: number; + contentType?: string; + } + + class Attachment { + constructor(params: AttachmentParams); + data: string | Buffer | NodeJS.ReadWriteStream; + filename?: string; + knownLength?: number; + contentType?: string; + getType(): string; + } + + interface MailgunExport { + new (options: ConstructorParams): Mailgun; + (options: ConstructorParams): Mailgun; + } + + namespace messages { + interface SendData { + from?: string; + to: string | string[]; + cc?: string; + bcc?: string; + subject?: string; + text?: string; + html?: string; + attachment?: string | Buffer | NodeJS.ReadWriteStream | Attachment; + } + + interface BatchData extends SendData { + "recipient-variables"?: BatchSendRecipientVars; + } + + interface BatchSendRecipientVars { + [email: string]: { + first: string; + id: number; + }; + } + + interface SendResponse { + message: string; + id: string; + } + } + + namespace lists { + interface MemberCreateData { + subscribed: boolean; + address: string; + name: string; + vars?: object; + } + + interface MemberUpdateData { + subscribed: boolean; + name: string; + vars?: object; + } + + interface Members { + create( + data: MemberCreateData, + callback?: (err: Error, data: any) => void + ): Promise; + + add( + data: MemberCreateData[], + callback?: (err: Error, data: any) => void + ): Promise; + + list(callback?: (err: Error, data: any) => void): Promise; + } + + interface Member { + update( + data: MemberUpdateData, + callback?: (err: Error, data: any) => void + ): Promise; + } + } + + namespace validation { + interface ParseResponse { + parsed: string[]; + unparseable: string[]; + } + + interface ValidateResponse { + is_valid: boolean; + } + } + + interface Mailgun { + messages(): Messages; + lists(list: string): Lists; + Attachment: typeof Attachment; + validateWebhook( + bodyTimestamp: number, + bodyToken: string, + bodySignature: string + ): boolean; + + parse( + addressList: string[], + callback?: (error: Error, body: validation.ValidateResponse) => void + ): Promise; + + validate( + address: string, + callback?: (error: Error, body: validation.ValidateResponse) => void + ): Promise; + } + + interface Lists { + info(callback?: (error: Error, data: any) => void): Promise; + members(): lists.Members; + members(member: string): lists.Member; + } + + interface Messages { + send( + data: messages.SendData | messages.BatchData, + callback?: (error: Error, body: messages.SendResponse) => void + ): Promise; + } +} diff --git a/types/mailgun-js/mailgun-js-tests.ts b/types/mailgun-js/mailgun-js-tests.ts new file mode 100644 index 0000000000..dfbe8ab4a1 --- /dev/null +++ b/types/mailgun-js/mailgun-js-tests.ts @@ -0,0 +1,32 @@ +import * as mailgunFactory from "mailgun-js"; +import mailgunFactory2 = require('mailgun-js'); + +const mailgun = new mailgunFactory({ + apiKey: "auth.api_key", + domain: "auth.domain" +}); + +const mailgun2 = new mailgunFactory2({ + apiKey: "auth.api_key", + domain: "auth.domain" +}); + +mailgun.messages().send( + { + to: "fixture.message.to" + }, + err => { + console.log; + } +); + +mailgun.messages().send( + { + to: "someone@email.com", + attachment: new mailgun.Attachment({ + data: "filepath", + filename: "my_custom_name.png" + }) + }, + (err, body) => {} +); diff --git a/types/mailgun-js/tsconfig.json b/types/mailgun-js/tsconfig.json new file mode 100644 index 0000000000..b6a747659c --- /dev/null +++ b/types/mailgun-js/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": false, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": ["index.d.ts", "mailgun-js-tests.ts"] +} diff --git a/types/mailgun-js/tslint.json b/types/mailgun-js/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mailgun-js/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mathjs/index.d.ts b/types/mathjs/index.d.ts index ad3dec6d75..0341d80c6b 100644 --- a/types/mathjs/index.d.ts +++ b/types/mathjs/index.d.ts @@ -3,7 +3,11 @@ // Definitions by: Ilya Shestakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import { Decimal } from 'decimal.js'; + declare var math: mathjs.IMathJsStatic; +export as namespace math; +export = math; declare namespace mathjs { @@ -304,7 +308,7 @@ declare namespace mathjs { * @param x The base * @param y The exponent */ - pow(x: number|BigNumber|Complex|MathArray|Matrix, y: number|BigNumber|Complex): number|BigNumber|Complex|MathArray|Matrix; + pow(x: MathType, y: number|BigNumber|Complex): MathType; /** * Round a value towards the nearest integer. For matrices, the function is evaluated element wise. @@ -1333,12 +1337,14 @@ declare namespace mathjs { swapRows(i: number, j: number): Matrix; } - export interface BigNumber { + export interface BigNumber extends Decimal { } export interface Fraction { - + s: number; + n: number; + d: number; } export interface Complex { @@ -1349,9 +1355,9 @@ declare namespace mathjs { } export interface IPolarCoordinates { - r: number; + r: number; phi: number; - } + } export interface Unit { to(unit: string): Unit; @@ -2309,7 +2315,3 @@ declare namespace mathjs { toString(): string; } } - -declare module 'mathjs'{ - export = math; -} diff --git a/types/mathjs/package.json b/types/mathjs/package.json new file mode 100644 index 0000000000..23474e431e --- /dev/null +++ b/types/mathjs/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "decimal.js": "^10.0.0" + } +} diff --git a/types/minio/index.d.ts b/types/minio/index.d.ts index 7e920428ff..bdbcb8032a 100644 --- a/types/minio/index.d.ts +++ b/types/minio/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for minio 4.0 +// Type definitions for minio 5.1 // Project: https://github.com/minio/minio-js#readme // Definitions by: Barin Britva +// Lubomir Kaplan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -11,7 +12,6 @@ import EventEmitter = NodeJS.EventEmitter; // Exports only from typings export type Region = 'us-east-1'|'us-west-1'|'us-west-2'|'eu-west-1'|'eu-central-1'|'ap-southeast-1'|'ap-northeast-1'|'ap-southeast-2'|'sa-east-1'|'cn-north-1'|string; -export type PolicyValue = 'none'|'readonly'|'writeonly'|'readwrite'; export type NoResultCallback = (error: Error|null) => void; export type ResultCallback = (error: Error|null, result: T) => void; @@ -46,7 +46,7 @@ export interface BucketItemStat { size: number; contentType: string; etag: string; - lastModified: string; + lastModified: Date; } export interface IncompleteUploadedBucketItem { @@ -83,10 +83,10 @@ export class Client { makeBucket(bucketName: string, region: Region): Promise; listBuckets(callback: ResultCallback): void; - listBuckets(): Promise; + listBuckets(): Promise; - bucketExists(bucketName: string, callback: NoResultCallback): void; - bucketExists(bucketName: string): Promise; + bucketExists(bucketName: string, callback: ResultCallback): void; + bucketExists(bucketName: string): Promise; removeBucket(bucketName: string, callback: NoResultCallback): void; removeBucket(bucketName: string): Promise; @@ -158,11 +158,11 @@ export class Client { // todo #low Specify events listenBucketNotification(bucketName: string, prefix: string, suffix: string, events: string[]): EventEmitter; - getBucketPolicy(bucketName: string, objectPrefix: string, callback: ResultCallback): void; - getBucketPolicy(bucketName: string, objectPrefix: string): Promise; + getBucketPolicy(bucketName: string, callback: ResultCallback): void; + getBucketPolicy(bucketName: string): Promise; - setBucketPolicy(bucketName: string, objectPrefix: string, bucketPolice: PolicyValue, callback: NoResultCallback): void; - setBucketPolicy(bucketName: string, objectPrefix: string, bucketPolice: PolicyValue): Promise; + setBucketPolicy(bucketName: string, bucketPolicy: string, callback: NoResultCallback): void; + setBucketPolicy(bucketName: string, bucketPolicy: string): Promise; // Other newPostPolicy(): PostPolicy; diff --git a/types/minio/minio-tests.ts b/types/minio/minio-tests.ts index 78a7fab267..05f8283d32 100644 --- a/types/minio/minio-tests.ts +++ b/types/minio/minio-tests.ts @@ -16,7 +16,7 @@ minio.makeBucket('testBucket', 'region-not-from-list'); minio.listBuckets((error: Error|null, bucketList: Minio.BucketItemFromList[]) => { console.log(error, bucketList); }); minio.listBuckets(); -minio.bucketExists('testBucket', (error: Error|null) => { console.log(error); }); +minio.bucketExists('testBucket', (error: Error|null, exists: boolean) => { console.log(error, exists); }); minio.bucketExists('testBucket'); minio.removeBucket('testBucket', (error: Error|null) => { console.log(error); }); @@ -106,8 +106,14 @@ minio.removeAllBucketNotification('testBucket'); minio.listenBucketNotification('testBucket', 'pref_', '_suf', [ Minio.ObjectCreatedAll ]); -minio.getBucketPolicy('testBucket', 'pref_', (error: Error|null, policy: Minio.PolicyValue) => { console.log(error, policy); }); -minio.getBucketPolicy('testBucket', ''); +minio.getBucketPolicy('testBucket', (error: Error|null, policy: string) => { console.log(error, policy); }); +minio.getBucketPolicy('testBucket'); -minio.setBucketPolicy('testBucket', '', Minio.Policy.READWRITE, (error: Error|null) => { console.log(error); }); -minio.setBucketPolicy('testBucket', 'pref_', Minio.Policy.WRITEONLY); +const testPolicy = `{"Version":"2012-10-17","Statement":[{"Action":["s3:GetBucketLocation"],"Effect":"Allow", +"Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::bucketName"],"Sid":""},{"Action":["s3:ListBucket"], +"Condition":{"StringEquals":{"s3:prefix":["foo","prefix/"]}},"Effect":"Allow","Principal":{"AWS":["*"]}, +"Resource":["arn:aws:s3:::bucketName"],"Sid":""},{"Action":["s3:GetObject"],"Effect":"Allow", +"Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::bucketName/foo*","arn:aws:s3:::bucketName/prefix/*"],"Sid":""}]} +`; +minio.setBucketPolicy('testBucket', testPolicy, (error: Error|null) => { console.log(error); }); +minio.setBucketPolicy('testBucket', testPolicy); diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 50496fc9da..81974b2ee0 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 5.0.1 +// Type definitions for Mongoose 5.0.12 // Project: http://mongoosejs.com/ // Definitions by: horiuchi // sindrenm @@ -2608,10 +2608,18 @@ declare module "mongoose" { * because it only sends one operation to the server, rather than one for each * document. * This function does not trigger save middleware. + * @param docs Documents to insert. + * @param options Optional settings. + * @param options.ordered if true, will fail fast on the first error encountered. + * If false, will insert all the documents it can and report errors later. + * @param options.rawResult if false, the returned promise resolves to the documents that passed mongoose document validation. + * If `false`, will return the [raw result from the MongoDB driver](http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~insertWriteOpCallback) + * with a `mongoose` property that contains `validationErrors` if this is an unordered `insertMany`. */ insertMany(docs: any[], callback?: (error: any, docs: T[]) => void): Promise; + insertMany(docs: any[], options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, docs: T[]) => void): Promise; insertMany(doc: any, callback?: (error: any, doc: T) => void): Promise; - insertMany(...docsWithCallback: any[]): Promise; + insertMany(doc: any, options?: { ordered?: boolean, rawResult?: boolean }, callback?: (error: any, doc: T) => void): Promise; /** * Executes a mapReduce command. 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" } 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; }); diff --git a/types/noble/index.d.ts b/types/noble/index.d.ts index 474338d383..ee4fbf1654 100644 --- a/types/noble/index.d.ts +++ b/types/noble/index.d.ts @@ -6,6 +6,7 @@ // Luke Libraro // Dan Chao // Michal Lower +// Rob Moran // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -63,7 +64,10 @@ export declare class Peripheral extends events.EventEmitter { export interface Advertisement { localName: string; - serviceData: Buffer; + serviceData: { + uuid: string, + data: Buffer + }; txPowerLevel: number; manufacturerData: Buffer; serviceUuids: string[]; diff --git a/types/noble/noble-tests.ts b/types/noble/noble-tests.ts index 65e13f4d43..5e00105433 100644 --- a/types/noble/noble-tests.ts +++ b/types/noble/noble-tests.ts @@ -39,7 +39,10 @@ var peripheral: noble.Peripheral = new noble.Peripheral(); peripheral.uuid = "12ad4e81"; peripheral.advertisement = { localName: "device", - serviceData: new Buffer(1), + serviceData: { + uuid: "180a", + data: new Buffer(1) + }, txPowerLevel: 1, manufacturerData: new Buffer(1), serviceUuids: ["0x180a", "0x180d"] diff --git a/types/node-fetch/index.d.ts b/types/node-fetch/index.d.ts index d39b6db22e..aaaf30a5e3 100644 --- a/types/node-fetch/index.d.ts +++ b/types/node-fetch/index.d.ts @@ -77,6 +77,7 @@ export class Body { json(): Promise; text(): Promise; buffer(): Promise; + arrayBuffer(): Promise; } export class Response extends Body { diff --git a/types/node-fetch/node-fetch-tests.ts b/types/node-fetch/node-fetch-tests.ts index dbf140225f..564a31fe79 100644 --- a/types/node-fetch/node-fetch-tests.ts +++ b/types/node-fetch/node-fetch-tests.ts @@ -30,6 +30,10 @@ function test_fetchUrl() { handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php")); } +function test_fetchUrlArrayBuffer() { + handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php"), true); +} + function test_fetchUrlWithRequestObject() { var requestOptions: RequestInit = { method: "POST", @@ -53,13 +57,17 @@ function test_globalFetchVar() { }); } -function handlePromise(promise: Promise) { - promise.then((response) => { +function handlePromise(promise: Promise, isArrayBuffer: boolean = false) { + promise.then((response):Promise => { if (response.type === 'basic') { // for test only } - return response.text(); - }).then((text) => { + if (isArrayBuffer) { + return response.arrayBuffer(); + } else { + return response.text(); + } + }).then((text:string | ArrayBuffer) => { console.log(text); }); } diff --git a/types/node-polyglot/index.d.ts b/types/node-polyglot/index.d.ts index 7587f77640..3133def496 100644 --- a/types/node-polyglot/index.d.ts +++ b/types/node-polyglot/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-polyglot v0.4.1 +// Type definitions for node-polyglot v0.4.2 // Project: https://github.com/airbnb/polyglot.js // Definitions by: Tim Jackson-Kiely // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -38,6 +38,8 @@ declare class Polyglot { locale(): string; locale(locale: string): void; + + has(phrase: string): boolean; } export = Polyglot; diff --git a/types/node-polyglot/node-polyglot-tests.ts b/types/node-polyglot/node-polyglot-tests.ts index bfb18339c0..14efa8ad30 100644 --- a/types/node-polyglot/node-polyglot-tests.ts +++ b/types/node-polyglot/node-polyglot-tests.ts @@ -47,6 +47,9 @@ function translate(): void { _: "I like to write in %{language}.", language: "Javascript" }); + + polyglot.has("hello"); + polyglot.has("world"); polyglot.replace({ "hello": "hey", diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 0994982b41..3404e37d46 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; @@ -5612,8 +5615,8 @@ declare module "assert" { }); } - export function fail(message: string): void; - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(message: string): never; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; 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/v0/index.d.ts b/types/node/v0/index.d.ts index 800a909c49..ef1c485d2d 100644 --- a/types/node/v0/index.d.ts +++ b/types/node/v0/index.d.ts @@ -1870,7 +1870,7 @@ declare module "assert" { operator?: string; stackStartFunction?: Function}); } - export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; + export function fail(actual?: any, expected?: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v4/index.d.ts b/types/node/v4/index.d.ts index 16e54d002d..ada62b683e 100644 --- a/types/node/v4/index.d.ts +++ b/types/node/v4/index.d.ts @@ -2448,7 +2448,7 @@ declare module "assert" { operator?: string; stackStartFunction?: Function}); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v6/index.d.ts b/types/node/v6/index.d.ts index 3ca66a2df5..f38cdf01dd 100644 --- a/types/node/v6/index.d.ts +++ b/types/node/v6/index.d.ts @@ -3876,7 +3876,7 @@ declare module "assert" { }); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; diff --git a/types/node/v7/index.d.ts b/types/node/v7/index.d.ts index 748f932d80..896b5a887f 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; @@ -3981,7 +3984,7 @@ declare module "assert" { }); } - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; 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 fb70650458..a17800dfb7 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -2351,6 +2351,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; @@ -5583,8 +5586,8 @@ declare module "assert" { }); } - export function fail(message: string): void; - export function fail(actual: any, expected: any, message?: string, operator?: string): void; + export function fail(message: string): never; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; export function ok(value: any, message?: string): void; export function equal(actual: any, expected: any, message?: string): void; export function notEqual(actual: any, expected: any, message?: string): void; 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'); 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; diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts index 30afded19b..9428247938 100644 --- a/types/openfin/index.d.ts +++ b/types/openfin/index.d.ts @@ -1,9 +1,10 @@ -// Type definitions for OpenFin API 17.0 +// 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 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 +19,1873 @@ * * 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; + const desktop: OpenFinDesktop; - interface OpenFinDesktop { - main(f: () => any): void; - Application: OpenFinApplicationStatic; - ExternalApp: OpenFinExternalApplicationStatic; - InterApplicationBus: OpenFinInterApplicationBus; - Notification: OpenFinNotificationStatic; - System: OpenFinSystem; - Window: OpenFinWindowStatic; - } + 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; - /** - * Returns an Application object that represents an existing application. - */ - getCurrent(): OpenFinApplication; - /** - * Returns an Application object that represents an existing application. - */ - wrap(uuid: string): OpenFinApplication; - } + 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; - /** - * 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; - } + /** + * 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 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 SuccessObj { + httpResponseCode: number; + } - interface NetworkErrorInfo extends ErrorInfo { - networkErrorCode: number; - } + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } - interface ErrorInfo { - stack: string; - message: string; - } + 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 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, + 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: DownloadPreloadOption[], callback?: (downloadInfo: DownloadPreloadInfo[]) => 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: CookieInfo[]) => 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; }; - /** - * 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 MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } - interface WindowAlertRequestedEvent extends WindowEvent { - message: string; - url: string; - } + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } - interface WindowAuthRequested extends WindowEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: string; - }; - } + interface VirtualScreenCoordinates { + left: number; + top: number; + } - interface WindowNavigationRejectedEvent extends WindowEvent { - sourceName: string; - url: string; - } + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } - interface WindowEndLoadEvent extends WindowEvent { - documentName: string; - isMain: boolean; - } + 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 MonitorInfoChangedEvent extends MonitorInfo { - topic: "system"; - type: "monitor-info-changed"; - } + 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 MonitorInfo { - nonPrimaryMonitors: MonitorInfoDetail[]; - primaryMonitor: MonitorInfoDetail; - reason: string; - taskbar: { - edge: "left" | "right" | "top" | "bottom", - rect: MontiorCoordinates - }; - topic: "system"; - type: "monitor-info-changed"; - virtualScreen: MontiorCoordinates; - } + 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 MonitorInfoDetail { - availableRect: MontiorCoordinates; - deviceId: string; - displayDeviceActive: boolean; - monitorRect: MontiorCoordinates; - name: string; - } + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } - interface MontiorCoordinates { - bottom: number; - left: number; - right: number; - top: number; - } + 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; - interface VirtualScreenCoordinates { - left: number; - top: number; - } + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } - interface SystemBaseEvent { - topic: string; - type: OpenFinSystemEventType; - uuid: string; - } + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } - 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 WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } - 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 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 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 WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } - interface WindowAuthRequestedEvent extends WindowBaseEvent { - authInfo: { - host: string; - isProxy: boolean; - port: number; - realm: string; - scheme: 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 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; + 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; + } - type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; - /** - * the new width of the window. - */ - width: number; - } + 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 WindowExternalProcessStartedEvent extends WindowBaseEvent { - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-started"; - } + 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 WindowExternalProcessExited extends WindowBaseEvent { - /** - * the process exit code - */ - exitCode: number; - /** - * the process handle uuid - */ - processUuid: string; - type: "external-process-exited"; - } + 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 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 ExternalApplicationInfo { + parent: { + uuid: string; + name: string; + }; + } - interface WindowOfGroupInfo { - /** - * The UUID of the application this window entry belongs to. - */ - appUuid: string; - /** - * The name of this window entry. - */ - windowName: string; - } + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } - interface WindowHiddenEvent extends WindowBaseEvent { - /** - * What action prompted the close. - * The reasons are: "hide", "hide-on-close" - */ - reason: "hide" | "hide-on-close"; - type: "hidden"; - } + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } - 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; - } + 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"; - 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; - }; - } + 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"; - 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; - } + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; - 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; - } + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; - interface SessionChangedEvent { - /** - * the action that triggered this event: - */ - reason: "lock" - | "unlock" - | "remote-connect" - | "remote-disconnect" - | "unknown"; - topic: "system"; - type: "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"; - 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"; + 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..6059f54de7 100644 --- a/types/openfin/openfin-tests.ts +++ b/types/openfin/openfin-tests.ts @@ -1,721 +1,800 @@ 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" + 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 + application.removeEventListener("closed", (event: any) => { + console.log(event); }, () => { - 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(); - }); + 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 + const 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); + // 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); + }); + // 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 + // 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 + fin.desktop.System.removeEventListener("monitor-info-changed", (event) => { + console.log(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); + console.log("successful"); + }, (err: any) => { + console.log("failure: " + 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"); + }, 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); - }); - // 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 + finWindow.removeEventListener("bounds-changed", event => { + console.log(event); }); + // 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..5299a11917 100644 --- a/types/openfin/tsconfig.json +++ b/types/openfin/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" @@ -21,4 +21,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/v17/tsconfig.json b/types/openfin/v17/tsconfig.json new file mode 100644 index 0000000000..5f07a9e025 --- /dev/null +++ b/types/openfin/v17/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": false, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "openfin": [ + "openfin/v17" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "openfin-tests.ts" + ] +} 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/ora/index.d.ts b/types/ora/index.d.ts index d43a01c7cf..a3099f6cd9 100644 --- a/types/ora/index.d.ts +++ b/types/ora/index.d.ts @@ -83,6 +83,7 @@ interface Options { interval?: number; stream?: NodeJS.WritableStream; enabled?: boolean; + hideCursor?: boolean; } interface PersistOptions { diff --git a/types/passport-anonymous/index.d.ts b/types/passport-anonymous/index.d.ts index 6e45ed3a23..969f158526 100644 --- a/types/passport-anonymous/index.d.ts +++ b/types/passport-anonymous/index.d.ts @@ -6,6 +6,6 @@ import * as passport from "passport"; -export class Strategy implements passport.Strategy { - authenticate: () => void; +export class Strategy extends passport.Strategy { + authenticate(): void; } diff --git a/types/passport-beam/index.d.ts b/types/passport-beam/index.d.ts index 6d7d1de430..65096a9bd6 100644 --- a/types/passport-beam/index.d.ts +++ b/types/passport-beam/index.d.ts @@ -10,10 +10,10 @@ import * as passport from 'passport'; import * as express from 'express'; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: Strategy.IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: Strategy.Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } export namespace Strategy { diff --git a/types/passport-discord/index.d.ts b/types/passport-discord/index.d.ts index 66b9474a2d..70553a25cd 100644 --- a/types/passport-discord/index.d.ts +++ b/types/passport-discord/index.d.ts @@ -8,10 +8,10 @@ import * as passport from 'passport'; import * as express from 'express'; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: Strategy.StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Strategy.Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; authorizationParams(options: any): any; diff --git a/types/passport-facebook/index.d.ts b/types/passport-facebook/index.d.ts index 5d20f0d39c..89ce91b093 100644 --- a/types/passport-facebook/index.d.ts +++ b/types/passport-facebook/index.d.ts @@ -47,10 +47,10 @@ export type VerifyFunction = export type VerifyFunctionWithRequest = (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOptionWithRequest, verify: VerifyFunctionWithRequest); constructor(options: StrategyOption, verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } diff --git a/types/passport-github/index.d.ts b/types/passport-github/index.d.ts index c4a253016f..99c84bd391 100644 --- a/types/passport-github/index.d.ts +++ b/types/passport-github/index.d.ts @@ -26,10 +26,10 @@ export interface StrategyOption { userProfileURL?: string; } -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); userProfile: (accessToken: string, done?: (error: any, profile: Profile) => void) => void; name: string; - authenticate: (req: express.Request, options?: passport.AuthenticateOptions) => void; + authenticate(req: express.Request, options?: passport.AuthenticateOptions): void; } diff --git a/types/passport-github2/index.d.ts b/types/passport-github2/index.d.ts index b0310a6f3b..902bcea6e0 100644 --- a/types/passport-github2/index.d.ts +++ b/types/passport-github2/index.d.ts @@ -28,10 +28,10 @@ export interface StrategyOption { userProfileURL?: string; } -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); userProfile: (accessToken: string, done?: (error: any, profile: Profile) => void) => void; name: string; - authenticate: (req: express.Request, options?: passport.AuthenticateOptions) => void; + authenticate(req: express.Request, options?: passport.AuthenticateOptions): void; } diff --git a/types/passport-google-oauth/index.d.ts b/types/passport-google-oauth/index.d.ts index a56c91e73f..8b45504cb2 100644 --- a/types/passport-google-oauth/index.d.ts +++ b/types/passport-google-oauth/index.d.ts @@ -33,7 +33,7 @@ interface VerifyFunction { (error: any, user?: any, msg?: VerifyOptions): void; } -declare class OAuthStrategy implements passport.Strategy { +declare class OAuthStrategy extends passport.Strategy { constructor( options: IOAuthStrategyOption, verify: ( @@ -44,7 +44,7 @@ declare class OAuthStrategy implements passport.Strategy { ) => void ); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } interface IOAuth2StrategyOption { diff --git a/types/passport-http-bearer/index.d.ts b/types/passport-http-bearer/index.d.ts index 698b0bfed5..58da308106 100644 --- a/types/passport-http-bearer/index.d.ts +++ b/types/passport-http-bearer/index.d.ts @@ -28,11 +28,11 @@ interface VerifyFunctionWithRequest { (req: express.Request, token: string, done: (error: any, user?: any, options?: IVerifyOptions | string) => void): void; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(verify: VerifyFunction); constructor(options: IStrategyOptions, verify: VerifyFunction); constructor(options: IStrategyOptions, verify: VerifyFunctionWithRequest); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } diff --git a/types/passport-http/index.d.ts b/types/passport-http/index.d.ts index fa3f968e7e..63527b6225 100644 --- a/types/passport-http/index.d.ts +++ b/types/passport-http/index.d.ts @@ -52,19 +52,19 @@ export type DigestValidateFunction = ( done: (error: any, valid: boolean) => void, ) => any; -export class BasicStrategy implements passport.Strategy { +export class BasicStrategy extends passport.Strategy { constructor(verify: BasicVerifyFunction); constructor(options: BasicStrategyOptions, verify: BasicVerifyFunction); constructor(options: BasicStrategyOptions, verify: BasicVerifyFunctionWithRequest); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } -export class DigestStrategy implements passport.Strategy { +export class DigestStrategy extends passport.Strategy { constructor(secret: DigestSecretFunction, validate?: DigestValidateFunction); constructor(options: DigestStrategyOptions, secret: DigestSecretFunction, validate?: DigestValidateFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } diff --git a/types/passport-kakao/index.d.ts b/types/passport-kakao/index.d.ts index d99f608ab7..b005b45d98 100644 --- a/types/passport-kakao/index.d.ts +++ b/types/passport-kakao/index.d.ts @@ -27,9 +27,9 @@ export interface StrategyOption { export type VerifyFunction = (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: VerifyFunction); - authenticate: (req: express.Request, options?: any) => void; + authenticate(req: express.Request, options?: any): void; userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void; } diff --git a/types/passport-naver/index.d.ts b/types/passport-naver/index.d.ts index 75c21b76ed..8bd022cd21 100644 --- a/types/passport-naver/index.d.ts +++ b/types/passport-naver/index.d.ts @@ -37,10 +37,10 @@ export interface StrategyOption { export type VerifyFunction = (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any, info?: any) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOption, verify: VerifyFunction); - authenticate: (req: express.Request, options?: any) => void; + authenticate(req: express.Request, options?: any): void; authorizationParams: (options: any) => any; userProfile: (accessToken: string, done: (error: any, user?: any) => void) => void; } diff --git a/types/passport-oauth2-client-password/index.d.ts b/types/passport-oauth2-client-password/index.d.ts index 2a93a87608..faab5d59d4 100644 --- a/types/passport-oauth2-client-password/index.d.ts +++ b/types/passport-oauth2-client-password/index.d.ts @@ -22,10 +22,10 @@ interface VerifyFunction { (clientId: string, clientSecret: string, done: (error: any, client?: any, info?: any) => void): void; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(options: StrategyOptionsWithRequestInterface, verify: VerifyFunctionWithRequest); constructor(verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: {}) => void; + authenticate(req: express.Request, options?: {}): void; } diff --git a/types/passport-oauth2/index.d.ts b/types/passport-oauth2/index.d.ts index 09facb2ef7..5dd811f342 100644 --- a/types/passport-oauth2/index.d.ts +++ b/types/passport-oauth2/index.d.ts @@ -7,7 +7,7 @@ import { Request } from 'express'; import { Strategy } from 'passport'; -declare class OAuth2Strategy implements Strategy { +declare class OAuth2Strategy extends Strategy { name: string; constructor(options: OAuth2Strategy.StrategyOptions, verify: OAuth2Strategy.VerifyFunction); diff --git a/types/passport-saml/index.d.ts b/types/passport-saml/index.d.ts index e93869ca87..5e24211008 100644 --- a/types/passport-saml/index.d.ts +++ b/types/passport-saml/index.d.ts @@ -24,7 +24,7 @@ export type VerifyWithRequest = (req: express.Request, profile: {}, done: Verifi export type VerifyWithoutRequest = (profile: {}, done: VerifiedCallback) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(config: SamlConfig, verify: VerifyWithRequest | VerifyWithoutRequest); authenticate(req: express.Request, options: AuthenticateOptions | AuthorizeOptions): void; logout(req: express.Request, callback: (err: Error | null, url: string) => void): void; diff --git a/types/passport-strategy/index.d.ts b/types/passport-strategy/index.d.ts index 1a0b2dd4f5..f8b227bfd6 100644 --- a/types/passport-strategy/index.d.ts +++ b/types/passport-strategy/index.d.ts @@ -16,7 +16,7 @@ import passport = require('passport'); import express = require('express'); -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { /** * Performs authentication for the request. * Note: Virtual function - re-implement in the strategy. diff --git a/types/passport-twitter/index.d.ts b/types/passport-twitter/index.d.ts index fe341a4b5b..ae8f192d79 100644 --- a/types/passport-twitter/index.d.ts +++ b/types/passport-twitter/index.d.ts @@ -44,12 +44,12 @@ interface IStrategyOptionWithRequest extends IStrategyOptionBase { passReqToCallback: true; } -declare class Strategy implements passport.Strategy { +declare class Strategy extends passport.Strategy { constructor(options: IStrategyOption, verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); constructor(options: IStrategyOptionWithRequest, verify: (req: express.Request, accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); name: string; - authenticate: (req: express.Request, options?: Object) => void; + authenticate(req: express.Request, options?: Object): void; } diff --git a/types/passport-unique-token/index.d.ts b/types/passport-unique-token/index.d.ts index 081a85b29d..66887cdcde 100644 --- a/types/passport-unique-token/index.d.ts +++ b/types/passport-unique-token/index.d.ts @@ -33,11 +33,11 @@ export interface VerifyOptions { export type VerifyFunctionWithRequest = (req: express.Request, token: string, done: (error: any, user?: any, options?: VerifyOptions) => void) => void; export type VerifyFunction = (token: string, done: (error: any, user?: any, options?: VerifyOptions) => void) => void; -export class Strategy implements passport.Strategy { +export class Strategy extends passport.Strategy { constructor(options: StrategyOptionsWithRequest, verify: VerifyFunctionWithRequest); constructor(options: StrategyOptions, verify: VerifyFunction); constructor(verify: VerifyFunction); name: string; - authenticate: (req: express.Request, options?: object) => void; + authenticate(req: express.Request, options?: object): void; } diff --git a/types/passport/index.d.ts b/types/passport/index.d.ts index 06c7f0b9db..4a91d2b64b 100644 --- a/types/passport/index.d.ts +++ b/types/passport/index.d.ts @@ -73,6 +73,7 @@ declare namespace passport { interface PassportStatic extends Authenticator { Authenticator: { new(): Authenticator }; Passport: PassportStatic["Authenticator"]; + Strategy: { new(): Strategy & StrategyCreatedStatic }; } interface Strategy { diff --git a/types/passport/passport-tests.ts b/types/passport/passport-tests.ts index 630091afc7..f7d988c56c 100644 --- a/types/passport/passport-tests.ts +++ b/types/passport/passport-tests.ts @@ -2,14 +2,18 @@ import * as passport from 'passport'; import express = require('express'); import 'express-session'; -class TestStrategy implements passport.Strategy { +class TestStrategy extends passport.Strategy { name = 'test'; - constructor() { } - authenticate(this: passport.StrategyCreated, req: express.Request) { + + authenticate(req: express.Request) { const user: TestUser = { id: 0, }; - this.success(user); + if (Math.random() > 0.5) { + this.fail(); + } else { + this.success(user); + } } } 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" } diff --git a/types/plupload/index.d.ts b/types/plupload/index.d.ts index 614ba27261..c83fd77740 100644 --- a/types/plupload/index.d.ts +++ b/types/plupload/index.d.ts @@ -18,7 +18,7 @@ interface plupload_settings { multipart_params?: any; /** Chunk */ - chunk_size?: number|string; + chunk_size?: number | string; /** Client-Side Image Resize */ resize?: plupload_resize; @@ -28,7 +28,7 @@ interface plupload_settings { /** Useful Options */ multi_selection?: boolean; - required_features?: string|any; + required_features?: string | any; unique_names?: boolean; /** Optional */ @@ -44,7 +44,7 @@ interface plupload_settings { interface plupload_filters { mime_types?: plupload_filters_mime_types[]; - max_file_size?: number|string; + max_file_size?: number | string; prevent_duplicates?: boolean; } @@ -73,31 +73,31 @@ interface plupload_queue_progress { } interface plupload_event { - (uploader: plupload): any; + (uploader: plupload.Uploader): any; } interface plupload_event_file { - (uploader: plupload, file: any): any; + (uploader: plupload.Uploader, file: any): any; } interface plupload_event_files { - (uploader: plupload, files: any[]): any; + (uploader: plupload.Uploader, files: any[]): any; } interface plupload_event_OptionChanged { - (uploader: plupload, name: string, value: any, oldValue: any): any; + (uploader: plupload.Uploader, name: string, value: any, oldValue: any): any; } interface plupload_event_FileUploaded { - (uploader: plupload, file: any, response: plupload_response): any; + (uploader: plupload.Uploader, file: any, response: plupload_response): any; } interface plupload_event_ChunkUploaded { - (uploader: plupload, file: any, response: plupload_chunk_response): any; + (uploader: plupload.Uploader, file: any, response: plupload_chunk_response): any; } interface plupload_event_Error { - (uploader: plupload, error: plupload_error): any; + (uploader: plupload.Uploader, error: plupload_error): any; } interface plupload_events { @@ -137,61 +137,355 @@ interface plupload_error extends plupload_response { file: any; } -declare class plupload { - static Uploader(settings: plupload_settings):void; +declare namespace plupload { - static VERSION: string; + class Uploader { - static STOPPED: number; - static STARTED: number; - static QUEUED: number; - static UPLOADING: number; - static FAILED: number; - static DONE: number; - static GENERIC_ERROR: number; - static HTTP_ERROR: number; - static IO_ERROR: number; - static SECURITY_ERROR: number; - static INIT_ERROR: number; - static FILE_SIZE_ERROR: number; - static FILE_EXTENSION_ERROR: number; - static FILE_DUPLICATE_ERROR: number; - static IMAGE_FORMAT_ERROR: number; - static MEMORY_ERROR: number; - static IMAGE_DIMENSIONS_ERROR: number; + constructor(settings: plupload_settings); - static mimeTypes: any; - static ua: any; + /** Properties */ + id: string; + state: number; + features: string; + runtime: string; + files: any; + settings: any; + total: plupload_queue_progress; - static typeOf(o: any): string; - static extend(target: any): any; - static guid(guid: string): string; + /** Methods */ + init(): any; + setOption(option: string | any, value?: any): any; + getOption(option?: string): any; + refresh(): any; + start(): any; + stop(): any; + disableBrowse(disable: boolean): any; + getFile(id: string): any; + addFile(file: any, fileName?: string): any; + removeFile(file: any): any; + splice(start?: number, length?: number): any; + trigger(name: string, Multiple: any): any; + hasEventListener(name: string): any; + bind(name: string, func: any, scope?: any): any; + unbind(name: string, func: any): any; + unbindAll(): any; + destroy(): any; + } - /** Properties */ - id: string; - state: number; - features: string; - runtime: string; - files: any; - settings: any; - total: plupload_queue_progress; + export const VERSION: string; - /** Methods */ - init(): any; - setOption(option: string|any, value?: any): any; - getOption(option?: string): any; - refresh(): any; - start(): any; - stop(): any; - disableBrowse(disable: boolean): any; - getFile(id: string): any; - addFile(file: any, fileName?: string): any; - removeFile(file: any): any; - splice(start?: number, length?: number): any; - trigger(name: string, Multiple: any): any; - hasEventListener(name: string): any; - bind(name: string, func: any, scope: any): any; - unbind(name: string, func: any): any; - unbindAll(): any; - destroy(): any; + export const STOPPED: number; + export const STARTED: number; + export const QUEUED: number; + export const UPLOADING: number; + export const FAILED: number; + export const DONE: number; + export const GENERIC_ERROR: number; + export const HTTP_ERROR: number; + export const IO_ERROR: number; + export const SECURITY_ERROR: number; + export const INIT_ERROR: number; + export const FILE_SIZE_ERROR: number; + export const FILE_EXTENSION_ERROR: number; + export const FILE_DUPLICATE_ERROR: number; + export const IMAGE_FORMAT_ERROR: number; + export const MEMORY_ERROR: number; + export const IMAGE_DIMENSIONS_ERROR: number; + + export const mimeTypes: any; + export const ua: any; + + /** + * Gets the true type of the built-in object (better version of typeof). + * @credits Angus Croll (http://javascriptweblog.wordpress.com/) + * + * @method typeOf + * @static + * @param {Object} o Object to check. + * @return {String} Object [[Class]] + */ + function typeOf(o: any): string; + + /** + * Extends the specified object with another object. + * + * @method extend + * @static + * @param {Object} target Object to extend. + * @param {Object..} obj Multiple objects to extend with. + * @return {Object} Same as target, the extended object. + */ + function extend(target: any): any; + + /** + * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. + * The only way a user would be able to get the same ID is if the two persons at the same exact millisecond manages + * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. + * It's more probable for the earth to be hit with an asteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property + * to an user unique key. + * + * @method guid + * @static + * @return {String} Virtually unique id. + */ + function guid(guid: string): string; + + /** Utility methods **/ + + /** + * Executes the callback function for each item in array/object. If you return false in the + * callback it will break the loop. + * + * @method each + * @static + * @param {Object} obj Object to iterate. + * @param {function} callback Callback function to execute for each item. + */ + function each(obj: any, callback: Function): void; + + /** + * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. + * + * @method getPos + * @static + * @param {Element} node HTML element or element id to get x, y position from. + * @param {Element} root Optional root element to stop calculations at. + * @return {object} Absolute position of the specified element object with x, y fields. + */ + function getPos(node: Element, root: Element): any; + + /** + * Returns the size of the specified node in pixels. + * + * @method getSize + * @static + * @param {Node} node Node to get the size of. + * @return {Object} Object with a w and h property. + */ + function getSize(node: Node): any; + + /** + * Encodes the specified string. + * + * @method xmlEncode + * @static + * @param {String} s String to encode. + * @return {String} Encoded string. + */ + function xmlEncode(str: string): string; + + /** + * Forces anything into an array. + * + * @method toArray + * @static + * @param {Object} obj Object with length field. + * @return {Array} Array object containing all items. + */ + function toArray(obj: any): Array; + + /** + * Find an element in array and return its index if present, otherwise return -1. + * + * @method inArray + * @static + * @param {mixed} needle Element to find + * @param {Array} array + * @return {Int} Index of the element, or -1 if not found + */ + function inArray(needle: any, array: Array): number; + + /** + Recieve an array of functions (usually async) to call in sequence, each function + receives a callback as first argument that it should call, when it completes. Finally, + after everything is complete, main callback is called. Passing truthy value to the + callback as a first argument will interrupt the sequence and invoke main callback + immediately. + @method inSeries + @static + @param {Array} queue Array of functions to call in sequence + @param {Function} cb Main callback that is called in the end, or in case of error + */ + function inSeries(queue: Array, callback: Function): void; + + /** + * Extends the language pack object with new items. + * + * @method addI18n + * @static + * @param {Object} pack Language pack items to add. + * @return {Object} Extended language pack object. + */ + function addI18n(pack: any): any; + + /** + * Translates the specified string by checking for the english string in the language pack lookup. + * + * @method translate + * @static + * @param {String} str String to look for. + * @return {String} Translated string or the input string if it wasn't found. + */ + function translate(str: string): string; + + /** + * Pseudo sprintf implementation - simple way to replace tokens with specified values. + * + * @param {String} str String with tokens + * @return {String} String with replaced tokens + */ + function sprintf(str: string): string; + + /** + * Checks if object is empty. + * + * @method isEmptyObj + * @static + * @param {Object} obj Object to check. + * @return {Boolean} + */ + function isEmptyObj(obj: any): boolean; + + /** + * Checks if specified DOM element has specified class. + * + * @method hasClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + function hasClass(obj: any, name: string): any; + + /** + * Adds specified className to specified DOM element. + * + * @method addClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + function addClass(obj: any, name: string): any; + + /** + * Removes specified className from specified DOM element. + * + * @method removeClass + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Class name + */ + function removeClass(obj: any, name: string): any; + + /** + * Returns a given computed style of a DOM element. + * + * @method getStyle + * @static + * @param {Object} obj DOM element like object. + * @param {String} name Style you want to get from the DOM element + */ + function getStyle(obj: any, name: string): any; + + /** + * Adds an event handler to the specified object and store reference to the handler + * in objects internal Plupload registry (@see removeEvent). + * + * @method addEvent + * @static + * @param {Object} obj DOM element like object to add handler to. + * @param {String} name Name to add event listener to. + * @param {Function} callback Function to call when event occurs. + * @param {String} (optional) key that might be used to add specifity to the event record. + */ + function addEvent(obj: any, name: string, callback: Function, key?: string): any; + + /** + * Remove event handler from the specified object. If third argument (callback) + * is not specified remove all events with the specified name. + * + * @method removeEvent + * @static + * @param {Object} obj DOM element to remove event listener(s) from. + * @param {String} name Name of event listener to remove. + * @param {Function|String} (optional) might be a callback or unique key to match. + */ + function removeEvent(obj: any, name: string, optional?: Function | string): any; + + /** + * Remove all kind of events from the specified object + * + * @method removeAllEvents + * @static + * @param {Object} obj DOM element to remove event listeners from. + * @param {String} (optional) unique key to match, when removing events. + */ + function removeAllEvents(obj: any, key?: string): any; + + /** + * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. + * + * @method cleanName + * @static + * @param {String} s String to clean up. + * @return {String} Cleaned string. + */ + function cleanName(name: string): string; + + /** + * Builds a full url out of a base URL and an object with items to append as query string items. + * + * @method buildUrl + * @static + * @param {String} url Base URL to append query string items to. + * @param {Object} items Name/value object to serialize as a querystring. + * @return {String} String with url + serialized query string items. + */ + function buildUrl(url: string, items: any): string; + + /** + * Formats the specified number as a size string for example 1024 becomes 1 KB. + * + * @method formatSize + * @static + * @param {Number} size Size to format as string. + * @return {String} Formatted size string. + */ + function formatSize(size: number): string; + + /** + * Parses the specified size string into a byte value. For example 10kb becomes 10240. + * + * @method parseSize + * @static + * @param {String|Number} size String to parse or number to just pass through. + * @return {Number} Size in bytes. + */ + function parseSize(size: number | string): number; + + + /** + * A way to predict what runtime will be choosen in the current environment with the + * specified settings. + * + * @method predictRuntime + * @static + * @param {Object|String} config Plupload settings to check + * @param {String} [runtimes] Comma-separated list of runtimes to check against + * @return {String} Type of compatible runtime + */ + function predictRuntime(config: any, runtimes: string): string; + + /** + * Registers a filter that will be executed for each file added to the queue. + * If callback returns false, file will not be added. + * + * Callback receives two arguments: a value for the filter as it was specified in settings.filters + * and a file to be filtered. Callback is executed in the context of uploader instance. + * + * @method addFileFilter + * @static + * @param {String} name Name of the filter by which it can be referenced in settings.filters + * @param {String} cb Callback - the actual routine that every added file must pass + */ + function addFileFilter(name: string, cb: Function): void; } diff --git a/types/plupload/plupload-tests.ts b/types/plupload/plupload-tests.ts index e69de29bb2..2a416a0bbc 100644 --- a/types/plupload/plupload-tests.ts +++ b/types/plupload/plupload-tests.ts @@ -0,0 +1,48 @@ +import 'plupload'; + +{ + const uploader = new plupload.Uploader({ + browse_button: 'browse', // this can be an id of a DOM element or the DOM element itself + url: 'upload.php' + }); + + uploader.init(); + uploader.start(); + + uploader.bind('FilesAdded', function (up: any, files: any) { + var html = ''; + plupload.each(files, function (file: any) { + html += '
  • ' + file.name + ' (' + plupload.formatSize(file.size) + ')
  • '; + }); + document.getElementById('filelist').innerHTML += html; + }); + + uploader.bind('Error', function (up: any, err: any) { + document.getElementById('console').innerHTML += "\nError #" + err.code + ": " + err.message; + }); + +} + +{ + const settings: plupload_settings = { + runtimes: 'html5', + browse_button: '#button', + container: '#container', + chunk_size: '1mb', + url: 'https://fakesite.com/upload', + flash_swf_url: './plupload.flash.swf', + silverlight_xap_url: '/Scripts/plupload/js/plupload.silverlight.xap', + filters: + { + max_file_size: '50mb', + mime_types: [{ title: 'title', extensions: '*' }] + }, + init: { + Error: function (up, args) { + } + } + }; + + const uploader = new plupload.Uploader(settings); + uploader.init(); +} diff --git a/types/plupload/tsconfig.json b/types/plupload/tsconfig.json index fc46738339..d7dc70a3bd 100644 --- a/types/plupload/tsconfig.json +++ b/types/plupload/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/types/pngjs/index.d.ts b/types/pngjs/index.d.ts index ece3434de1..d5476e9e1f 100644 --- a/types/pngjs/index.d.ts +++ b/types/pngjs/index.d.ts @@ -24,7 +24,7 @@ export class PNG extends Duplex { static sync: { read(buffer: Buffer, options?: ParserOptions): PNG; - write(buffer: Buffer, options?: PackerOptions): PNG; + write(png: PNG, options?: PackerOptions): Buffer; }; constructor(options?: PNGOptions); diff --git a/types/polymer/index.d.ts b/types/polymer/index.d.ts index eee6a6250f..a4eca3e70b 100644 --- a/types/polymer/index.d.ts +++ b/types/polymer/index.d.ts @@ -139,6 +139,8 @@ declare global { unshift?(path: string, ...item: any[]): number; + notifySplices?(path: string, splices: ReadonlyArray): void; + // ResolveUrl resolveUrl?(url: string): string; @@ -312,6 +314,18 @@ declare global { whenReady(cb: Function): void; } + interface PolymerSplice { + index: number; + removed: Array<{}>; + addedCount: number; + object: Array<{}>; + type: string; + } + + interface ArraySplice { + calculateSplices(current: ReadonlyArray, previous: ReadonlyArray): PolymerSplice[]; + } + interface ImportStatus extends RenderStatus { whenLoaded(cb: Function): void; } @@ -329,6 +343,8 @@ declare global { RenderStatus: RenderStatus + ArraySplice: ArraySplice; + /** @deprecated */ ImportStatus: ImportStatus } diff --git a/types/polymer/polymer-tests.ts b/types/polymer/polymer-tests.ts index dcad66f871..2b6631ffb7 100644 --- a/types/polymer/polymer-tests.ts +++ b/types/polymer/polymer-tests.ts @@ -82,3 +82,11 @@ class MyElement3 implements polymer.Base { } Polymer(MyElement3); + +// Test splice computation +const splices: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices( + [1,2,3], [1,2]); + +// Test that readonly arrays also work. +const splices2: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices( + Object.freeze([1,2,3]), Object.freeze([1,2])); diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 2afb026648..9298d6c631 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -1041,6 +1041,12 @@ export interface Page extends EventEmitter, FrameBase { */ select(selector: string, ...values: string[]): Promise; + /** + * Determines whether cache is enabled on the page. + * @param enabled Whether or not to enable cache on the page. + */ + setCacheEnabled(enabled: boolean): Promise; + /** * Sets the cookies on the page. * @param cookies The cookies to set. 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": [ "../" diff --git a/types/react-beautiful-dnd/index.d.ts b/types/react-beautiful-dnd/index.d.ts index d02c86bbcf..8d25e79407 100644 --- a/types/react-beautiful-dnd/index.d.ts +++ b/types/react-beautiful-dnd/index.d.ts @@ -12,7 +12,7 @@ export type Id = string; export type DraggableId = Id; export type DroppableId = Id; export type TypeId = Id; -export type ZIndex = number | string; +export type ZIndex = React.CSSProperties['zIndex']; export type DropReason = 'DROP' | 'CANCEL'; export type Announce = (message: string) => void; diff --git a/types/react-loadable/index.d.ts b/types/react-loadable/index.d.ts index d2229d4bf6..beeb569d4c 100644 --- a/types/react-loadable/index.d.ts +++ b/types/react-loadable/index.d.ts @@ -4,6 +4,7 @@ // Oden S. // Ian Ker-Seymer // Tomek Łaziuk +// Ian Mobley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts new file mode 100644 index 0000000000..ecfa79cd53 --- /dev/null +++ b/types/react-loadable/test/webpack.ts @@ -0,0 +1,25 @@ +import webpack = require('webpack'); +import Loadable = require('react-loadable/webpack'); + +const config: webpack.Configuration = { + plugins: [ + new Loadable.ReactLoadablePlugin(), + new Loadable.ReactLoadablePlugin({ + filename: 'react-loadable.json' + }) + ] +}; + +const manifest = { + react: [ + { + id: 0, + name: './node_modules/react/index.js', + file: 'main.js' + } + ] +}; + +const manifestIds = ['react']; + +const bundles = Loadable.getBundles(manifest, manifestIds); diff --git a/types/react-loadable/tsconfig.json b/types/react-loadable/tsconfig.json index 9d46ae0de9..a2ad20875b 100644 --- a/types/react-loadable/tsconfig.json +++ b/types/react-loadable/tsconfig.json @@ -19,8 +19,10 @@ }, "files": [ "index.d.ts", + "webpack.d.ts", "test/index.tsx", + "test/webpack.ts", "test/imports/no-default.tsx", "test/imports/with-default.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts new file mode 100644 index 0000000000..54732527d8 --- /dev/null +++ b/types/react-loadable/webpack.d.ts @@ -0,0 +1,30 @@ +import webpack = require("webpack"); + +declare namespace LoadableExport { + interface Options { + filename: string; + } + + class ReactLoadablePlugin extends webpack.Plugin { + constructor(opts?: Options); + } + + interface Bundle { + id: number; + name: string; + file: string; + } + + interface Manifest { + [moduleId: string]: Bundle[]; + } + + function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; +} + +declare const exports: { + getBundles: typeof LoadableExport.getBundles; + ReactLoadablePlugin: typeof LoadableExport.ReactLoadablePlugin; +}; + +export = exports; diff --git a/types/react-native-vector-icons/Icon.d.ts b/types/react-native-vector-icons/Icon.d.ts index 98bda708b3..4b64503452 100644 --- a/types/react-native-vector-icons/Icon.d.ts +++ b/types/react-native-vector-icons/Icon.d.ts @@ -157,6 +157,9 @@ export class Icon extends React.Component { static loadFont( file?: string ): Promise; + static hasIcon( + name: string, + ): boolean; } export namespace Icon { diff --git a/types/react-native-vector-icons/index.d.ts b/types/react-native-vector-icons/index.d.ts index 05a140e3bb..2a2ef8fdce 100644 --- a/types/react-native-vector-icons/index.d.ts +++ b/types/react-native-vector-icons/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native-vector-icons 4.4 +// Type definitions for react-native-vector-icons 4.6 // Project: https://github.com/oblador/react-native-vector-icons // Definitions by: Kyle Roach // Tim Wang diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 934b738293..a248fd3010 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. @@ -1524,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 @@ -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 @@ -3712,7 +3715,7 @@ export interface SectionListProperties extends VirtualizedListProperties< /** * Rendered at the very beginning of the list. */ - ListHeaderComponent?: React.ComponentClass | (() => React.ReactElement) | null; + ListHeaderComponent?: React.ComponentClass | React.ReactElement | (() => React.ReactElement) | null; /** * Rendered in between each section. @@ -4396,6 +4399,11 @@ export interface ModalProperties { * @platform ios */ onDismiss?: () => void; + /** + * The `presentationStyle` determines the style of modal to show + * @platform ios + */ + presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; } export interface ModalStatic extends React.ComponentClass {} diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 9ec404a6fb..9aafc994fb 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -31,6 +31,7 @@ import * as React from 'react'; import { Animated, TextStyle, + ViewProperties, ViewStyle, StyleProp, } from 'react-native'; @@ -173,14 +174,15 @@ export type NavigationScreenConfig = }) => Options); export type NavigationComponent = - NavigationScreenComponent + NavigationScreenComponent | NavigationNavigator; export type NavigationScreenComponent< + Params = NavigationParams, Options = {}, Props = {} -> = React.ComponentType & Props> & -({} | { navigationOptions: NavigationScreenConfig }); +> = React.ComponentType & Props> & +{ navigationOptions?: NavigationScreenConfig }; export type NavigationNavigator< State = NavigationState, @@ -201,6 +203,8 @@ export interface NavigationNavigateActionPayload { // The action to run inside the sub-router action?: NavigationNavigateAction; + + key?: string; } export interface NavigationNavigateAction extends NavigationNavigateActionPayload { @@ -276,7 +280,11 @@ export interface NavigationStackViewConfig { mode?: 'card' | 'modal'; headerMode?: HeaderMode; cardStyle?: StyleProp; - transitionConfig?: () => TransitionConfig; + transitionConfig?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps: NavigationTransitionProps, + isModal: boolean, + ) => TransitionConfig; onTransitionStart?: () => void; onTransitionEnd?: () => void; } @@ -429,16 +437,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; - setParams: (newParams: NavigationParams) => boolean; + getParam: (param: T, fallback?: P[T]) => P[T]; + setParams: (newParams: P) => boolean; addListener: ( eventName: string, callback: NavigationEventCallback @@ -700,6 +709,7 @@ export function TabNavigator( export interface TabBarTopProps { activeTintColor: string; inactiveTintColor: string; + indicatorStyle: StyleProp; showIcon: boolean; showLabel: boolean; upperCaseLabel: boolean; @@ -858,10 +868,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; } /** @@ -901,3 +911,20 @@ export function withNavigation( export function withNavigationFocus( Component: React.ComponentType ): React.ComponentType; + +/** + * SafeAreaView Component + */ +export type SafeAreaViewForceInsetValue = 'always' | 'never'; +export interface SafeAreaViewProps extends ViewProperties { + forceInset?: { + top?: SafeAreaViewForceInsetValue; + bottom?: SafeAreaViewForceInsetValue; + left?: SafeAreaViewForceInsetValue; + right?: SafeAreaViewForceInsetValue; + horizontal?: SafeAreaViewForceInsetValue; + vertical?: SafeAreaViewForceInsetValue; + }; +} + +export const SafeAreaView: React.ComponentClass; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 5c03253d35..7e956d2c1a 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -100,7 +100,7 @@ class NextScreen extends React.Component @@ -134,7 +134,14 @@ export const AppNavigator = StackNavigator( }, ); -const StatelessScreen: NavigationScreenComponent = () => ; +interface StatelessScreenParams { + testID: string; +} + +const StatelessScreen: NavigationScreenComponent = (props) => + ; + +StatelessScreen.navigationOptions = { title: 'Stateless' }; const SimpleStackNavigator = StackNavigator( { diff --git a/types/react-places-autocomplete/index.d.ts b/types/react-places-autocomplete/index.d.ts index 73a8e7ae55..667106d916 100644 --- a/types/react-places-autocomplete/index.d.ts +++ b/types/react-places-autocomplete/index.d.ts @@ -21,6 +21,7 @@ export interface PropTypes { name?: string; placeholder?: string; onBlur?: (event: React.FocusEvent) => void; + disabled?: boolean; }; onError?: (status: string, clearSuggestion: () => void) => void; onSelect?: (address: string, placeID: string) => void; diff --git a/types/react-recaptcha/index.d.ts b/types/react-recaptcha/index.d.ts index ecfd0db003..595cc1916e 100644 --- a/types/react-recaptcha/index.d.ts +++ b/types/react-recaptcha/index.d.ts @@ -34,4 +34,5 @@ declare class Recaptcha extends Component { static propTypes: any; static defaultProps: Recaptcha.RecaptchaProps; reset(): void; + execute(): void; } diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index b463807003..503b5f4e02 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -642,6 +642,9 @@ export interface RowInfo { /** An array of any expandable sub-rows contained in this row */ subRows: any[]; + + /** Original object passed to row */ + original: any; } export interface FinalState extends TableProps { diff --git a/types/react/index.d.ts b/types/react/index.d.ts index c38f57b0a7..2ed2fb497c 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React 16.1 +// Type definitions for React 16.3 // Project: http://facebook.github.io/react/ // Definitions by: Asana // AssureSign @@ -12,10 +12,10 @@ // Tanguy Krotoff // Dovydas Navickas // Stéphane Goetz -// Rich Seviora // Josh Rutherford // Guilherme Hübner // Josh Goldberg +// Johann Rakotoharisoa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -52,6 +52,8 @@ React.cloneElement(element, <{ isDisabled?: boolean } & React.Attributes>{ /// +import * as CSS from 'csstype'; + type NativeAnimationEvent = AnimationEvent; type NativeClipboardEvent = ClipboardEvent; type NativeCompositionEvent = CompositionEvent; @@ -268,6 +270,7 @@ declare namespace React { const Children: ReactChildren; const Fragment: ComponentType; + const StrictMode: ComponentType; const version: string; // @@ -278,7 +281,7 @@ declare namespace React { // Base component for plain JS classes // tslint:disable-next-line:no-empty-interface - interface Component

    extends ComponentLifecycle { } + interface Component

    extends ComponentLifecycle { } class Component { constructor(props: P, context?: any); @@ -331,7 +334,7 @@ declare namespace React { displayName?: string; } - interface ComponentClass

    { + interface ComponentClass

    extends StaticLifecycle { new (props: P, context?: any): Component; propTypes?: ValidationMap

    ; contextTypes?: ValidationMap; @@ -359,24 +362,14 @@ declare namespace React { // Component Specs and Lifecycle // ---------------------------------------------------------------------- - interface ComponentLifecycle { - /** - * Called immediately before mounting occurs, and before `Component#render`. - * Avoid introducing any side-effects or subscriptions in this method. - */ - componentWillMount?(): void; + // This should actually be something like `Lifecycle | DeprecatedLifecycle`, + // as React will _not_ call the deprecated lifecycle methods if any of the new lifecycle + // methods are present. + interface ComponentLifecycle extends NewLifecycle, DeprecatedLifecycle { /** * Called immediately after a compoment is mounted. Setting state here will trigger re-rendering. */ componentDidMount?(): void; - /** - * Called when the component may be receiving new props. - * React may call this even if props have not changed, so be sure to compare new and existing - * props if you only want to handle changes. - * - * Calling `Component#setState` generally does not trigger this method. - */ - componentWillReceiveProps?(nextProps: Readonly

    , nextContext: any): void; /** * Called to determine whether the change in props and state should trigger a re-render. * @@ -388,16 +381,6 @@ declare namespace React { * and `componentDidUpdate` will not be called. */ shouldComponentUpdate?(nextProps: Readonly

    , nextState: Readonly, nextContext: any): boolean; - /** - * Called immediately before rendering when new props or state is received. Not called for the initial render. - * - * Note: You cannot call `Component#setState` here. - */ - componentWillUpdate?(nextProps: Readonly

    , nextState: Readonly, nextContext: any): void; - /** - * Called immediately after updating occurs. Not called for the initial render. - */ - componentDidUpdate?(prevProps: Readonly

    , prevState: Readonly, prevContext: any): void; /** * Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as * cancelled network requests, or cleaning up any DOM elements created in `componentDidMount`. @@ -410,6 +393,127 @@ declare namespace React { componentDidCatch?(error: Error, errorInfo: ErrorInfo): void; } + // Unfortunately, we have no way of declaring that the component constructor must implement this + interface StaticLifecycle { + getDerivedStateFromProps?: GetDerivedStateFromProps; + } + + type GetDerivedStateFromProps = + /** + * Returns an update to a component's state based on its new props and old state. + * + * Note: its presence prevents any of the deprecated lifecycle methods from being invoked + */ + (nextProps: Readonly

    , prevState: S) => Partial | null; + + // This should be "infer SS" but can't use it yet + interface NewLifecycle { + /** + * Runs before React applies the result of `render` to the document, and + * returns an object to be given to componentDidUpdate. Useful for saving + * things such as scroll position before `render` causes changes to it. + * + * Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated + * lifecycle events from running. + */ + getSnapshotBeforeUpdate?(prevProps: Readonly

    , prevState: Readonly): SS | null; + /** + * Called immediately after updating occurs. Not called for the initial render. + * + * The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null. + */ + componentDidUpdate?(prevProps: Readonly

    , prevState: Readonly, snapshot?: SS): void; + } + + interface DeprecatedLifecycle { + /** + * Called immediately before mounting occurs, and before `Component#render`. + * Avoid introducing any side-effects or subscriptions in this method. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use componentDidMount or the constructor instead; will stop working in React 17 + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + componentWillMount?(): void; + /** + * Called immediately before mounting occurs, and before `Component#render`. + * Avoid introducing any side-effects or subscriptions in this method. + * + * This method will not stop working in React 17. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use componentDidMount or the constructor instead + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#initializing-state + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + UNSAFE_componentWillMount?(): void; + /** + * Called when the component may be receiving new props. + * React may call this even if props have not changed, so be sure to compare new and existing + * props if you only want to handle changes. + * + * Calling `Component#setState` generally does not trigger this method. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use static getDerivedStateFromProps instead; will stop working in React 17 + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + componentWillReceiveProps?(nextProps: Readonly

    , nextContext: any): void; + /** + * Called when the component may be receiving new props. + * React may call this even if props have not changed, so be sure to compare new and existing + * props if you only want to handle changes. + * + * Calling `Component#setState` generally does not trigger this method. + * + * This method will not stop working in React 17. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use static getDerivedStateFromProps instead + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + UNSAFE_componentWillReceiveProps?(nextProps: Readonly

    , nextContext: any): void; + /** + * Called immediately before rendering when new props or state is received. Not called for the initial render. + * + * Note: You cannot call `Component#setState` here. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use getSnapshotBeforeUpdate instead; will stop working in React 17 + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + componentWillUpdate?(nextProps: Readonly

    , nextState: Readonly, nextContext: any): void; + /** + * Called immediately before rendering when new props or state is received. Not called for the initial render. + * + * Note: You cannot call `Component#setState` here. + * + * This method will not stop working in React 17. + * + * Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps + * prevents this from being invoked. + * + * @deprecated 16.3, use getSnapshotBeforeUpdate instead + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#reading-dom-properties-before-an-update + * @see https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path + */ + UNSAFE_componentWillUpdate?(nextProps: Readonly

    , nextState: Readonly, nextContext: any): void; + } + interface Mixin extends ComponentLifecycle { mixins?: Array>; statics?: { @@ -807,1642 +911,9 @@ declare namespace React { onTransitionEndCapture?: TransitionEventHandler; } - // See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords - // See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords - // "all CSS properties can accept these values" - type CSSWideKeyword = "initial" | "inherit" | "unset"; - - // See CSS 3 type https://drafts.csswg.org/css-values-3/#percentages - type CSSPercentage = string; - - // See CSS 3 type https://drafts.csswg.org/css-values-3/#lengths - type CSSLength = number | string; - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in React) - interface CSSProperties { - /** - * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. - */ - alignContent?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "stretch"; - - /** - * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. - */ - alignItems?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "baseline" | "stretch"; - - /** - * Allows the default alignment to be overridden for individual flex items. - */ - alignSelf?: CSSWideKeyword | "auto" | "flex-start" | "flex-end" | "center" | "baseline" | "stretch"; - - /** - * This property allows precise alignment of elements, such as graphics, - * that do not have a baseline-table or lack the desired baseline in their baseline-table. - * With the alignment-adjust property, the position of the baseline identified by the alignment-baseline - * can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. - */ - alignmentAdjust?: CSSWideKeyword | any; - - alignmentBaseline?: CSSWideKeyword | any; - - /** - * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. - */ - animationDelay?: CSSWideKeyword | any; - - /** - * Defines whether an animation should run in reverse on some or all cycles. - */ - animationDirection?: CSSWideKeyword | any; - - /** - * Specifies how many times an animation cycle should play. - */ - animationIterationCount?: CSSWideKeyword | any; - - /** - * Defines the list of animations that apply to the element. - */ - animationName?: CSSWideKeyword | any; - - /** - * Defines whether an animation is running or paused. - */ - animationPlayState?: CSSWideKeyword | any; - - /** - * Allows changing the style of any element to platform-based interface elements or vice versa. - */ - appearance?: CSSWideKeyword | any; - - /** - * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. - */ - backfaceVisibility?: CSSWideKeyword | any; - - /** - * Shorthand property to set the values for one or more of: - * background-clip, background-color, background-image, - * background-origin, background-position, background-repeat, - * background-size, and background-attachment. - */ - background?: CSSWideKeyword | any; - - /** - * If a background-image is specified, this property determines - * whether that image's position is fixed within the viewport, - * or scrolls along with its containing block. - * See CSS 3 background-attachment property https://drafts.csswg.org/css-backgrounds-3/#the-background-attachment - */ - backgroundAttachment?: CSSWideKeyword | "scroll" | "fixed" | "local"; - - /** - * This property describes how the element's background images should blend with each other and the element's background color. - * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the - * corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, - * the UA must calculate its used value by repeating the list of values until there are enough. - */ - backgroundBlendMode?: CSSWideKeyword | any; - - /** - * Sets the background color of an element. - */ - backgroundColor?: CSSWideKeyword | any; - - backgroundComposite?: CSSWideKeyword | any; - - /** - * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. - */ - backgroundImage?: CSSWideKeyword | any; - - /** - * Specifies what the background-position property is relative to. - */ - backgroundOrigin?: CSSWideKeyword | any; - - /** - * Sets the position of a background image. - */ - backgroundPosition?: CSSWideKeyword | any; - - /** - * Background-repeat defines if and how background images will be repeated after they have been sized and positioned - */ - backgroundRepeat?: CSSWideKeyword | any; - - /** - * Defines the size of the background images - */ - backgroundSize?: CSSWideKeyword | any; - - /** - * Obsolete - spec retired, not implemented. - */ - baselineShift?: CSSWideKeyword | any; - - /** - * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. - */ - behavior?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. - * It can be used to set border-width, border-style and border-color, or a subset of these. - */ - border?: CSSWideKeyword | any; - - /** - * Shorthand that sets the values of border-bottom-color, - * border-bottom-style, and border-bottom-width. - */ - borderBottom?: CSSWideKeyword | any; - - /** - * Sets the color of the bottom border of an element. - */ - borderBottomColor?: CSSWideKeyword | any; - - /** - * Defines the shape of the border of the bottom-left corner. - */ - borderBottomLeftRadius?: CSSWideKeyword | CSSLength; - - /** - * Defines the shape of the border of the bottom-right corner. - */ - borderBottomRightRadius?: CSSWideKeyword | CSSLength; - - /** - * Sets the line style of the bottom border of a box. - */ - borderBottomStyle?: CSSWideKeyword | any; - - /** - * Sets the width of an element's bottom border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderBottomWidth?: CSSWideKeyword | any; - - /** - * Border-collapse can be used for collapsing the borders between table cells - */ - borderCollapse?: CSSWideKeyword | any; - - /** - * The CSS border-color property sets the color of an element's four borders. - * This property can have from one to four values, made up of the elementary properties: - * • border-top-color - * • border-right-color - * • border-bottom-color - * • border-left-color The default color is the currentColor of each of these values. - * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, - * respectively. Providing three values sets the top, vertical, and bottom values, in that order. - * Four values set all for sides: top, right, bottom, and left, in that order. - */ - borderColor?: CSSWideKeyword | any; - - /** - * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). - * Works along with border-radius to specify the size of each corner effect. - */ - borderCornerShape?: CSSWideKeyword | any; - - /** - * The property border-image-source is used to set the image to be used instead of the border style. - * If this is set to none the border-style is used instead. - */ - borderImageSource?: CSSWideKeyword | any; - - /** - * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, - * the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, - * bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. - */ - borderImageWidth?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. - * Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, - * border-left-style and border-left-color. - */ - borderLeft?: CSSWideKeyword | any; - - /** - * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, - * but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderLeftColor?: CSSWideKeyword | any; - - /** - * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. - * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderLeftStyle?: CSSWideKeyword | any; - - /** - * Sets the width of an element's left border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderLeftWidth?: CSSWideKeyword | any; - - /** - * Shorthand property that sets the rounding of all four corners. - */ - borderRadius?: CSSWideKeyword | CSSLength; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's right border - * in a single declaration. Note that you can use the corresponding longhand properties to set specific - * individual properties of the right border — border-right-width, border-right-style and border-right-color. - */ - borderRight?: CSSWideKeyword | any; - - /** - * Sets the color of an element's right border. This page explains the border-right-color value, - * but often you will find it more convenient to fix the border's right color as part of a shorthand set, - * either border-right or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderRightColor?: CSSWideKeyword | any; - - /** - * Sets the style of an element's right border. To set all four borders, use the shorthand property, - * border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, - * border-bottom-style, border-left-style. - */ - borderRightStyle?: CSSWideKeyword | any; - - /** - * Sets the width of an element's right border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderRightWidth?: CSSWideKeyword | any; - - /** - * Specifies the distance between the borders of adjacent cells. - */ - borderSpacing?: CSSWideKeyword | any; - - /** - * Sets the style of an element's four borders. This property can have from one to four values. - * With only one value, the value will be applied to all four borders; - * otherwise, this works as a shorthand property for each of border-top-style, border-right-style, - * border-bottom-style, border-left-style, where each border style may be assigned a separate value. - */ - borderStyle?: CSSWideKeyword | any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's top border - * in a single declaration. Note that you can use the corresponding longhand properties to set specific - * individual properties of the top border — border-top-width, border-top-style and border-top-color. - */ - borderTop?: CSSWideKeyword | any; - - /** - * Sets the color of an element's top border. This page explains the border-top-color value, - * but often you will find it more convenient to fix the border's top color as part of a shorthand set, - * either border-top or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderTopColor?: CSSWideKeyword | any; - - /** - * Sets the rounding of the top-left corner of the element. - */ - borderTopLeftRadius?: CSSWideKeyword | CSSLength; - - /** - * Sets the rounding of the top-right corner of the element. - */ - borderTopRightRadius?: CSSWideKeyword | CSSLength; - - /** - * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. - * Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderTopStyle?: CSSWideKeyword | any; - - /** - * Sets the width of an element's top border. To set all four borders, - * use the border-width shorthand property which sets the values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderTopWidth?: CSSWideKeyword | any; - - /** - * Sets the width of an element's four borders. This property can have from one to four values. - * This is a shorthand property for setting values simultaneously for border-top-width, - * border-right-width, border-bottom-width, and border-left-width. - */ - borderWidth?: CSSWideKeyword | any; - - /** - * This property specifies how far an absolutely positioned box's bottom margin edge - * is offset above the bottom edge of the box's containing block. For relatively positioned boxes, - * the offset is with respect to the bottom edges of the box itself - * (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - */ - bottom?: CSSWideKeyword | any; - - /** - * Obsolete. - */ - boxAlign?: CSSWideKeyword | any; - - /** - * Breaks a box into fragments creating new borders, - * padding and repeating backgrounds or lets it stay as a continuous box on a page break, - * column break, or, for inline elements, at a line break. - */ - boxDecorationBreak?: CSSWideKeyword | any; - - /** - * Deprecated - */ - boxDirection?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. - */ - boxLineProgression?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. - */ - boxLines?: CSSWideKeyword | any; - - /** - * Do not use. This property has been replaced by flex-order. - * Specifies the ordinal group that a child element of the object belongs to. - * This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. - */ - boxOrdinalGroup?: CSSWideKeyword | any; - - /** - * Deprecated. - */ - boxFlex?: CSSWideKeyword | number; - - /** - * Deprecated. - */ - boxFlexGroup?: CSSWideKeyword | number; - - /** - * Cast a drop shadow from the frame of almost any element. - * MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow - */ - boxShadow?: CSSWideKeyword | any; - - /** - * The CSS break-after property allows you to force a break on multi-column layouts. - * More specifically, it allows you to force a break after an element. - * It allows you to determine if a break should occur, and what type of break it should be. - * The break-after CSS property describes how the page, column or region break behaves after the generated box. - * If there is no generated box, the property is ignored. - */ - breakAfter?: CSSWideKeyword | any; - - /** - * Control page/column/region breaks that fall above a block of content - */ - breakBefore?: CSSWideKeyword | any; - - /** - * Control page/column/region breaks that fall within a block of content - */ - breakInside?: CSSWideKeyword | any; - - /** - * The clear CSS property specifies if an element can be positioned next to - * or must be positioned below the floating elements that precede it in the markup. - */ - clear?: CSSWideKeyword | any; - - /** - * Deprecated; see clip-path. - * Lets you specify the dimensions of an absolutely positioned element that should be visible, - * and the element is clipped into this shape, and displayed. - */ - clip?: CSSWideKeyword | any; - - /** - * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. - * This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, - * to use when filling the different parts of a graphics. - */ - clipRule?: CSSWideKeyword | any; - - /** - * The color property sets the color of an element's foreground content (usually text), - * accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). - */ - color?: CSSWideKeyword | any; - - /** - * Describes the number of columns of the element. - * See CSS 3 column-count property https://www.w3.org/TR/css3-multicol/#cc - */ - columnCount?: CSSWideKeyword | number | "auto"; - - /** - * Specifies how to fill columns (balanced or sequential). - */ - columnFill?: CSSWideKeyword | any; - - /** - * The column-gap property controls the width of the gap between columns in multi-column elements. - */ - columnGap?: CSSWideKeyword | any; - - /** - * Sets the width, style, and color of the rule between columns. - */ - columnRule?: CSSWideKeyword | any; - - /** - * Specifies the color of the rule between columns. - */ - columnRuleColor?: CSSWideKeyword | any; - - /** - * Specifies the width of the rule between columns. - */ - columnRuleWidth?: CSSWideKeyword | any; - - /** - * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. - * An element that spans more than one column is called a spanning element. - */ - columnSpan?: CSSWideKeyword | any; - - /** - * Specifies the width of columns in multi-column elements. - */ - columnWidth?: CSSWideKeyword | any; - - /** - * This property is a shorthand property for setting column-width and/or column-count. - */ - columns?: CSSWideKeyword | any; - - /** - * The counter-increment property accepts one or more names of counters (identifiers), - * each one optionally followed by an integer which specifies the value by which the counter should be incremented - * (e.g. if the value is 2, the counter increases by 2 each time it is invoked). - */ - counterIncrement?: CSSWideKeyword | any; - - /** - * The counter-reset property contains a list of one or more names of counters, - * each one optionally followed by an integer (otherwise, the integer defaults to 0.). - * Each time the given element is invoked, the counters specified by the property are set to the given integer. - */ - counterReset?: CSSWideKeyword | any; - - /** - * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents - * before and after presenting an element's content; if only one file is specified, it is played both before and after. - * The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. - * The icon files may also be set separately with the cue-before and cue-after properties. - */ - cue?: CSSWideKeyword | any; - - /** - * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents - * after presenting an element's content; the volume at which the file should be played may also be specified. - * The shorthand property cue sets cue sounds for both before and after the element is presented. - */ - cueAfter?: CSSWideKeyword | any; - - /** - * Specifies the mouse cursor displayed when the mouse pointer is over an element. - */ - cursor?: CSSWideKeyword | any; - - /** - * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. - */ - direction?: CSSWideKeyword | any; - - /** - * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. - */ - display?: CSSWideKeyword | any; - - /** - * The ‘fill’ property paints the interior of the given graphical element. - * The area to be painted consists of any areas inside the outline of the shape. - * To determine the inside of the shape, all subpaths are considered, - * and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. - * The zero-width geometric outline of a shape is included in the area to be painted. - */ - fill?: CSSWideKeyword | any; - - /** - * SVG: Specifies the opacity of the color or the content the current object is filled with. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#FillOpacityProperty - */ - fillOpacity?: CSSWideKeyword | number; - - /** - * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. - * For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; - * however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, - * the interpretation of "inside" is not so obvious. - * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: - */ - fillRule?: CSSWideKeyword | any; - - /** - * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. - */ - filter?: CSSWideKeyword | any; - - /** - * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. - */ - flex?: CSSWideKeyword | number | string; - - /** - * Obsolete, do not use. This property has been renamed to align-items. - * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. - */ - flexAlign?: CSSWideKeyword | any; - - /** - * The flex-basis CSS property describes the initial main size of the flex item - * before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). - */ - flexBasis?: CSSWideKeyword | any; - - /** - * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. - */ - flexDirection?: CSSWideKeyword | "row" | "row-reverse" | "column" | "column-reverse"; - - /** - * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. - */ - flexFlow?: CSSWideKeyword | string; - - /** - * Specifies the flex grow factor of a flex item. - * See CSS flex-grow property https://drafts.csswg.org/css-flexbox-1/#flex-grow-property - */ - flexGrow?: CSSWideKeyword | number; - - /** - * Do not use. This property has been renamed to align-self - * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. - */ - flexItemAlign?: CSSWideKeyword | any; - - /** - * Do not use. This property has been renamed to align-content. - * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. - */ - flexLinePack?: CSSWideKeyword | any; - - /** - * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. - */ - flexOrder?: CSSWideKeyword | any; - - /** - * Specifies the flex shrink factor of a flex item. - * See CSS flex-shrink property https://drafts.csswg.org/css-flexbox-1/#flex-shrink-property - */ - flexShrink?: CSSWideKeyword | number; - - /** - * Specifies whether flex items are forced into a single line or can be wrapped onto multiple lines. - * If wrapping is allowed, this property also enables you to control the direction in which lines are stacked. - * See CSS flex-wrap property https://drafts.csswg.org/css-flexbox-1/#flex-wrap-property - */ - flexWrap?: CSSWideKeyword | "nowrap" | "wrap" | "wrap-reverse"; - - /** - * Elements which have the style float are floated horizontally. - * These elements can move as far to the left or right of the containing element. - * All elements after the floating element will flow around it, but elements before the floating element are not impacted. - * If several floating elements are placed after each other, they will float next to each other as long as there is room. - */ - float?: CSSWideKeyword | any; - - /** - * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. - */ - flowFrom?: CSSWideKeyword | any; - - /** - * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, - * or you can set one of a choice of keywords to adopt a system font setting. - */ - font?: CSSWideKeyword | any; - - /** - * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. - * The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. - */ - fontFamily?: CSSWideKeyword | any; - - /** - * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. - * This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. - */ - fontKerning?: CSSWideKeyword | any; - - /** - * Specifies the size of the font. Used to compute em and ex units. - * See CSS 3 font-size property https://www.w3.org/TR/css-fonts-3/#propdef-font-size - */ - fontSize?: CSSWideKeyword | - "xx-small" | "x-small" | "small" | "medium" | "large" | "x-large" | "xx-large" | - "larger" | "smaller" | - CSSLength | CSSPercentage; - - /** - * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, - * so that the x-height is the same no matter what font is used. - * This preserves the readability of the text when fallback happens. - * See CSS 3 font-size-adjust property https://www.w3.org/TR/css-fonts-3/#propdef-font-size-adjust - */ - fontSizeAdjust?: CSSWideKeyword | "none" | number; - - /** - * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. - * See CSS 3 font-stretch property https://drafts.csswg.org/css-fonts-3/#propdef-font-stretch - */ - fontStretch?: CSSWideKeyword | - "normal" | "ultra-condensed" | "extra-condensed" | "condensed" | "semi-condensed" | - "semi-expanded" | "expanded" | "extra-expanded" | "ultra-expanded"; - - /** - * The font-style property allows normal, italic, or oblique faces to be selected. - * Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. - * Oblique faces can be simulated by artificially sloping the glyphs of the regular face. - * See CSS 3 font-style property https://www.w3.org/TR/css-fonts-3/#propdef-font-style - */ - fontStyle?: CSSWideKeyword | "normal" | "italic" | "oblique"; - - /** - * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. - */ - fontSynthesis?: CSSWideKeyword | any; - - /** - * The font-variant property enables you to select the small-caps font within a font family. - */ - fontVariant?: CSSWideKeyword | any; - - /** - * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. - */ - fontVariantAlternates?: CSSWideKeyword | any; - - /** - * Specifies the weight or boldness of the font. - * See CSS 3 'font-weight' property https://www.w3.org/TR/css-fonts-3/#propdef-font-weight - */ - fontWeight?: CSSWideKeyword | "normal" | "bold" | "bolder" | "lighter" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; - - /** - * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. - */ - gridArea?: CSSWideKeyword | any; - - /** - * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. - */ - gridColumn?: CSSWideKeyword | any; - - /** - * Controls a grid item's placement in a grid area as well as grid position and a grid span. - * The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - gridColumnEnd?: CSSWideKeyword | any; - - /** - * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area. - * A grid item's placement in a grid area consists of a grid position and a grid span. - * See also ( grid-row-start, grid-row-end, and grid-column-end) - */ - gridColumnStart?: CSSWideKeyword | any; - - /** - * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. - */ - gridRow?: CSSWideKeyword | any; - - /** - * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. - * The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - gridRowEnd?: CSSWideKeyword | any; - - /** - * Specifies a row position based upon an integer location, string value, or desired row size. - * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position - */ - gridRowPosition?: CSSWideKeyword | any; - - gridRowSpan?: CSSWideKeyword | any; - - /** - * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. - * The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. - */ - gridTemplateAreas?: CSSWideKeyword | any; - - /** - * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. - * Each sizing function can be specified as a length, a percentage of the grid container’s size, - * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - gridTemplateColumns?: CSSWideKeyword | any; - - /** - * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. - * Each sizing function can be specified as a length, a percentage of the grid container’s size, - * a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - gridTemplateRows?: CSSWideKeyword | any; - - /** - * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. - */ - height?: CSSWideKeyword | any; - - /** - * Specifies the minimum number of characters in a hyphenated word - */ - hyphenateLimitChars?: CSSWideKeyword | any; - - /** - * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. - */ - hyphenateLimitLines?: CSSWideKeyword | any; - - /** - * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered - * to pull part of a word from the next line back up into the current one. - */ - hyphenateLimitZone?: CSSWideKeyword | any; - - /** - * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. - */ - hyphens?: CSSWideKeyword | any; - - imeMode?: CSSWideKeyword | any; - - /** - * Defines how the browser distributes space between and around flex items - * along the main-axis of their container. - * See CSS justify-content property https://www.w3.org/TR/css-flexbox-1/#justify-content-property - */ - justifyContent?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch"; - - layoutGrid?: CSSWideKeyword | any; - - layoutGridChar?: CSSWideKeyword | any; - - layoutGridLine?: CSSWideKeyword | any; - - layoutGridMode?: CSSWideKeyword | any; - - layoutGridType?: CSSWideKeyword | any; - - /** - * Sets the left edge of an element - */ - left?: CSSWideKeyword | any; - - /** - * The letter-spacing CSS property specifies the spacing behavior between text characters. - */ - letterSpacing?: CSSWideKeyword | any; - - /** - * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. - */ - lineBreak?: CSSWideKeyword | any; - - lineClamp?: CSSWideKeyword | number; - - /** - * Specifies the height of an inline block level element. - * See CSS 2.1 line-height property https://www.w3.org/TR/CSS21/visudet.html#propdef-line-height - */ - lineHeight?: CSSWideKeyword | "normal" | number | CSSLength | CSSPercentage; - - /** - * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. - */ - listStyle?: CSSWideKeyword | any; - - /** - * This property sets the image that will be used as the list item marker. When the image is available, - * it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, - * it will show the style specified by list-style-property - */ - listStyleImage?: CSSWideKeyword | any; - - /** - * Specifies if the list-item markers should appear inside or outside the content flow. - */ - listStylePosition?: CSSWideKeyword | any; - - /** - * Specifies the type of list-item marker in a list. - */ - listStyleType?: CSSWideKeyword | any; - - /** - * The margin property is shorthand to allow you to set all four margins of an element at once. - * Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. - * Negative values are also allowed. - */ - margin?: CSSWideKeyword | any; - - /** - * margin-bottom sets the bottom margin of an element. - */ - marginBottom?: CSSWideKeyword | any; - - /** - * margin-left sets the left margin of an element. - */ - marginLeft?: CSSWideKeyword | any; - - /** - * margin-right sets the right margin of an element. - */ - marginRight?: CSSWideKeyword | any; - - /** - * margin-top sets the top margin of an element. - */ - marginTop?: CSSWideKeyword | any; - - /** - * The marquee-direction determines the initial direction in which the marquee content moves. - */ - marqueeDirection?: CSSWideKeyword | any; - - /** - * The 'marquee-style' property determines a marquee's scrolling behavior. - */ - marqueeStyle?: CSSWideKeyword | any; - - /** - * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. - * Omitted values are set to their original properties' initial values. - */ - mask?: CSSWideKeyword | any; - - /** - * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. - * Omitted values are set to their original properties' initial values. - */ - maskBorder?: CSSWideKeyword | any; - - /** - * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. - * The first keyword applies to the horizontal sides, the second one applies to the vertical ones. - * If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. - */ - maskBorderRepeat?: CSSWideKeyword | any; - - /** - * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, - * dividing it into nine regions: four corners, four edges, and a middle. - * The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. - * The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. - */ - maskBorderSlice?: CSSWideKeyword | any; - - /** - * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. - */ - maskBorderSource?: CSSWideKeyword | any; - - /** - * This property sets the width of the mask box image, similar to the CSS border-image-width property. - */ - maskBorderWidth?: CSSWideKeyword | any; - - /** - * Determines the mask painting area, which defines the area that is affected by the mask. - * The painted content of an element may be restricted to this area. - */ - maskClip?: CSSWideKeyword | any; - - /** - * For elements rendered as a single box, specifies the mask positioning area. - * For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) - * specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). - */ - maskOrigin?: CSSWideKeyword | any; - - /** - * This property must not be used. It is no longer included in any standard or standard track specification, - * nor is it implemented in any browser. It is only used when the text-align-last property is set to size. - * It controls allowed adjustments of font-size to fit line content. - */ - maxFontSize?: CSSWideKeyword | any; - - /** - * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. - * If min-height is specified and is greater than max-height, max-height is overridden. - */ - maxHeight?: CSSWideKeyword | any; - - /** - * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. - */ - maxWidth?: CSSWideKeyword | any; - - /** - * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. - * The value of min-height overrides both max-height and height. - */ - minHeight?: CSSWideKeyword | any; - - /** - * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. - */ - minWidth?: CSSWideKeyword | any; - - /** - * Specifies the transparency of an element. - * See CSS 3 opacity property https://drafts.csswg.org/css-color-3/#opacity - */ - opacity?: CSSWideKeyword | number; - - /** - * Specifies the order used to lay out flex items in their flex container. - * Elements are laid out in the ascending order of the order value. - * See CSS order property https://drafts.csswg.org/css-flexbox-1/#order-property - */ - order?: CSSWideKeyword | number; - - /** - * In paged media, this property defines the minimum number of lines in - * a block container that must be left at the bottom of the page. - * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans - */ - orphans?: CSSWideKeyword | number; - - /** - * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, - * outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. - * Outlines differ from borders in the following ways: - * • Outlines do not take up space, they are drawn above the content. - * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. - * Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. - * Opera draws a non-rectangular shape around a construct. - */ - outline?: CSSWideKeyword | any; - - /** - * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. - */ - outlineColor?: CSSWideKeyword | any; - - /** - * The outline-offset property offsets the outline and draw it beyond the border edge. - */ - outlineOffset?: CSSWideKeyword | any; - - /** - * The overflow property controls how extra content exceeding the bounding box of an element is rendered. - * It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. - */ - overflow?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * Specifies the preferred scrolling methods for elements that overflow. - */ - overflowStyle?: CSSWideKeyword | any; - - /** - * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. - */ - overflowX?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. - */ - overflowY?: CSSWideKeyword | "auto" | "hidden" | "scroll" | "visible"; - - /** - * The padding optional CSS property sets the required padding space on one to four sides of an element. - * The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. - * The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. - * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). - */ - padding?: CSSWideKeyword | any; - - /** - * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-bottom values, negative values of padding-bottom are invalid. - */ - paddingBottom?: CSSWideKeyword | any; - - /** - * The padding-left CSS property of an element sets the padding space required on the left side of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-left values, negative values of padding-left are invalid. - */ - paddingLeft?: CSSWideKeyword | any; - - /** - * The padding-right CSS property of an element sets the padding space required on the right side of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-right values, negative values of padding-right are invalid. - */ - paddingRight?: CSSWideKeyword | any; - - /** - * The padding-top CSS property of an element sets the padding space required on the top of an element. - * The padding area is the space between the content of the element and its border. - * Contrary to margin-top values, negative values of padding-top are invalid. - */ - paddingTop?: CSSWideKeyword | any; - - /** - * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakAfter?: CSSWideKeyword | any; - - /** - * The page-break-before property sets the page-breaking behavior before an element. - * With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakBefore?: CSSWideKeyword | any; - - /** - * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. - * The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakInside?: CSSWideKeyword | any; - - /** - * The pause property determines how long a speech media agent should pause before and after presenting an element. - * It is a shorthand for the pause-before and pause-after properties. - */ - pause?: CSSWideKeyword | any; - - /** - * The pause-after property determines how long a speech media agent should pause after presenting an element. - * It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseAfter?: CSSWideKeyword | any; - - /** - * The pause-before property determines how long a speech media agent should pause before presenting an element. - * It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseBefore?: CSSWideKeyword | any; - - /** - * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. - * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. - * (See Wikipedia for more information about graphical perspective and for related illustrations.) - * The illusion of perspective on a flat surface, such as a computer screen, - * is created by projecting points on the flat surface as they would appear if the flat surface were a window - * through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. - */ - perspective?: CSSWideKeyword | any; - - /** - * The perspective-origin property establishes the origin for the perspective property. - * It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. - * When used with perspective, perspective-origin changes the appearance of an object, - * as if a viewer were looking at it from a different origin. - * An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. - * Thus, the perspective-origin is like a vanishing point. - * The default value of perspective-origin is 50% 50%. - * This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. - * A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. - * A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. - */ - perspectiveOrigin?: CSSWideKeyword | any; - - /** - * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. - */ - pointerEvents?: CSSWideKeyword | any; - - /** - * The position property controls the type of positioning used by an element within its parent elements. - * The effect of the position property depends on a lot of factors, for example the position property of parent elements. - */ - position?: CSSWideKeyword | "static" | "relative" | "absolute" | "fixed" | "sticky"; - - /** - * Obsolete: unsupported. - * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, - * so that its "ink" lines up with the first glyph in the line above and below. - */ - punctuationTrim?: CSSWideKeyword | any; - - /** - * Sets the type of quotation marks for embedded quotations. - */ - quotes?: CSSWideKeyword | any; - - /** - * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, - * or if it displays a fragment of content as if it were flowing into a subsequent region. - */ - regionFragment?: CSSWideKeyword | any; - - /** - * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, - * before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restAfter?: CSSWideKeyword | any; - - /** - * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, - * before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restBefore?: CSSWideKeyword | any; - - /** - * Specifies the position an element in relation to the right side of the containing element. - */ - right?: CSSWideKeyword | any; - - rubyAlign?: CSSWideKeyword | any; - - rubyPosition?: CSSWideKeyword | any; - - /** - * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; - * that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. - */ - shapeImageThreshold?: CSSWideKeyword | any; - - /** - * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. - * See Editor's Draft and CSSWG wiki page on next-level plans - */ - shapeInside?: CSSWideKeyword | any; - - /** - * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points - * that are the shape-margin distance outward perpendicular to each point on the underlying shape. - * For points where a perpendicular direction is not defined (e.g., a triangle corner), - * takes all points on a circle centered at the point and with a radius of the shape-margin distance. - * This property accepts only non-negative values. - */ - shapeMargin?: CSSWideKeyword | any; - - /** - * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. - * The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. - */ - shapeOutside?: CSSWideKeyword | any; - - /** - * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. - */ - speak?: CSSWideKeyword | any; - - /** - * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, - * numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. - */ - speakAs?: CSSWideKeyword | any; - - /** - * SVG: Specifies the opacity of the outline on the current object. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeOpacityProperty - */ - strokeOpacity?: CSSWideKeyword | number; - - /** - * SVG: Specifies the width of the outline on the current object. - * See SVG 1.1 https://www.w3.org/TR/SVG/painting.html#StrokeWidthProperty - */ - strokeWidth?: CSSWideKeyword | CSSPercentage | CSSLength; - - /** - * The tab-size CSS property is used to customise the width of a tab (U+0009) character. - */ - tabSize?: CSSWideKeyword | any; - - /** - * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. - */ - tableLayout?: CSSWideKeyword | any; - - /** - * The text-align CSS property describes how inline content like text is aligned in its parent block element. - * text-align does not control the alignment of block elements itself, only their inline content. - */ - textAlign?: CSSWideKeyword | any; - - /** - * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. - */ - textAlignLast?: CSSWideKeyword | any; - - /** - * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. - * underline and overline decorations are positioned under the text, line-through over it. - */ - textDecoration?: CSSWideKeyword | any; - - /** - * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. - */ - textDecorationColor?: CSSWideKeyword | any; - - /** - * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. - */ - textDecorationLine?: CSSWideKeyword | any; - - textDecorationLineThrough?: CSSWideKeyword | any; - - textDecorationNone?: CSSWideKeyword | any; - - textDecorationOverline?: CSSWideKeyword | any; - - /** - * Specifies what parts of an element’s content are skipped over when applying any text decoration. - */ - textDecorationSkip?: CSSWideKeyword | any; - - /** - * This property specifies the style of the text decoration line drawn on the specified element. - * The intended meaning for the values are the same as those of the border-style-properties. - */ - textDecorationStyle?: CSSWideKeyword | any; - - textDecorationUnderline?: CSSWideKeyword | any; - - /** - * The text-emphasis property will apply special emphasis marks to the elements text. - * Slightly similar to the text-decoration property only that this property can have affect on the line-height. - * It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. - */ - textEmphasis?: CSSWideKeyword | any; - - /** - * The text-emphasis-color property specifies the foreground color of the emphasis marks. - */ - textEmphasisColor?: CSSWideKeyword | any; - - /** - * The text-emphasis-style property applies special emphasis marks to an element's text. - */ - textEmphasisStyle?: CSSWideKeyword | any; - - /** - * This property helps determine an inline box's block-progression dimension, - * derived from the text-height and font-size properties for non-replaced elements, - * the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. - * The block-progression dimension determines the position of the padding, border and margin for the element. - */ - textHeight?: CSSWideKeyword | any; - - /** - * Specifies the amount of space horizontally that should be left on the first line of the text of an element. - * This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. - */ - textIndent?: CSSWideKeyword | any; - - textJustifyTrim?: CSSWideKeyword | any; - - textKashidaSpace?: CSSWideKeyword | any; - - /** - * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. - * (Considered obsolete; use text-decoration instead.) - */ - textLineThrough?: CSSWideKeyword | any; - - /** - * Specifies the line colors for the line-through text decoration. - * (Considered obsolete; use text-decoration-color instead.) - */ - textLineThroughColor?: CSSWideKeyword | any; - - /** - * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. - * (Considered obsolete; use text-decoration-skip instead.) - */ - textLineThroughMode?: CSSWideKeyword | any; - - /** - * Specifies the line style for line-through text decoration. - * (Considered obsolete; use text-decoration-style instead.) - */ - textLineThroughStyle?: CSSWideKeyword | any; - - /** - * Specifies the line width for the line-through text decoration. - */ - textLineThroughWidth?: CSSWideKeyword | any; - - /** - * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. - * It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. - * It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis - */ - textOverflow?: CSSWideKeyword | any; - - /** - * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. - */ - textOverline?: CSSWideKeyword | any; - - /** - * Specifies the line color for the overline text decoration. - */ - textOverlineColor?: CSSWideKeyword | any; - - /** - * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. - */ - textOverlineMode?: CSSWideKeyword | any; - - /** - * Specifies the line style for overline text decoration. - */ - textOverlineStyle?: CSSWideKeyword | any; - - /** - * Specifies the line width for the overline text decoration. - */ - textOverlineWidth?: CSSWideKeyword | any; - - /** - * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. - * Options are: legibility, speed or geometric precision. - */ - textRendering?: CSSWideKeyword | any; - - /** - * Obsolete: unsupported. - */ - textScript?: CSSWideKeyword | any; - - /** - * The CSS text-shadow property applies one or more drop shadows to the text and of an element. - * Each shadow is specified as an offset from the text, along with optional color and blur radius values. - */ - textShadow?: CSSWideKeyword | any; - - /** - * This property transforms text for styling purposes. (It has no effect on the underlying content.) - */ - textTransform?: CSSWideKeyword | any; - - /** - * Unsupported. - * This property will add a underline position value to the element that has an underline defined. - */ - textUnderlinePosition?: CSSWideKeyword | any; - - /** - * After review this should be replaced by text-decoration should it not? - * This property will set the underline style for text with a line value for underline, overline, and line-through. - */ - textUnderlineStyle?: CSSWideKeyword | any; - - /** - * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. - * For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, - * then offset from that position according to these properties). - */ - top?: CSSWideKeyword | any; - - /** - * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. - */ - touchAction?: CSSWideKeyword | any; - - /** - * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. - * Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. - */ - transform?: CSSWideKeyword | any; - - /** - * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. - */ - transformOrigin?: CSSWideKeyword | any; - - /** - * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. - */ - transformOriginZ?: CSSWideKeyword | any; - - /** - * This property specifies how nested elements are rendered in 3D space relative to their parent. - */ - transformStyle?: CSSWideKeyword | any; - - /** - * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, - * and transition-delay. It allows to define the transition between two states of an element. - */ - transition?: CSSWideKeyword | any; - - /** - * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. - * Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. - */ - transitionDelay?: CSSWideKeyword | any; - - /** - * The 'transition-duration' property specifies the length of time a transition animation takes to complete. - */ - transitionDuration?: CSSWideKeyword | any; - - /** - * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. - */ - transitionProperty?: CSSWideKeyword | any; - - /** - * Sets the pace of action within a transition - */ - transitionTimingFunction?: CSSWideKeyword | any; - - /** - * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. - */ - unicodeBidi?: CSSWideKeyword | any; - - /** - * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. - */ - unicodeRange?: CSSWideKeyword | any; - - /** - * This is for all the high level UX stuff. - */ - userFocus?: CSSWideKeyword | any; - - /** - * For inputing user content - */ - userInput?: CSSWideKeyword | any; - - /** - * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. - * If this property is used on table-cells it controls the vertical alignment of content of the table cell. - */ - verticalAlign?: CSSWideKeyword | any; - - /** - * The visibility property specifies whether the boxes generated by an element are rendered. - */ - visibility?: CSSWideKeyword | any; - - /** - * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. - */ - voiceBalance?: CSSWideKeyword | any; - - /** - * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, - * for example to allow the speech to be synchronized with other media. - * With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. - */ - voiceDuration?: CSSWideKeyword | any; - - /** - * The voice-family property sets the speaker's voice used by a speech media agent to read an element. - * The speaker may be specified as a named character (to match a voice option in the speech reading software) - * or as a generic description of the age and gender of the voice. - * Similar to the font-family property for visual media, - * a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name - * or cannot synthesize the requested combination of generic properties. - */ - voiceFamily?: CSSWideKeyword | any; - - /** - * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; - * the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. - */ - voicePitch?: CSSWideKeyword | any; - - /** - * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. - * Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, - * this property determines how strong or obvious those changes are; - * large ranges are associated with enthusiastic or emotional speech, - * while small ranges are associated with flat or mechanical speech. - */ - voiceRange?: CSSWideKeyword | any; - - /** - * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. - */ - voiceRate?: CSSWideKeyword | any; - - /** - * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. - */ - voiceStress?: CSSWideKeyword | any; - - /** - * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. - */ - voiceVolume?: CSSWideKeyword | any; - - /** - * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. - */ - whiteSpace?: CSSWideKeyword | any; - - /** - * Obsolete: unsupported. - */ - whiteSpaceTreatment?: CSSWideKeyword | any; - - /** - * In paged media, this property defines the mimimum number of lines - * that must be left at the top of the second page. - * See CSS 3 orphans, widows properties https://drafts.csswg.org/css-break-3/#widows-orphans - */ - widows?: CSSWideKeyword | number; - - /** - * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. - */ - width?: CSSWideKeyword | any; - - /** - * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. - * A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. - */ - wordBreak?: CSSWideKeyword | any; - - /** - * The word-spacing CSS property specifies the spacing behavior between "words". - */ - wordSpacing?: CSSWideKeyword | any; - - /** - * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. - */ - wordWrap?: CSSWideKeyword | any; - - /** - * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. - */ - wrapFlow?: CSSWideKeyword | any; - - /** - * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. - */ - wrapMargin?: CSSWideKeyword | any; - - /** - * Obsolete and unsupported. Do not use. - * This CSS property controls the text when it reaches the end of the block in which it is enclosed. - */ - wrapOption?: CSSWideKeyword | any; - - /** - * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. - */ - writingMode?: CSSWideKeyword | any; - - /** - * The z-index property specifies the z-order of an element and its descendants. - * When elements overlap, z-order determines which one covers the other. - * See CSS 2 z-index property https://www.w3.org/TR/CSS2/visuren.html#z-index - */ - zIndex?: CSSWideKeyword | "auto" | number; - - /** - * Sets the initial zoom factor of a document defined by @viewport. - * See CSS zoom descriptor https://drafts.csswg.org/css-device-adapt/#zoom-desc - */ - zoom?: CSSWideKeyword | "auto" | number | CSSPercentage; - + export interface CSSProperties extends CSS.Properties { + // The string index signature fallback is needed at least until csstype + // provides SVG CSS properties: https://github.com/frenic/csstype/issues/4 [propertyName: string]: any; } @@ -3108,6 +1579,7 @@ declare namespace React { form?: string; multiple?: boolean; name?: string; + noModule?: boolean; required?: boolean; size?: number; value?: string | string[] | number; diff --git a/types/react/package.json b/types/react/package.json new file mode 100644 index 0000000000..f3be220fbc --- /dev/null +++ b/types/react/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "csstype": "^2.0.0" + } +} diff --git a/types/react/test/tsx.tsx b/types/react/test/tsx.tsx index 7fa151fd29..760a625cfd 100644 --- a/types/react/test/tsx.tsx +++ b/types/react/test/tsx.tsx @@ -89,6 +89,13 @@ const StatelessComponentWithoutProps: React.SFC = (props) => { ; +// Strict Mode +

    + +
    + +
    ; + // Below tests that setState() works properly for both regular and callback modes class SetStateTest extends React.Component<{}, { foo: boolean, bar: boolean }> { handleSomething = () => { @@ -122,3 +129,39 @@ export abstract class SetStateTestForAndedState extends React.Component { + static getDerivedStateFromProps: React.GetDerivedStateFromProps = (nextProps) => { + return { bar: `${nextProps.foo}bar` }; + } + + getSnapshotBeforeUpdate(prevProps: Readonly) { + return { baz: `${prevProps.foo}baz` }; + } + + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot: { baz: string }) { + return; + } + + render() { + return this.state.bar; + } +} + +class ComponentWithLargeState extends React.Component<{}, Record<'a'|'b'|'c', string>> { + static getDerivedStateFromProps: React.GetDerivedStateFromProps<{}, Record<'a'|'b'|'c', string>> = () => { + return { a: 'a' }; + } +} +const AssignedComponentWithLargeState: React.ComponentClass = ComponentWithLargeState; + +const componentWithBadLifecycle = new (class extends React.Component<{}, {}, number> {})({}); +componentWithBadLifecycle.getSnapshotBeforeUpdate = () => { // $ExpectError + return 'number'; +}; +componentWithBadLifecycle.componentDidUpdate = (prevProps: {}, prevState: {}, snapshot?: string) => { // $ExpectError + return; +}; diff --git a/types/redux-promise-middleware/index.d.ts b/types/redux-promise-middleware/index.d.ts index 1317f65ae2..70eea32baa 100644 --- a/types/redux-promise-middleware/index.d.ts +++ b/types/redux-promise-middleware/index.d.ts @@ -5,4 +5,4 @@ import { Middleware } from 'redux'; -export default function promiseMiddleware(config?: { promiseTypeSuffixes?: string[], promiseTypeSeparator?: string }): Middleware; +export default function promiseMiddleware(config?: { promiseTypeSuffixes?: string[], promiseTypeDelimiter?: string }): Middleware; diff --git a/types/rot-js/index.d.ts b/types/rot-js/index.d.ts index e57d243755..44eeab7698 100644 --- a/types/rot-js/index.d.ts +++ b/types/rot-js/index.d.ts @@ -97,25 +97,15 @@ export const VK_PRINTSCREEN: number; export const VK_INSERT: number; /** Del(ete) key. */ export const VK_DELETE: number; -/***/ export const VK_0: number; -/***/ export const VK_1: number; -/***/ export const VK_2: number; -/***/ export const VK_3: number; -/***/ export const VK_4: number; -/***/ export const VK_5: number; -/***/ export const VK_6: number; -/***/ export const VK_7: number; -/***/ export const VK_8: number; -/***/ export const VK_9: number; /** Colon (:) key. Requires Gecko 15.0 */ export const VK_COLON: number; @@ -131,59 +121,32 @@ export const VK_GREATER_THAN: number; export const VK_QUESTION_MARK: number; /** Atmark (@) key. Requires Gecko 15.0 */ export const VK_AT: number; -/***/ export const VK_A: number; -/***/ export const VK_B: number; -/***/ export const VK_C: number; -/***/ export const VK_D: number; -/***/ export const VK_E: number; -/***/ export const VK_F: number; -/***/ export const VK_G: number; -/***/ export const VK_H: number; -/***/ export const VK_I: number; -/***/ export const VK_J: number; -/***/ export const VK_K: number; -/***/ export const VK_L: number; -/***/ export const VK_M: number; -/***/ export const VK_N: number; -/***/ export const VK_O: number; -/***/ export const VK_P: number; -/***/ export const VK_Q: number; -/***/ export const VK_R: number; -/***/ export const VK_S: number; -/***/ export const VK_T: number; -/***/ export const VK_U: number; -/***/ export const VK_V: number; -/***/ export const VK_W: number; -/***/ export const VK_X: number; -/***/ export const VK_Y: number; -/***/ export const VK_Z: number; -/***/ export const VK_CONTEXT_MENU: number; /** 0 on the numeric keypad. */ export const VK_NUMPAD0: number; @@ -209,7 +172,6 @@ export const VK_NUMPAD9: number; export const VK_MULTIPLY: number; /** + on the numeric keypad. */ export const VK_ADD: number; -/***/ export const VK_SEPARATOR: number; /** - on the numeric keypad. */ export const VK_SUBTRACT: number; diff --git a/types/rrule/index.d.ts b/types/rrule/index.d.ts deleted file mode 100644 index f13aefb9c9..0000000000 --- a/types/rrule/index.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -// Type definitions for rrule 2.1 -// Project: https://github.com/jkbrzt/rrule -// Definitions by: James Bracy -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -export as namespace RRule; - -/** - * Use `import rrule = require("rrule")` for AMD and `import { RRule } from "rrule"` for CommonJS loading. - */ -export = RRule; - -// For CommonJS it must be imported as `require("rrule").RRule`. -import RRuleAlias = RRule; -declare module "rrule" { - type RRule = RRuleAlias; - const RRule: typeof RRuleAlias; -} - -declare namespace RRule { - /** - * see - * The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ... - */ - interface Options { - freq: RRule.Frequency; - dtstart?: Date; - interval?: number; - wkst?: number | Weekday; - count?: number; - until?: Date; - bysetpos?: number | number[]; - bymonth?: number | number[]; - bymonthday?: number | number[]; - byyearday?: number | number[]; - byweekno?: number | number[]; - byweekday?: Weekday | Weekday[] | number | number[]; - byhour?: number | number[]; - byminute?: number | number[]; - bysecond?: number | number[]; - } - - class Weekday { - constructor(weekday: number, n: number); - - nth(n: number): Weekday; - - equals(other: Weekday): boolean; - - toString(): string; - - getJsWeekday(): number; - } -} - -declare class RRule { - /** - * @param options - see - * The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ... - */ - constructor(options: RRule.Options, noCache?: boolean); - - options: RRule.Options; - - origOptions: RRule.Options; - - /** - * Returns the first recurrence after the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - after(dt: Date, inc?: boolean): Date; - - /** - * @param iterator - optional function that will be called - * on each date that is added. It can return false - * to stop the iteration. - * @return Array containing all recurrences. - */ - all(iterator?: (date: Date, index?: number) => void): Date[]; - - /** - * Returns all the occurrences of the rrule between after and before. - * The inc keyword defines what happens if after and/or before are - * themselves occurrences. With inc == True, they will be included in the - * list, if they are found in the recurrence set. - * @return Array - */ - between(a: Date, b: Date, inc?: boolean, iterator?: (date: Date, index: number) => void): Date[]; - - /** - * Returns the last recurrence before the given datetime instance. - * The inc keyword defines what happens if dt is an occurrence. - * With inc == True, if dt itself is an occurrence, it will be returned. - * @return Date or null - */ - before(dt: Date, inc?: boolean): Date; - - /** - * Returns the number of recurrences in this set. It will have go trough - * the whole recurrence, if this hasn't been done before. - */ - count(): number; - - /** - * Converts the rrule into its string representation - * @see - * @return String - */ - toString(): string; - - /** - * Will convert all rules described in nlp:ToText - * to text. - */ - toText(gettext?: (str: string) => string, language?: any): string; - - isFullyConvertibleToText(): boolean; - - clone(): RRule; -} - -declare namespace RRule { - const FREQUENCIES: "YEARLY" | "MONTHLY" | "WEEKLY" | "DAILY" | "HOURLY" | "MINUTELY" | "SECONDLY"; - - enum Frequency { - YEARLY = 0, - MONTHLY = 1, - WEEKLY = 2, - DAILY = 3, - HOURLY = 4, - MINUTELY = 5, - SECONDLY = 6 - } - - const YEARLY: Frequency; - const MONTHLY: Frequency; - const WEEKLY: Frequency; - const DAILY: Frequency; - const HOURLY: Frequency; - const MINUTELY: Frequency; - const SECONDLY: Frequency; - - const MO: Weekday; - const TU: Weekday; - const WE: Weekday; - const TH: Weekday; - const FR: Weekday; - const SA: Weekday; - const SU: Weekday; - - const DEFAULT_OPTIONS: RRule.Options; - - function parseText(text: string, language?: any): RRule.Options; - - function fromText(text: string, language?: any): RRule; - - function optionsToString(options: RRule.Options): string; - - function parseString(rfcString: string): RRule.Options; - - function fromString(value: string): RRule; - - class RRuleSet extends RRule { - /** - * @param noCache The same stratagy as RRule on cache, default to false - */ - constructor(noCache?: boolean); - rrule(rrule: RRule): void; - rdate(date: Date): void; - exrule(rrule: RRule): void; - exdate(date: Date): void; - valueOf(): string[]; - /** - * to generate recurrence field sush as: - * ["RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU;DTSTART=19970902T010000Z","RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH;DTSTART=19970902T010000Z"] - */ - toString(): string; - /** - * Create a new RRuleSet Object completely base on current instance - */ - clone(): RRuleSet; - } -} diff --git a/types/rrule/test/commonJs.ts b/types/rrule/test/commonJs.ts deleted file mode 100644 index f193febe91..0000000000 --- a/types/rrule/test/commonJs.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { RRule } from "rrule"; -const rule: RRule = new RRule({ freq: RRule.WEEKLY }); diff --git a/types/rrule/test/global.ts b/types/rrule/test/global.ts deleted file mode 100644 index 869d407e98..0000000000 --- a/types/rrule/test/global.ts +++ /dev/null @@ -1 +0,0 @@ -let rule: RRule = new RRule({ freq: RRule.WEEKLY }); diff --git a/types/rrule/test/rrule.ts b/types/rrule/test/rrule.ts deleted file mode 100644 index c455fa40d1..0000000000 --- a/types/rrule/test/rrule.ts +++ /dev/null @@ -1,62 +0,0 @@ -import RRule = require('rrule'); - -// Create a rule: -let rule: RRule = new RRule({ - freq: RRule.WEEKLY, - interval: 5, - byweekday: [RRule.MO, RRule.FR], - dtstart: new Date(2012, 1, 1, 10, 30), - until: new Date(2012, 12, 31) -}); - -let x: Date[]; -const y: string[] = []; - -// Get all occurrence dates (Date instances): -x = rule.all(); - -// Get a slice: -x = rule.between(new Date(2012, 7, 1), new Date(2012, 8, 1)); - -// Get an iCalendar RRULE string representation: -// The output can be used with RRule.fromString(). -y.push(rule.toString()); - -// Get a human-friendly text representation: -// The output can be used with RRule.fromText(). -y.push(rule.toText()); - -// Get full a string representation of all options, -// including the default and inferred ones. -y.push(RRule.optionsToString(rule.options)); - -// Cherry-pick only some options from an rrule: -y.push(RRule.optionsToString({ - freq: rule.options.freq, - dtstart: rule.options.dtstart, -})); - -rule = RRule.fromString("FREQ=WEEKLY;DTSTART=20120201T093000Z"); - -// This is equivalent -rule = new RRule(RRule.parseString("FREQ=WEEKLY;DTSTART=20120201T093000Z")); - -let options = RRule.parseString('FREQ=DAILY;INTERVAL=6'); -options.dtstart = new Date(2000, 1, 1); -rule = new RRule(options); - -rule = new RRule({ - freq: RRule.WEEKLY, - count: 23 -}); -y.push(rule.toText()); - -rule = RRule.fromText('every day for 3 times'); - -options = RRule.parseText('every day for 3 times'); -// {freq: 3, count: "3"} -options.dtstart = new Date(2000, 1, 1); -rule = new RRule(options); - -// Test arrays -const multipleInstance = new RRule({freq: 3, byhour: [6, 12, 18]}); diff --git a/types/rrule/tslint.json b/types/rrule/tslint.json deleted file mode 100644 index 96de5e929b..0000000000 --- a/types/rrule/tslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - // TODOs - "no-declare-current-package": false, - "no-mergeable-namespace": false, - "no-unnecessary-qualifier": false - } -} diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 3f04a52414..244840f76e 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -89,6 +89,9 @@ interface Select2Options { dropdownParent?: JQuery; debug?: boolean; dropdownAdapter?: any; + selectionAdapter?: any; + resultsAdapter?: any; + dataAdapter?: any; } interface Select2JQueryEventObject extends JQueryEventObject { diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 09af63c2ec..d20bd83b86 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1200,7 +1200,7 @@ declare namespace sequelize { * Attribute name for the relation */ name?: string; - + unique?: boolean | string; } /** @@ -4046,7 +4046,7 @@ declare namespace sequelize { * elements. The first element is always the number of affected rows, while the second element is the actual * affected rows (only supported in postgres with `options.returning` true.) */ - update(values: TAttributes, options: UpdateOptions): Promise<[number, TInstance[]]>; + update(values: TAttributes, options?: UpdateOptions): Promise<[number, TInstance[]]>; /** * Run a describe query on the table. The result will be return to the listener as a hash of attributes and diff --git a/types/sinon/index.d.ts b/types/sinon/index.d.ts index dda76478c8..2395ee2ed2 100644 --- a/types/sinon/index.d.ts +++ b/types/sinon/index.d.ts @@ -234,10 +234,15 @@ declare namespace Sinon { setSystemTime(date: Date): void; } + interface SinonFakeTimersConfig { + now: number | Date; + toFake: string[]; + shouldAdvanceTime: boolean; + } + interface SinonFakeTimersStatic { - (): SinonFakeTimers; - (...timers: string[]): SinonFakeTimers; - (now: number, ...timers: string[]): SinonFakeTimers; + (now?: number | Date): SinonFakeTimers; + (config?: Partial): SinonFakeTimers; } interface SinonStatic { diff --git a/types/sinon/sinon-tests.ts b/types/sinon/sinon-tests.ts index 702af56820..17e8cc6084 100644 --- a/types/sinon/sinon-tests.ts +++ b/types/sinon/sinon-tests.ts @@ -138,6 +138,10 @@ function testSandbox() { sandbox.mock(objectUnderTest).expects("process").once(); } sandbox.useFakeTimers(); + sandbox.useFakeTimers({ + now: 1, + toFake: ['Date'] + }); sandbox.useFakeXMLHttpRequest(); sandbox.useFakeServer(); sandbox.restore(); 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 { /** diff --git a/types/sql-bricks/index.d.ts b/types/sql-bricks/index.d.ts new file mode 100644 index 0000000000..ccc7e523a7 --- /dev/null +++ b/types/sql-bricks/index.d.ts @@ -0,0 +1,409 @@ +// 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: 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[]): SelectStatement + + as(alias: string): 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). + * @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 | null, value?: any): SelectStatement + where(...whereExpr: WhereExpression[]): SelectStatement + + and(...options: any[]): 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(...columns: Array): SelectStatement + select(columns: string[] | SelectStatement[]): SelectStatement + values(...values: any[]): InsertStatement + } + + /** + * An UPDATE statement + */ + interface UpdateStatement extends Statement { + 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: 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 + } +} + +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): 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: any[]): 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: 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: Array): SqlBricks.SelectStatement + select(columns: string[] | SqlBricks.SelectStatement[]): 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: any[]): 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: any[]) => 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: any, value2: any): SqlBricks.WhereExpression + isNull(column: string): SqlBricks.WhereExpression + isNotNull(column: string): 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: 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?: 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?: 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?: 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?: 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 +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..effc01eca3 --- /dev/null +++ b/types/sql-bricks/sql-bricks-tests.ts @@ -0,0 +1,949 @@ +// 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 sql = require("sql-bricks"); + +// tslint:disable-next-line:prefer-const +let assert: any; +const select = sql.select; +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: sql.OnCriteria = alias_expansions; +sql.aliasExpansions(alias_expansions); + +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; +}); + +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: 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'); + }); + }); + }); + + 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: sql.OnCriteria) { + // 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: sql.WhereObject) { + const where = and(); + for (const col in criteria) { + const val = criteria[col]; + 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; + } + + 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: 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 new file mode 100644 index 0000000000..4b321fc911 --- /dev/null +++ b/types/sql-bricks/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", + "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..4ddaadda1f --- /dev/null +++ b/types/sql-bricks/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "only-arrow-functions": false, + "semicolon":false + } +} \ No newline at end of file diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 361ee4c86b..c43e3357a5 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 { @@ -4556,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 1e7b47a3c7..7a45ee9fca 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -252,14 +252,14 @@ 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) { 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) { }); 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) { diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index 1f1957b7c8..2487b117b1 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. */ 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; -} - -declare class CoverFlowImageType { - height : number; - image : any; - width : number; -} - -declare class BroadcastIntentOptions { - action : string; - className : string; - data : string; - flags : number; - packageName : string; - url : string; -} - -declare class CloudUsersSecureResponse extends CloudResponse { - accessToken : string; - expiresIn : number; -} - -declare class CloudClientsResponse extends CloudResponse { - ip_address : string; - location : Dictionary; -} - -declare class PushNotificationErrorArg { - type : string; -} - -declare class CloudStatusesResponse extends CloudResponse { - statuses : Array>; -} - -declare class windowToolbarParam { - animated : boolean; - barColor : string; - tintColor : string; - translucent : boolean; -} - -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; -} +/** + * 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; + +} + +/** + * 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; + + /** + * 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[]; + +} + +/** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + + /** + * 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; + +} + +/** + * 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 } } diff --git a/types/uglify-js/index.d.ts b/types/uglify-js/index.d.ts index cab53cb4db..eca756bd53 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 { @@ -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'); +} diff --git a/types/victory/victory-tests.tsx b/types/victory/victory-tests.tsx index 43673d8f32..aa21609ff5 100644 --- a/types/victory/victory-tests.tsx +++ b/types/victory/victory-tests.tsx @@ -30,7 +30,7 @@ let test = {}} > {(style: AnimationStyle) => - Hello! + Hello! } diff --git a/types/vimeo__player/index.d.ts b/types/vimeo__player/index.d.ts index c2699d15d2..d5f224975e 100755 --- a/types/vimeo__player/index.d.ts +++ b/types/vimeo__player/index.d.ts @@ -25,7 +25,7 @@ export interface TypeError extends Error {name: "TypeError"; message: string; me export type EventName = "play" | "pause" | "ended" | "timeupdate" | "progress" | "seeked" | "texttrackchange" | "cuechange" | "cuepoint" | "volumechange" | "error" | "loaded" | string; export type EventCallback = (data: any) => any; -export default class Player { +export class Player { constructor(element: HTMLIFrameElement|HTMLElement|string, options: Options); on(event: EventName, callback: EventCallback): void; @@ -60,6 +60,7 @@ export default class Player { getVideoUrl(): VimeoPromise; getVolume(): VimeoPromise; setVolume(volume: number): VimeoPromise; + destroy(): VimeoPromise; } export interface VimeoCuePoint { @@ -105,3 +106,4 @@ export interface VimeoPromise extends Promise { /*~ You can declare properties of the module using const, let, or var */ export const playerMap: WeakMap; export const readyMap: WeakMap; +export default Player; diff --git a/types/vis/index.d.ts b/types/vis/index.d.ts index c0b33b27aa..44ab171de4 100644 --- a/types/vis/index.d.ts +++ b/types/vis/index.d.ts @@ -1861,7 +1861,7 @@ export interface EdgeOptions { enabled?: boolean, scaleFactor?: number, }, - from: boolean | { + from?: boolean | { enabled?: boolean, scaleFactor?: number, } 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')); diff --git a/types/winston/index.d.ts b/types/winston/index.d.ts index df360f1e01..dd6ab0e1aa 100644 --- a/types/winston/index.d.ts +++ b/types/winston/index.d.ts @@ -272,7 +272,7 @@ declare namespace winston { interface ConsoleTransportInstance extends TransportInstance { json: boolean; - colorize: boolean; + colorize: boolean | 'all' | 'level' | 'message'; prettyPrint: boolean; timestamp: boolean | (() => string | boolean); showLevel: boolean; @@ -294,7 +294,7 @@ declare namespace winston { interface FileTransportInstance extends TransportInstance { json: boolean; logstash: boolean; - colorize: boolean; + colorize: boolean | 'all' | 'level' | 'message'; maxsize: number|null; rotationFormat: boolean; zippedArchive: boolean; @@ -330,7 +330,7 @@ declare namespace winston { writeOutput: GenericTextTransportOptions[]; json: boolean; - colorize: boolean; + colorize: boolean | 'all' | 'level' | 'message'; prettyPrint: boolean; timestamp: boolean | (() => string | boolean); showLevel: boolean; @@ -390,7 +390,7 @@ declare namespace winston { interface GenericTextTransportOptions { json?: boolean; - colorize?: boolean; + colorize?: boolean | 'all' | 'level' | 'message'; colors?: any; prettyPrint?: boolean; showLevel?: boolean; diff --git a/types/yeoman-generator/index.d.ts b/types/yeoman-generator/index.d.ts index 9db6a70946..c4a13695fb 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; diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index c8c3f2dda4..93a60450e7 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -51,7 +51,7 @@ export interface Schema { oneOf(arrayOfValues: any[], message?: string): this; notOneOf(arrayOfValues: any[], message?: string): this; when(keys: string | any[], builder: WhenOptions): this; - test(name: string, message: string, test: (value?: any) => boolean, callbackStyleAsync?: boolean): this; + test(name: string, message: string, test: (value?: any) => boolean | Promise, callbackStyleAsync?: boolean): this; test(options: TestOptions): this; transform(fn: TransformFunction): this; } @@ -190,7 +190,7 @@ export interface TestOptions { /** * Test function, determines schema validity */ - test: (value: any) => boolean; + test: (value: any) => boolean | Promise; /** * The validation error message diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index 0c0aa04c47..83e17abe3e 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -123,6 +123,7 @@ mixed.test({ message: '${path} must be less than 5 characters', test: value => value == null || value.length <= 5 }); +mixed.test('with-promise', 'It contains invalid value', value => new Promise(resolve => true)); yup.string().transform(function(this, value: any, originalvalue: any) { return this.isType(value) && value !== null ? value.toUpperCase() : value; @@ -252,6 +253,14 @@ const testOptions: TestOptions = { exclusive: true }; +const testOptionsWithPromise: TestOptions = { + name: 'name', + test: value => new Promise(resolve => true), + message: 'validation error message', + params: { param1: 'value'}, + exclusive: true +}; + const validateOptions: ValidateOptions = { strict: true, abortEarly: true,