diff --git a/auth0.lock/auth0.lock-tests.ts b/auth0.lock/auth0.lock-tests.ts new file mode 100644 index 0000000000..fd646ee1bb --- /dev/null +++ b/auth0.lock/auth0.lock-tests.ts @@ -0,0 +1,13 @@ +/// +/// + +var lock: Auth0LockStatic = new Auth0Lock("dsa7d77dsa7d7", "mine.auth0.com"); + +lock.showSignin({ + connections: ["facebook", "google-oauth2", "twitter", "Username-Password-Authentication"], + icon: "https://contoso.com/logo-32.png", + socialBigButtons: true + }, + () => { + // The Auth0 Widget is now loaded. +}); diff --git a/auth0.lock/auth0.lock.d.ts b/auth0.lock/auth0.lock.d.ts new file mode 100644 index 0000000000..e8ba3cb996 --- /dev/null +++ b/auth0.lock/auth0.lock.d.ts @@ -0,0 +1,80 @@ +// Type definitions for Auth0Widget.js +// Project: http://auth0.com +// Definitions by: Robert McLaws +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface Auth0LockPopupOptions { + width: number; + height: number; + left: number; + top: number; +} + +interface Auth0LockOptions { + authParams?: any; + callbackURL?: string; + connections?: string[]; + container?: string; + closable?: boolean; + dict?: any; + defaultUserPasswordConnection?: string; + defaultADUsernameFromEmailPrefix?: boolean; + disableResetAction?: boolean; + disableSignupAction?: boolean; + focusInput?: boolean; + forceJSONP?: boolean; + gravatar?: boolean; + integratedWindowsLogin?: boolean; + loginAfterSignup?: boolean; + popup?: boolean; + popupOptions?: Auth0LockPopupOptions; + rememberLastLogin?: boolean; + resetLink?: string; + responseType?: string; + signupLink?: string; + socialBigButtons?: boolean; + sso?: boolean; + theme?: string; + usernameStyle?: any; +} + +interface Auth0LockConstructorOptions { + cdn?: string; + assetsUrl?: string; + useCordovaSocialPlugins?: boolean; +} + +interface Auth0LockStatic { + new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic; + + show(): void; + show(options: Auth0LockOptions): void; + show(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void; + show(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void; + + showSignin(): void; + showSignin(options: Auth0LockOptions): void; + showSignin(callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void; + showSignin(options: Auth0LockOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, token?: string) => void) : void; + + showSignup(): void; + showSignup(options: Auth0LockOptions): void; + showSignup(callback: (error?: Auth0Error) => void) : void; + showSignup(options: Auth0LockOptions, callback: (error?: Auth0Error) => void) : void; + + showReset(): void; + showReset(options: Auth0LockOptions): void; + showReset(callback: (error?: Auth0Error) => void) : void; + showReset(options: Auth0LockOptions, callback: (error?: Auth0Error) => void) : void; + + hide(callback: () => void): void; + logout(callback: () => void): void; +} + +declare var Auth0Lock: Auth0LockStatic; + +declare module "Auth0Lock" { + export = Auth0Lock; +} diff --git a/cordova-ionic/cordova-ionic.d.ts b/cordova-ionic/cordova-ionic.d.ts index c9b1e635b3..5f0adee3ec 100644 --- a/cordova-ionic/cordova-ionic.d.ts +++ b/cordova-ionic/cordova-ionic.d.ts @@ -5,10 +5,6 @@ /// -interface Cordova { - plugins:Plugins; -} - -interface Plugins { +interface CordovaPlugins { Keyboard:Ionic.Keyboard; } diff --git a/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts b/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts new file mode 100644 index 0000000000..ccd1e725d4 --- /dev/null +++ b/cordova-plugin-email-composer/cordova-plugin-email-composer-tests.ts @@ -0,0 +1,19 @@ +/// +/// + +cordova.plugins.email.isAvailable((isAvailable) => {}, {}); +cordova.plugins.email.open({ + to: ['foo@bar.com'], + body: 'foo bar' +}); +cordova.plugins.email.open(); +cordova.plugins.email.open({}, () => {}); +cordova.plugins.email.open({}, () => {}, {}); + +cordova.plugins.email.openDraft({ + to: ['foo@bar.com'], + body: 'foo bar' +}); +cordova.plugins.email.openDraft(); +cordova.plugins.email.openDraft({}, () => {}); +cordova.plugins.email.openDraft({}, () => {}, {}); diff --git a/cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts b/cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts new file mode 100644 index 0000000000..9472ccf356 --- /dev/null +++ b/cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts @@ -0,0 +1,33 @@ +// Type definitions for Apache Cordova Email Composer plugin +// Project: https://github.com/katzer/cordova-plugin-email-composer +// Definitions by: Dave Taylor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * The plugin provides access to the standard interface that manages the + * editing and sending an email message + */ +interface CordovaPluginEmailComposer { + /** Determine if the device is capable to send emails */ + isAvailable(callback:(isAvailable:boolean) => void, scope?:any):void; + /** Open a pre-filled email draft */ + open(options?:ICordovaPluginEmailComposerOpenOptions, callback?:() => void, scope?:any):void; + openDraft(options?:ICordovaPluginEmailComposerOpenOptions, callback?:() => void, scope?:any):void; +} + +interface ICordovaPluginEmailComposerOpenOptions { + /** An configured email account is required to send emails */ + to?:string[]; + body?:string; + cc?:string[]; + bcc?:string[]; + /** Attachments can be either base64 encoded datas, files from the the device storage or assets from within the www folder */ + attachments?:any[]; + subject?:string; + /** The default value for isHTML is true */ + isHtml?:boolean; +} + +interface CordovaPlugins { + email:CordovaPluginEmailComposer; +} diff --git a/cordova/cordova.d.ts b/cordova/cordova.d.ts index 75b77ebe2c..32ef0a76b6 100644 --- a/cordova/cordova.d.ts +++ b/cordova/cordova.d.ts @@ -43,8 +43,12 @@ interface Cordova { define(moduleName: string, factory: (require: any, exports: any, module: any) => any): void; /** Access a Cordova module by name. */ require(moduleName: string): any; + /** Namespace for Cordova plugin functionality */ + plugins:CordovaPlugins; } +interface CordovaPlugins {} + interface Document { addEventListener(type: "deviceready", listener: (ev: Event) => any, useCapture?: boolean): void; addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index 51c51f608f..a846dbfa85 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -476,7 +476,7 @@ function callenderView() { .style("text-anchor", "middle") .text(function (d) { return d; }); - var rect = svg.selectAll(".day") + var rect: D3.UpdateSelection = svg.selectAll(".day") .data(function (d) { return d3.time.days(new Date(d, 0, 1), new Date(d + 1, 0, 1)); }) .enter().append("rect") .attr("class", "day") @@ -960,7 +960,7 @@ function forcedBasedLabelPlacemant() { var anchorLink = vis.selectAll("line.anchorLink").data(labelAnchorLinks)//.enter().append("svg:line").attr("class", "anchorLink").style("stroke", "#999"); - var anchorNode = vis.selectAll("g.anchorNode").data(force2.nodes()).enter().append("svg:g").attr("class", "anchorNode"); + var anchorNode: D3.Selection = vis.selectAll("g.anchorNode").data(force2.nodes()).enter().append("svg:g").attr("class", "anchorNode"); anchorNode.append("svg:circle").attr("r", 0).style("fill", "#FFF"); anchorNode.append("svg:text").text(function (d, i) { return i % 2 == 0 ? "" : d.node.label @@ -1404,7 +1404,7 @@ function quadtree() { .attr("width", function (d) { return d.width; } ) .attr("height", function (d) { return d.height; } ); - var point = svg.selectAll(".point") + var point: D3.Selection = svg.selectAll(".point") .data(data) .enter().append("circle") .attr("class", "point") diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 57e817818d..b00d808ee8 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -12,19 +12,19 @@ declare module D3 { /** * Returns the empty selection */ - (): Selection; + (): _Selection; /** * Selects the first element that matches the specified selector string * * @param selector Selection String to match */ - (selector: string): Selection; + (selector: string): _Selection; /** * Selects the specified node * * @param element Node element to select */ - (element: EventTarget): Selection; + (element: EventTarget): _Selection; }; /** @@ -36,13 +36,13 @@ declare module D3 { * * @param selector Selection String to match */ - (selector: string): Selection; + (selector: string): _Selection; /** * Selects the specified array of elements * * @param elements Array of node elements to select */ - (elements: EventTarget[]): Selection; + (elements: EventTarget[]): _Selection; }; } @@ -458,7 +458,7 @@ declare module D3 { /** * Returns the root selection */ - selection(): Selection; + selection(): _Selection; ns: { /** * The map of registered namespace prefixes @@ -726,56 +726,56 @@ declare module D3 { format(rows: any[]): string; } - export interface Selection extends Selectors, Array { + export interface _Selection extends Selectors, Array { attr: { (name: string): string; - (name: string, value: any): Selection; - (name: string, valueFunction: (data: any, index: number) => any): Selection; - (attrValueMap : Object): Selection; + (name: string, value: any): _Selection; + (name: string, valueFunction: (data: T, index: number) => any): _Selection; + (attrValueMap: Object): _Selection; }; classed: { (name: string): boolean; - (name: string, value: any): Selection; - (name: string, valueFunction: (data: any, index: number) => any): Selection; - (classValueMap: Object): Selection; + (name: string, value: any): _Selection; + (name: string, valueFunction: (data: T, index: number) => any): _Selection; + (classValueMap: Object): _Selection; }; style: { (name: string): string; - (name: string, value: any, priority?: string): Selection; - (name: string, valueFunction: (data: any, index: number) => any, priority?: string): Selection; - (styleValueMap : Object): Selection; + (name: string, value: any, priority?: string): _Selection; + (name: string, valueFunction: (data: T, index: number) => any, priority?: string): _Selection; + (styleValueMap: Object): _Selection; }; property: { (name: string): void; - (name: string, value: any): Selection; - (name: string, valueFunction: (data: any, index: number) => any): Selection; - (propertyValueMap : Object): Selection; + (name: string, value: any): _Selection; + (name: string, valueFunction: (data: T, index: number) => any): _Selection; + (propertyValueMap: Object): _Selection; }; text: { (): string; - (value: any): Selection; - (valueFunction: (data: any, index: number) => any): Selection; + (value: any): _Selection; + (valueFunction: (data: T, index: number) => any): _Selection; }; html: { (): string; - (value: any): Selection; - (valueFunction: (data: any, index: number) => any): Selection; + (value: any): _Selection; + (valueFunction: (data: T, index: number) => any): _Selection; }; - append: (name: string) => Selection; - insert: (name: string, before: string) => Selection; - remove: () => Selection; + append: (name: string) => _Selection; + insert: (name: string, before: string) => _Selection; + remove: () => _Selection; empty: () => boolean; data: { - (values: (data: any, index?: number) => any[], key?: (data: any, index?: number) => any): UpdateSelection; - (values: any[], key?: (data: any, index?: number) => any): UpdateSelection; - (): any[]; + (values: (data: T, index?: number) => U[], key?: (data: U, index?: number) => any): _UpdateSelection; + (values: U[], key?: (data: U, index?: number) => any): _UpdateSelection; + (): T[]; }; datum: { @@ -789,36 +789,31 @@ declare module D3 { * element. The function is then used to set each element's data. A null value will * delete the bound data. This operator has no effect on the index. */ - (values: (data: any, index: number) => any): UpdateSelection; + (values: (data: U, index: number) => any): _UpdateSelection; /** * Sets the element's bound data to the specified value on all selected elements. * Unlike the D3.Selection.data method, this method does not compute a join (and thus * does not compute enter and exit selections). * @param values The same data to be given to all elements. */ - (values: any): UpdateSelection; + (values: U): _UpdateSelection; /** * Returns the bound datum for the first non-null element in the selection. * This is generally useful only if you know the selection contains exactly one element. */ - (): any; - /** - * Returns the bound datum for the first non-null element in the selection. - * This is generally useful only if you know the selection contains exactly one element. - */ - (): T; + (): T; }; filter: { - (filter: (data: any, index: number) => boolean, thisArg?: any): UpdateSelection; - (filter: string): UpdateSelection; + (filter: (data: T, index: number) => boolean, thisArg?: any): _UpdateSelection; + (filter: string): _UpdateSelection; }; - call(callback: (selection: Selection, ...args: any[]) => void, ...args: any[]): Selection; - each(eachFunction: (data: any, index: number) => any): Selection; + call(callback: (selection: _Selection, ...args: any[]) => void, ...args: any[]): _Selection; + each(eachFunction: (data: T, index: number) => any): _Selection; on: { (type: string): (data: any, index: number) => any; - (type: string, listener: (data: any, index: number) => any, capture?: boolean): Selection; + (type: string, listener: (data: any, index: number) => any, capture?: boolean): _Selection; }; /** @@ -840,38 +835,44 @@ declare module D3 { * to compare, and should return either a negative, positive, or zero value to indicate * their relative order. */ - sort(comparator?: (a: T, b: T) => number): Selection; + sort(comparator?: (a: T, b: T) => number): _Selection; /** * Re-inserts elements into the document such that the document order matches the selection * order. This is equivalent to calling sort() if the data is already sorted, but much * faster. */ - order: () => Selection; + order: () => _Selection; /** * Returns the first non-null element in the current selection. If the selection is empty, * returns null. */ - node: () => T; + node: () => E; } - export interface EnterSelection { - append: (name: string) => Selection; - insert: (name: string, before?: string) => Selection; - select: (selector: string) => Selection; + export interface Selection extends _Selection { } + + export interface _EnterSelection { + append: (name: string) => _Selection; + insert: (name: string, before?: string) => _Selection; + select: (selector: string) => _Selection; empty: () => boolean; node: () => Element; - call: (callback: (selection: EnterSelection) => void) => EnterSelection; + call: (callback: (selection: _EnterSelection) => void) => _EnterSelection; size: () => number; } - export interface UpdateSelection extends Selection { - enter: () => EnterSelection; - update: () => Selection; - exit: () => Selection; + export interface EnterSelection extends _EnterSelection { } + + export interface _UpdateSelection extends _Selection { + enter: () => _EnterSelection; + update: () => _Selection; + exit: () => _Selection; } + export interface UpdateSelection extends _UpdateSelection { } + export interface NestKeyValue { key: string; values: any; @@ -1279,6 +1280,13 @@ declare module D3 { (angle: (d : any) => number): PieLayout (angle: (d : any, i: number) => number): PieLayout; }; + padAngle: { + (): number; + (angle: number): PieLayout; + (angle: () => number): PieLayout; + (angle: (d : any) => number): PieLayout + (angle: (d : any, i: number) => number): PieLayout; + }; } export interface ArcDescriptor { @@ -1727,14 +1735,14 @@ declare module D3 { export interface Symbol { type: (symbolType: string | ((datum: any, index: number) => string)) => Symbol; size: (size: number | ((datum: any, index: number) => number)) => Symbol; - (datum:any, index:number): string; + (datum?: any, index?: number): string; } export interface Brush { /** * Draws or redraws this brush into the specified selection of elements */ - (selection: Selection): void; + (selection: _Selection): void; /** * Gets or sets the x-scale associated with the brush */ @@ -1802,7 +1810,7 @@ declare module D3 { } export interface Axis { - (selection: Selection): void; + (selection: _Selection): void; (transition: Transition.Transition): void; scale: { @@ -2775,7 +2783,7 @@ declare module D3 { * registering the necessary event listeners to support * panning and zooming. */ - (selection: Selection): void; + (selection: _Selection): void; /** * Registers a listener to receive events diff --git a/errorhandler/errorhandler.d.ts b/errorhandler/errorhandler.d.ts index 31bf44ce11..40f845d098 100644 --- a/errorhandler/errorhandler.d.ts +++ b/errorhandler/errorhandler.d.ts @@ -7,6 +7,6 @@ declare module "errorhandler" { import express = require('express'); - function e(): express.ErrorRequestHandler; + function e(options?: {log?: any}): express.ErrorRequestHandler; export = e; -} \ No newline at end of file +} diff --git a/formidable/formidable.d.ts b/formidable/formidable.d.ts index ba0ed81228..d1cbb16f6d 100644 --- a/formidable/formidable.d.ts +++ b/formidable/formidable.d.ts @@ -25,7 +25,7 @@ declare module "formidable" { onPart: (part: Part) => void; handlePart(part: Part): void; - parse(req: http.ServerRequest, callback?: (err: any, fields: Fields, files: Files) => any): void; + parse(req: http.IncomingMessage, callback?: (err: any, fields: Fields, files: Files) => any): void; } export interface Fields { diff --git a/imgur-rest-api/imgur-rest-api-tests.ts b/imgur-rest-api/imgur-rest-api-tests.ts new file mode 100644 index 0000000000..247885557d --- /dev/null +++ b/imgur-rest-api/imgur-rest-api-tests.ts @@ -0,0 +1,103 @@ +/// + +function testAccount(account: ImgurRestApi.Account) : ImgurRestApi.Account { + return account; +} + +function testAccountSettings(accountSettings: ImgurRestApi.AccountSettings) : ImgurRestApi.AccountSettings { + return accountSettings; +} + +function testAlbum(album: ImgurRestApi.Album) : ImgurRestApi.Album { + return album; +} + +function testAlbumImages(album: ImgurRestApi.Album) : ImgurRestApi.Image { + return album.images[0]; +} + +function testComment(comment: ImgurRestApi.Comment) : ImgurRestApi.Comment { + return comment; +} + +function testConversation(conversation: ImgurRestApi.Conversation) : ImgurRestApi.Conversation { + return conversation; +} + +function testCustomGallery(customGallery: ImgurRestApi.CustomGallery) : ImgurRestApi.CustomGallery { + return customGallery; +} + +function testGalleryItem(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryItem { + return galleryItem; +} + +function testGalleryAlbum(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryAlbum { + if(galleryItem.is_album) { + var galleryAlbum = galleryItem; + return galleryAlbum; + } + return null; +} + +function testGalleryImage(galleryItem: ImgurRestApi.GalleryItem) : ImgurRestApi.GalleryImage { + if(!galleryItem.is_album) { + var galleryImage = galleryItem; + return galleryImage; + } + return null; +} + +function testGalleryProfile(galleryProfile: ImgurRestApi.GalleryProfile) : ImgurRestApi.GalleryProfile { + return galleryProfile; +} + +function testImage(image: ImgurRestApi.Image) : ImgurRestApi.Image { + return image; +} + +function testMemeMeta(meta: ImgurRestApi.MemeMetadata) : ImgurRestApi.MemeMetadata { + return meta; +} + +function testMessage(message: ImgurRestApi.Message) : ImgurRestApi.Message { + return message; +} + +function testAccountNotificationsReply(accountNotif: ImgurRestApi.AccountNotifications) : ImgurRestApi.Notification { + return accountNotif.replies[0]; +} + +function testAccountNotificationsMessage(accountNotif: ImgurRestApi.AccountNotifications) : ImgurRestApi.Notification { + return accountNotif.messages[0]; +} + +function testTag(tag: ImgurRestApi.Tag) : ImgurRestApi.Tag { + return tag; +} + +function testTagVote(tagVote: ImgurRestApi.TagVote) : ImgurRestApi.TagVote { + return tagVote; +} + +function testTopic(topic: ImgurRestApi.Topic) : ImgurRestApi.Topic { + return topic; +} + +function testVote(vote: ImgurRestApi.Vote) : ImgurRestApi.Vote { + return vote; +} + +function testResponseWithError(response: ImgurRestApi.Response) : ImgurRestApi.Error { + if(response.success === false) { + return response.data; + } + return null; +} + +function testResponseWithValue(response: ImgurRestApi.Response) : ImgurRestApi.GalleryProfile { + if(response.success === true) { + return response.data; + } + return null; +} diff --git a/imgur-rest-api/imgur-rest-api.d.ts b/imgur-rest-api/imgur-rest-api.d.ts new file mode 100644 index 0000000000..2726006568 --- /dev/null +++ b/imgur-rest-api/imgur-rest-api.d.ts @@ -0,0 +1,252 @@ +// Type definitions for Imgur REST API v3 +// Project: https://api.imgur.com/ +// Definitions by: Luke William Westby +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module ImgurRestApi { + + interface Response { + data: any; //T|Error; + status: number; + success: boolean; + } + + interface Account { + id: number; + url: string; + bio: string; + reputation: number; + created: number; + pro_expiration: any; //number|boolean; + } + + interface AccountSettings { + email: string; + high_quality: boolean; + public_images: boolean; + album_privacy: string; + pro_expiration: any; //number|boolean; + accepted_gallery_terms: boolean; + active_emails: Array; + messaging_enabled: boolean; + blocked_users: Array; + } + + interface Album { + id: string; + title: string; + description: string; + datetime: number; + cover: string; + cover_width: number; + cover_height: number; + account_url?: string; + account_id?: number; + privacy: string; + layout: string; + views: number; + link: string; + favorite: boolean; + nsfw?: boolean; + section: string; + order: number; + deletehash?: string; + images_count: number; + images: Array; + } + + interface BlockedUser { + blocked_id: number; + blocked_url: string; + } + + interface Comment { + id: number; + image_id: string; + comment: string; + author: string; + author_id: number; + on_album: boolean; + album_cover: string; + ups: number; + downs: number; + points: number; + datetime: number; + parent_id: number; + deleted: boolean; + vote?: string; + children: Array + } + + interface Conversation { + id: number; + last_message_preview: string; + datetime: number; + with_account_id: number; + with_account: string; + message_count: number; + messages?: Array; + done?: boolean; + page?: number; + } + + interface CustomGallery { + account_url: string; + link: string; + tags: Array + item_count: number; + items: Array; + } + + interface GalleryItem { + id: string; + title: string; + description: string; + datetime: number; + account_url?: string; + account_id?: number; + ups: number; + downs: number; + score: number; + is_album: boolean; + views: number; + link: string; + vote?: string; + favorite: boolean; + nsfw?: boolean; + comment_count: number; + topic: string; + topic_id: number; + } + + interface GalleryAlbum extends GalleryItem { + cover: string; + cover_width: number; + cover_height: number; + privacy: string; + layout: string; + images_count: number; + images: Array; + } + + interface GalleryImage extends GalleryItem { + type: string; + animated: boolean; + width: number; + height: number; + size: number; + bandwidth: number; + deletehash?: string; + gifv?: string; + mp4?: string; + webm?: string; + looping?: boolean; + section: string; + } + + interface GalleryProfile { + total_gallery_comments: number; + total_gallery_favorites: number; + total_gallery_submissions: number; + trophies: Array; + } + + interface Trophy { + id: number; + name: string; + name_clean: string; + description: string; + data: string; + data_link: string; + datetime: number; + image: string; + } + + interface Image { + id: string; + title: string; + description: string; + datetime: number; + type: string; + animated: boolean; + width: number; + height: number; + size: number; + views: number; + bandwidth: number; + deletehash?: string; + name?: string; + section: string; + link: string; + gifv?: string; + mp4?: string; + webm?: string; + looping?: boolean; + vote?: string; + favorite: boolean; + nsfw?: boolean; + account_url?: string; + account_id?: number; + } + + interface MemeMetadata { + meme_name: string; + top_text: string; + bottom_text: string; + bg_image: string; + } + + interface Message { + id: number; + from: string; + account_id: number; + sender_id: number; + body: string; + conversation_id: number; + datetime: number; + } + + interface Notification { + id: number; + account_id: number; + viewed: boolean; + content: T; + } + + interface AccountNotifications { + replies: Array>; + messages: Array>; + } + + interface Tag { + name: string; + followers: number; + total_items: number; + following?: boolean; + items: Array + } + + interface TagVote { + ups: number; + downs: number; + name: string; + author: string; + } + + interface Topic { + id: number; + name: string; + description: string; + } + + interface Vote { + ups: number; + downs: number; + } + + interface Error { + error: string; + request: string; + method: string; + } +} diff --git a/jquery-fullscreen/jquery-fullscreen-tests.ts b/jquery-fullscreen/jquery-fullscreen-tests.ts new file mode 100644 index 0000000000..633b3d3934 --- /dev/null +++ b/jquery-fullscreen/jquery-fullscreen-tests.ts @@ -0,0 +1,36 @@ +/// + +// +// Examples from https://github.com/kayahr/jquery-fullscreen-plugin +// + +function enteringFullScreen() { + + $(document).fullScreen(true); + $('#myVideo').fullScreen(true); +} + +function exitingFullScreen() { + + $(document).fullScreen(false); + $('#myVideo').fullScreen(false); +} + + +function queryingFullScreenMode() { + + //The method returns the current fullscreen element (or true if browser doesn't support this) when fullscreen mode is active, + // false if not active or null when the browser does not support fullscreen mode at all + var isFullScreen = $(document).fullScreen() != null; +} + +function fullScreenNotifications() { + + $(document).bind("fullscreenchange", () => { + console.log("Fullscreen " + ($(document).fullScreen() ? "on" : "off")); + }); + + $(document).bind("fullscreenerror", () => { + alert("Browser rejected fullscreen change"); + }); +} \ No newline at end of file diff --git a/jquery-fullscreen/jquery-fullscreen.d.ts b/jquery-fullscreen/jquery-fullscreen.d.ts new file mode 100644 index 0000000000..605b9fb59b --- /dev/null +++ b/jquery-fullscreen/jquery-fullscreen.d.ts @@ -0,0 +1,28 @@ +// Type definitions for jquery-fullscreen 1.1.5 +// Project: https://github.com/kayahr/jquery-fullscreen-plugin +// Definitions by: Bruno Grieder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface JQuery { + + /** + * You can either switch the whole page or a single HTML element to fullscreen mode + * This only works when the code was triggered by a user interaction (For example a onclick event on a button). Browsers don't allow entering fullscreen mode without user interaction. + * Fullscreen mode is always exited via the document but this plugin allows it also via any HTML element. The owner document of the selected HTML element is used + */ + fullScreen(fullScreen: boolean): JQuery | boolean; + + /** + * The method returns the current fullscreen element (or true if browser doesn't support this) when fullscreen mode is active, + * false if not active or null when the browser does not support fullscreen mode at all + */ + fullScreen(): boolean; + + /** + * The plugin provides another method for simple fullscreen mode toggling + */ + toggleFullScreen(): JQuery | boolean; +} + diff --git a/knex/knex.d.ts b/knex/knex.d.ts index d3216acf9f..c9a6ada4bc 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -307,13 +307,13 @@ declare module "knex" { } interface SchemaBuilder { - createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): void; - renameTable(oldTableName: string, newTableName: string): void; - dropTable(tableName: string): void; + createTable(tableName: string, callback: (tableBuilder: CreateTableBuilder) => any): Promise; + renameTable(oldTableName: string, newTableName: string): Promise; + dropTable(tableName: string): Promise; hasTable(tableName: string): Promise; hasColumn(tableName: string, columnName: string): Promise; - table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): void; - dropTableIfExists(tableName: string): void; + table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): Promise; + dropTableIfExists(tableName: string): Promise; raw(statement: string): SchemaBuilder; } diff --git a/knockout.projections/knockout.projections-tests.ts b/knockout.projections/knockout.projections-tests.ts index 3d479e7ac3..138d369465 100644 --- a/knockout.projections/knockout.projections-tests.ts +++ b/knockout.projections/knockout.projections-tests.ts @@ -26,3 +26,39 @@ sourceItems.push(9); sourceItems.push(10); // evenSquares now contains [36, 16, 4, 100] + +// Testing mapping options + +interface IComplexItem { + value: string; + dispose(): void; +} + +var complexItems = sourceItems.map({ + mapping: x => { + var item: IComplexItem = { + value: (x * x).toString(), + dispose: () => { } + }; + + return item; + }, + disposeItem: (item: IComplexItem) => item.dispose() +}); + +var complexItems2 = sourceItems.map({ + mappingWithDisposeCallback: x => { + return { + mappedValue: (x * x).toString(), + dispose: () => { } + }; + } +}); + +// Test disposal + +evenSquares.dispose(); + +complexItems.dispose(); + +complexItems2.dispose(); diff --git a/knockout.projections/knockout.projections.d.ts b/knockout.projections/knockout.projections.d.ts index 77f3bf0ec8..e1443478ab 100644 --- a/knockout.projections/knockout.projections.d.ts +++ b/knockout.projections/knockout.projections.d.ts @@ -5,8 +5,21 @@ /// -interface KnockoutObservableArrayFunctions { - - map(mapping: (value: T) => TResult): KnockoutObservableArray; - filter(predicate: (value: T) => boolean): KnockoutObservableArray; +interface KnockoutMappedObservableArray extends KnockoutObservableArray, KnockoutSubscription { +} + +interface KnockoutObservableArrayFunctions { + map(mappingOptions: { + mappingWithDisposeCallback: (value: T) => { + mappedValue: TResult; + dispose: () => void; + }; + }): KnockoutMappedObservableArray; + map(mappingOptions: { + mapping: (value: T) => TResult; + disposeItem?: (mappedItem: TResult) => void; + }): KnockoutMappedObservableArray; + map(mappingOptions: (value: T) => TResult): KnockoutMappedObservableArray; + + filter(predicate: (value: T) => boolean): KnockoutMappedObservableArray; } diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 6f24b75dcd..46c11ebf6f 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -565,6 +565,8 @@ result = _.sample([1, 2, 3, 4]); result = _.sample([1, 2, 3, 4], 2); result = _.shuffle([1, 2, 3, 4, 5, 6]); +result = <_.LoDashArrayWrapper>_([1, 2, 3]).shuffle(); +result = <_.LoDashArrayWrapper<_.Dictionary>>_(<{ [index: string]: string; }>{ 'key1': 'test1', 'key2': 'test2' }).shuffle(); result = _.size([1, 2]); result = _.size({ 'one': 1, 'two': 2, 'three': 3 }); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c43f27c5c1..426162e2e7 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -4398,6 +4398,20 @@ declare module _ { shuffle(collection: Dictionary): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.shuffle + **/ + shuffle(): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.shuffle + **/ + shuffle(): LoDashArrayWrapper; + } + //_.size interface LoDashStatic { /** diff --git a/node/node.d.ts b/node/node.d.ts index 88745f4689..95ea4d8fdc 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -282,15 +282,10 @@ declare module "http" { address(): { port: number; family: string; address: string; }; maxHeadersCount: number; } - export interface ServerRequest extends events.EventEmitter, stream.Readable { - method: string; - url: string; - headers: any; - trailers: string; - httpVersion: string; - setEncoding(encoding?: string): void; - pause(): void; - resume(): void; + /** + * @deprecated Use IncomingMessage + */ + export interface ServerRequest extends IncomingMessage { connection: net.Socket; } export interface ServerResponse extends events.EventEmitter, stream.Writable { @@ -340,15 +335,35 @@ declare module "http" { end(str: string, encoding?: string, cb?: Function): void; end(data?: any, encoding?: string): void; } - export interface ClientResponse extends events.EventEmitter, stream.Readable { - statusCode: number; + export interface IncomingMessage extends events.EventEmitter, stream.Readable { httpVersion: string; headers: any; + rawHeaders: string[]; trailers: any; - setEncoding(encoding?: string): void; - pause(): void; - resume(): void; + rawTrailers: any; + setTimeout(msecs: number, callback: Function): NodeJS.Timer; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + socket: net.Socket; } + /** + * @deprecated Use IncomingMessage + */ + export interface ClientResponse extends IncomingMessage { } export interface AgentOptions { /** @@ -390,10 +405,10 @@ declare module "http" { [errorCode: number]: string; [errorCode: string]: string; }; - export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server; + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; export function createClient(port?: number, host?: string): any; - export function request(options: any, callback?: Function): ClientRequest; - export function get(options: any, callback?: Function): ClientRequest; + export function request(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; export var globalAgent: Agent; } @@ -563,8 +578,8 @@ declare module "https" { }; export interface Server extends tls.Server { } export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.ClientResponse) =>void ): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.ClientResponse) =>void ): http.ClientRequest; + export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; + export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; export var globalAgent: Agent; } diff --git a/photoswipe/photoswipe-tests.ts b/photoswipe/photoswipe-tests.ts new file mode 100644 index 0000000000..79125bd05f --- /dev/null +++ b/photoswipe/photoswipe-tests.ts @@ -0,0 +1,209 @@ +/// + +function test_defaultUI() { + var items: PhotoSwipeUI_Default.Item[] = [ + { + src: "path/to/image.jpg", + w: 100, + h: 200, + specialProperty: true + }, + { + src: "path/to/image2.jpg", + w: 1000, + h: 2000, + specialProperty: false + } + ]; + + var options: PhotoSwipe.Options = { + index: 3, + getThumbBoundsFn: function(index) { + return {x: 100, y: 100, w: 100}; + }, + showAnimationDuration: 333, + hideAnimationDuration: 333, + showHideOpacity: false, + bgOpacity: 1, + spacing: 0.12, + allowNoPanText: true, + maxSpreadZoom: 2, + getDoubleTapZoom: function(isMouseClick, item) { + if (isMouseClick) { + return 1; + } else { + return item.initialZoomLevel < 0.7 ? 1 : 1.5; + } + }, + loop: true, + pinchToClose: true, + closeOnScroll: true, + closeOnVerticalDrag: true, + mouseUsed: false, + escKey: true, + arrowKeys: true, + history: true, + galleryUID: 3, + errorMsg: '
The image could not be loaded.
', + preload: [1, 1], + mainClass: "", + getNumItemsFn: () => { return 2; }, + focus: true, + isClickableElement: function(el) { + return el.tagName === 'A'; + }, + mainScrollEndFriction: 0.35, + panEndFriction: 0.35 + }; + + var photoSwipe: PhotoSwipe; + var uiOptions: PhotoSwipeUI_Default.Options = { + barsSize: {top: 44, bottom: 'auto'}, + timeToIdle: 4000, + timeToIdleOutside: 1000, + loadingIndicatorDelay: 1000, + addCaptionHTMLFn: function(item, captionEl, isFake) { + if (!item.title) { + ( captionEl.children[0]).innerHTML = ''; + return false; + } + ( captionEl.children[0]).innerHTML = item.title; + return true; + }, + closeEl: true, + captionEl: true, + fullscreenEl: true, + zoomEl: true, + shareEl: true, + counterEl: true, + arrowEl: true, + preloaderEl: true, + tapToClose: false, + tapToToggleControls: true, + clickToCloseNonZoomable: true, + closeElClasses: ['item', 'caption', 'zoom-wrap', 'ui', 'top-bar'], + indexIndicatorSep: ' / ', + shareButtons: [ + {id: 'facebook', label: 'Share on Facebook', url: 'https://www.facebook.com/sharer/sharer.php?u='}, + {id: 'twitter', label: 'Tweet', url: 'https://twitter.com/intent/tweet?text=&url='}, + {id: 'pinterest', label: 'Pin it', url: 'http://www.pinterest.com/pin/create/button/?url=&media=&description='}, + {id: 'download', label: 'Download image', url: '', download: true} + ], + getImageURLForShare: function( shareButtonData ) { + // `shareButtonData` - object from shareButtons array + // + // `pswp` is the gallery instance object, + // you should define it by yourself + // + return photoSwipe.currItem.src || ''; + }, + getPageURLForShare: function( shareButtonData ) { + return window.location.href; + }, + getTextForShare: function( shareButtonData ) { + return ( photoSwipe.currItem).title || ''; + }, + parseShareButtonOut: function(shareButtonData, shareButtonOut) { + return shareButtonOut; + } + }; + + var pswpElement = document.getElementById("gallery"); + photoSwipe = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, uiOptions); + +} + +function test_photoSwipeMethods() { + var photoSwipe: PhotoSwipe; + + photoSwipe.init(); + + alert(photoSwipe.currItem.src); + alert(photoSwipe.viewportSize.x); + photoSwipe.ui.init(); + photoSwipe.bg.style.borderStyle = "1px solid red"; + photoSwipe.container.style.borderStyle = "1px solid red"; + photoSwipe.options.timeToIdle = 2000; + alert(photoSwipe.getCurrentIndex() === 3); + alert(photoSwipe.getZoomLevel() === 1); + alert(photoSwipe.isDragging()); + + photoSwipe.goTo(9); + photoSwipe.next(); + photoSwipe.prev(); + + photoSwipe.updateSize(true); + + photoSwipe.close(); + photoSwipe.zoomTo(2, + { x: 250, y: 250 }, + 2000, + (x) => { return x*x*(3-2*x); }, + (zoomValue) => { console.log("zoom value is now" + zoomValue); }); + photoSwipe.applyZoomPan(1, 0, 0); + + photoSwipe.items[photoSwipe.getCurrentIndex()].src = "new/path/to/image.jpg"; + photoSwipe.invalidateCurrItems(); +} + +function test_photoSwipeEvents() { + var photoSwipe: PhotoSwipe; + + photoSwipe.listen('beforeChange', () => {}); + photoSwipe.listen('afterChange', () => {}); + photoSwipe.listen('beforeChange', () => {}); + photoSwipe.listen('imageLoadComplete', (idx: number, item: PhotoSwipeUI_Default.Item) => { + item.w *= 2; + }); + photoSwipe.listen('resize', () => {}); + photoSwipe.listen('gettingData', (idx: number, item: PhotoSwipeUI_Default.Item) => { + item.title = "abc"; + }); + photoSwipe.listen('mouseUsed', () => {}); + photoSwipe.listen('initialZoomIn', () => {}); + photoSwipe.listen('initialZoomInEnd', () => {}); + photoSwipe.listen('initialZoomOut', () => {}); + photoSwipe.listen('initialZoomOutEnd', () => {}); + photoSwipe.listen('parseVerticalMargin', (item: PhotoSwipeUI_Default.Item) => { + item.vGap.top = 20; + item.vGap.bottom = 40; + }); + photoSwipe.listen('close', () => {}); + photoSwipe.listen('unbindEvents', () => {}); + photoSwipe.listen('destroy', () => {}); + photoSwipe.listen('preventDragEvent', (e: MouseEvent, isDown: boolean, preventObj: {prevent: boolean}) => { + if (e.x > 50 && isDown) { + preventObj.prevent = true; + } + }); + + photoSwipe.listen('foo', (a, b, c) => { + alert(a + b + c); + }); + photoSwipe.shout('foo', 1, 2, 3); +} + +function test_customUI() { + var pswpElement = document.getElementById("gallery2"); + var myPhotoSwipe = new PhotoSwipe(pswpElement, MyUI, [], { + bgOpacity: 0, + index: 3, + foo: 123, + bar: "abc" + }); +} + +interface MyUIOptions extends PhotoSwipe.Options { + foo: number; + bar: string; +} + +class MyUI implements PhotoSwipe.UI { + constructor(pswp: PhotoSwipe, framework: PhotoSwipe.UIFramework) { + // dummy + } + + init() { + // dummy + } +} diff --git a/photoswipe/photoswipe.d.ts b/photoswipe/photoswipe.d.ts new file mode 100644 index 0000000000..b09fe75ddf --- /dev/null +++ b/photoswipe/photoswipe.d.ts @@ -0,0 +1,898 @@ +// Type definitions for PhotoSwipe 4.0.7 +// Project: http://photoswipe.com/ +// Definitions by: Xiaohan Zhang +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module PhotoSwipe { + /** + * A specific slide in the PhotoSwipe gallery. The terms "item", "slide", and "slide object" are used interchangeably. + */ + interface Item { + /** + * The url of this image. + */ + src: string; + /** + * The width of this image. + */ + w: number; + /** + * The height of this image. + */ + h: number; + + /** + * Internal property added by PhotoSwipe. + */ + loadError?: boolean; + + /** + * Internal property added by PhotoSwipe. + */ + vGap?: {top: number; bottom: number}; + + /** + * Internal property added by PhotoSwipe. + * This number is computed to be this item's smaller dimension divided by the larger dimension. + */ + fitRatio?: number; + + /** + * Internal property added by PhotoSwipe. + */ + initialZoomLevel?: number; + + /** + * Internal property added by PhotoSwipe. + */ + bounds?: any; + + /** + * Internal property added by PhotoSwipe. + */ + initialPosition?: any; + } + + /** + * Options for the base PhotoSwipe class. Derived from http://photoswipe.com/documentation/options.html + */ + interface Options { + /** + * Start slide index. 0 is the first slide. Must be integer, not a string. + * + * Default 0. + */ + index?: number; + + /** + * Function should return an object with coordinates from which initial zoom-in animation will start (or zoom-out animation will end). + * Object should contain three properties: x (X position, relative to document), y (Y position, relative to document), w (width of the element). + * Height will be calculated automatically based on size of large image. + * For example if you return {x:0,y:0,w:50} zoom animation will start in top left corner of your page. + * Function has one argument - index of the item that is opening or closing. + * + * Default undefined. + */ + getThumbBoundsFn?: (index: number) => { x: number; y: number; w: number }; + + /** + * Initial zoom-in transition duration in milliseconds. Set to 0 to disable. Besides this JS option, you need also to change transition duration in PhotoSwipe CSS file: + * .pswp--animate_opacity, + * .pswp__bg, + * .pswp__caption, + * .pswp__top-bar, + * .pswp--has_mouse .pswp__button--arrow--left, + * .pswp--has_mouse .pswp__button--arrow--right{ + * -webkit-transition: opacity 333ms cubic-bezier(.4,0,.22,1); + * transition: opacity 333ms cubic-bezier(.4,0,.22,1); + * } + * + * Default 333. + */ + showAnimationDuration?: number; + + /** + * The same as the previous option, just for closing (zoom-out) transition. + * After PhotoSwipe is opened pswp--open class will be added to the root element, you may use it to apply different transition duration in CSS. + * + * Default 333. + */ + hideAnimationDuration?: number; + + /** + * If set to false background opacity and image scale will be animated (image opacity is always 1). + * If set to true root PhotoSwipe element opacity and image scale will be animated. + * Enable it when dimensions of your small thumbnail don't match dimensions of large image. + * + * Default false. + */ + showHideOpacity?: boolean; + + /** + * Background (.pswp__bg) opacity. + * Should be a number from 0 to 1, e.g. 0.7. + * This style is defined via JS, not via CSS, as this value is used for a few gesture-based transitions. + * + * Default 1. + */ + bgOpacity?: number; + + /** + * Spacing ratio between slides. For example, 0.12 will render as a 12% of sliding viewport width (rounded). + * + * Default 0.12. + */ + spacing?: number; + + /** + * Allow swipe navigation to next/prev item when current item is zoomed. + * Option is always false on devices that don't have hardware touch support. + * + * Default true. + */ + allowNoPanText?: boolean; + + /** + * Maximum zoom level when performing spread (zoom) gesture. 2 means that image can be zoomed 2x from original size. + * Try to avoid huge values here, as too big image may cause memory issues on mobile (especially on iOS). + * + * Default 2. + */ + maxSpreadZoom?: number; + + /** + * Function should return zoom level to which image will be zoomed after double-tap gesture, or when user clicks on zoom icon, or mouse-click on image itself. + * If you return 1 image will be zoomed to its original size. + * Function is called each time zoom-in animation is initiated. So feel free to return different values for different images based on their size or screen DPI. + * + * Default is: + * + * function(isMouseClick, item) { + * + * // isMouseClick - true if mouse, false if double-tap + * // item - slide object that is zoomed, usually current + * // item.initialZoomLevel - initial scale ratio of image + * // e.g. if viewport is 700px and image is 1400px, + * // initialZoomLevel will be 0.5 + * + * if(isMouseClick) { + * + * // is mouse click on image or zoom icon + * + * // zoom to original + * return 1; + * + * // e.g. for 1400px image: + * // 0.5 - zooms to 700px + * // 2 - zooms to 2800px + * + * } else { + * + * // is double-tap + * + * // zoom to original if initial zoom is less than 0.7x, + * // otherwise to 1.5x, to make sure that double-tap gesture always zooms image + * return item.initialZoomLevel < 0.7 ? 1 : 1.5; + * } + * } + */ + getDoubleTapZoom?: (isMouseClick: boolean, item: Item) => number; + + /** + * Loop slides when using swipe gesture.If set to true you'll be able to swipe from last to first image. + * Option is always false when there are less than 3 slides. + * This option has no relation to arrows navigation. Arrows loop is turned on permanently. You can modify this behavior by making custom UI. + * + * Default true. + */ + loop?: boolean; + + /** + * Pinch to close gallery gesture. The gallery’s background will gradually fade out as the user zooms out. When the gesture is complete, the gallery will close. + * + * Default true. + */ + pinchToClose?: boolean; + + /** + * Close gallery on page scroll. Option works just for devices without hardware touch support. + * + * Default true. + */ + closeOnScroll?: boolean; + + /** + * Close gallery when dragging vertically and when image is not zoomed. Always false when mouse is used. + * + * Default true. + */ + closeOnVerticalDrag?: boolean; + + /** + * Option allows you to predefine if mouse was used or not. + * Some PhotoSwipe feature depend on it, for example default UI left/right arrows will be displayed only after mouse is used. + * If set to false, PhotoSwipe will start detecting when mouse is used by itself, mouseUsed event triggers when mouse is found. + * + * default false. + */ + mouseUsed?: boolean; + + /** + * esc keyboard key to close PhotoSwipe. Option can be changed dynamically (yourPhotoSwipeInstance.options.escKey = false;). + * + * Default true. + */ + escKey?: boolean; + + /** + * Keyboard left or right arrow key navigation. Option can be changed dynamically (yourPhotoSwipeInstance.options.arrowKeys = false;). + * + * Default true. + */ + arrowKeys?: boolean; + + /** + * If set to false disables history module (back button to close gallery, unique URL for each slide). You can also just exclude history.js module from your build. + * + * Default true. + */ + history?: boolean; + + /** + * Gallery unique ID. Used by History module when forming URL. For example, second picture of gallery with UID 1 will have URL: http://example.com/#&gid=1&pid=2. + * + * Default 1. + */ + galleryUID?: number; + + /** + * Error message when image was not loaded. %url% will be replaced by URL of image. + * + * Default is: + * + *
The image could not be loaded.
+ */ + errorMsg?: string; + + /** + * Lazy loading of nearby slides based on direction of movement. + * Should be an array with two integers, first one - number of items to preload before current image, second one - after the current image. + * E.g. if you set it to [1,3], it'll load 1 image before the current, and 3 images after current. Values can not be less than 1. + * + * Default [1, 1]. + */ + preload?: number[]; + + /** + * String with name of class that will be added to root element of PhotoSwipe (.pswp). Can contain multiple classes separated by space. + */ + mainClass?: string; + + /** + * Function that should return total number of items in gallery. Don't put very complex code here, function is executed very often. + * + * By default it returns length of slides array. + */ + getNumItemsFn?: () => number; + + /** + * Will set focus on PhotoSwipe element after it's open. + * + * Default true. + */ + focus?: boolean; + + /** + * Function should check if the element (el) is clickable. + * If it is – PhotoSwipe will not call preventDefault and click event will pass through. + * Function should be as light is possible, as it's executed multiple times on drag start and drag release. + * + * Default is: + * + * function(el) { + * return el.tagName === 'A'; + * } + */ + isClickableElement?: (el: HTMLElement) => boolean; + } + + interface UIFramework { + [name: string]: any; + } + + /** + * Base type for PhotoSwipe user interfaces. + * T is the type of options that this PhotoSwipe.UI uses. + * + * To build your own PhotoSwipe.UI class: + * + * (1) Write an interface for the custom UI's Options that extends PhotoSwipe.Options. + * (2) Write your custom class, implementing the PhotoSwipe.UI interface. + * (3) Pass in your custom interface to the type parameter T of the PhotoSwipe.UI interface. + * + * Example: + * + * // (1) + * interface MyUIOptions extends PhotoSwipe.Options { + * foo: number; + * bar: string; + * } + * + * // (2) and (3) + * class MyUI implements PhotoSwipe.UI { + * constructor(pswp: PhotoSwipe, framework: PhotoSwipe.UIFramework) { + * } + * } + * + * var pswpWithMyUI = new PhotoSwipe(element, MyUI, items, {foo: 1, bar: "abc"}); + */ + interface UI { + /** + * Called by PhotoSwipe after it constructs the UI. + */ + init: () => void; + } +} + +/** + * Base PhotoSwipe class. Derived from http://photoswipe.com/documentation/api.html + */ +declare class PhotoSwipe { + /** + * Constructs a PhotoSwipe. + * + * Note: By default Typescript will not correctly typecheck the options parameter. Make sure to + * explicitly annotate the type of options being passed into the constructor like so: + * + * new PhotoSwipe( element, PhotoSwipeUI_Default, items, options ); + * + * It accepts 4 arguments: + * + * (1) PhotoSwipe element (it must be added to DOM). + * (2) PhotoSwipe UI class. If you included default photoswipe-ui-default.js, class will be PhotoSwipeUI_Default. Can be "false". + * (3) Array with objects (slides). + * (4) Options. + */ + constructor(pswpElement: HTMLElement, + uiConstructor: (new (pswp: PhotoSwipe, framework: PhotoSwipe.UIFramework) => PhotoSwipe.UI) | boolean, + items: PhotoSwipe.Item[], + options: T); + + /** + * Current slide object. + */ + currItem: PhotoSwipe.Item; + + /** + * Items in this gallery. PhotoSwipe will (almost) dynamically respond to changes in this array. + * To add, edit, or remove slides after PhotoSwipe is opened, you just need to modify the items array. + * + * For example, you can push new slide objects into the items array: + * + * pswp.items.push({ + * src: "path/to/image.jpg", + * w:1200, + * h:500 + * }); + * + * If you changed slide that is CURRENT, NEXT or PREVIOUS (which you should try to avoid) – you need to call method that will update their content: + * + * // sets a flag that slides should be updated + * pswp.invalidateCurrItems(); + * // updates the content of slides + * pswp.updateSize(true); + * + * If you're using the DefaultUI, call pswp.ui.update() to update that as well. Also note: + * + * (1) You can't reassign whole array, you can only modify it (e.g. use splice to remove elements). + * (2) If you're going to remove current slide – call goTo method before. + * (3) There must be at least one slide. + * (4) This technique is used to serve responsive images. + */ + items: PhotoSwipe.Item[]; + + /** + * Size of the current viewport. + */ + viewportSize: { + x: number; + y: number; + }; + + /** + * The Framework. Holds utility methods. + */ + framework: PhotoSwipe.UIFramework; + + /** + * The ui instance constructed by PhotoSwipe. + */ + ui: PhotoSwipe.UI; + + /** + * The background element (with class .pswp__bg). + */ + bg: HTMLElement; + + /** + * The container element (with class .pswp__container). + */ + container: HTMLElement; + + /** + * Options for this PhotoSwipe. This object is a copy of the options parameter passed into the constructor. + * Some properties in options are dynamically modifiable. + */ + options: T; + + /** + * Current item index. + */ + getCurrentIndex(): number; + + /** + * Current zoom level. + */ + getZoomLevel(): number; + + /** + * Whether one (or more) pointer is used. + */ + isDragging(): boolean; + + /** + * Whether two (or more) pointers are used. + */ + isZooming(): boolean; + + /** + * true wehn transition between is running (after swipe). + */ + isMainScrollAnimating(): boolean; + + /** + * Initialize and open gallery (you can bind events before this method). + */ + init(): void; + + /** + * Go to slide by index. + */ + goTo(index: number): void; + + /** + * Go to the next slide. + */ + next(): void; + + /** + * Go to the previous slide. + */ + prev(): void; + + /** + * Update gallery size + * @param {boolean} `force` If you set it to `true`, size of the gallery will be updated even if viewport size hasn't changed. + */ + updateSize(force: boolean): void; + + /** + * Close gallery. Calls destroy() after closing. + */ + close(): void; + + /** + * Destroy gallery (unbind listeners, free memory). Automatically called after close(). + */ + destroy(): void; + + /** + * Zoom in/out the current slide to a specified zoom level, optionally with animation. + * + * @param {number} `destZoomLevel` Destination scale number. Set to 1 for unzoomed. + * Use `pswp.currItem.fitRatio - image` to zoom the image to perfectly fit into the viewport. + * @param {object} `centerPoint` The center of the zoom, relative to viewport. + * @param {number} `speed` Animation duration in milliseconds. Can be 0. + * @param {function} `easingFn` Easing function (optional). Set to false to use default easing. + * This method is passed in the percentage that the animation is finished (from 0 to 1) and should return an eased value (which should be 0 at the start and 1 at the end). + * @param {function} `updateFn` Function will be called on each update frame (optional). + * This method is passed the eased zoom level. + * + * Example below will 2x zoom to center of slide: + * + * pswp.zoomTo(2, {x:pswp.viewportSize.x/2,y:pswp.viewportSize.y/2}, 2000, false, function(now) {}); + * + */ + zoomTo(destZoomLevel: number, + centerPoint: {x: number; y: number}, + speed: number, + easingFn?: (k: number) => number, + updateFn?: (now: number) => void): void; + + /** + * Apply zoom and pan to the current slide + * + * @param {number} `zoomLevel` + * @param {int} `panX` + * @param {int} `panY` + * + * For example: `pswp.applyZoomPan(1, 0, 0)` + * will zoom current image to the original size + * and will place it on top left corner. + * + */ + applyZoomPan(zoomLevel: number, panX: number, panY: number): void; + + /** + * Call this method after dynamically modifying the current, next, or previous slide in the items array. + */ + invalidateCurrItems(): void; + + /** + * PhotoSwipe uses very simple Event/Messaging system. + * It has two methods shout (triggers event) and listen (handles event). + * For now there is no method to unbind listener, but all of them are cleared when PhotoSwipe is closed. + */ + listen(eventName: string, callback: (...args: any[]) => void): void; + + /** + * Called before slides change (before the content is changed ,but after navigation). Update UI here. + */ + listen(eventName: 'beforeChange', callback: () => void): void; + /** + * Called after slides change (after content has changed). + */ + listen(eventName: 'afterChange', callback: () => void): void; + /** + * Called when an image is loaded. + */ + listen(eventName: 'imageLoadComplete', callback: (index: number, item: PhotoSwipe.Item) => void): void; + /** + * Called when the viewport size changes. + */ + listen(eventName: 'resize', callback: () => void): void; + /** + * Triggers when PhotoSwipe reads slide object data, which happens before content is set, or before lazy-loading is initiated. + * Use it to dynamically change properties of the slide object. + */ + listen(eventName: 'gettingData', callback: (index: number, item: PhotoSwipe.Item) => void): void; + /** + * Called when mouse is first used (triggers only once). + */ + listen(eventName: 'mouseUsed', callback: () => void): void; + /** + * Called when opening zoom in animation starting. + */ + listen(eventName: 'initialZoomIn', callback: () => void): void; + /** + * Called when opening zoom in animation finished. + */ + listen(eventName: 'initialZoomInEnd', callback: () => void): void; + /** + * Called when closing zoom out animation started. + */ + listen(eventName: 'initialZoomOut', callback: () => void): void; + /** + * Called when closing zoom out animation finished. + */ + listen(eventName: 'initialZoomOutEnd', callback: () => void): void; + /** + * Allows overriding vertical margin for individual items. + * + * Example: + * + * pswp.listen('parseVerticalMargin', function(item) { + * var gap = item.vGap; + * + * gap.top = 50; // There will be 50px gap from top of viewport + * gap.bottom = 100; // and 100px gap from the bottom + * }); + */ + listen(eventName: 'parseVerticalMargin', callback: (item: PhotoSwipe.Item) => void): void; + /** + * Called when the gallery starts closing. + */ + listen(eventName: 'close', callback: () => void): void; + /** + * Gallery unbinds events (triggers before closing animation). + */ + listen(eventName: 'unbindEvents', callback: () => void): void; + /** + * Called after the gallery is closed and the closing animation finishes. + * Clean up your stuff here. + */ + listen(eventName: 'destroy', callback: () => void): void; + /** + * Allow to call preventDefault on down and up events. + */ + listen(eventName: 'preventDragEvent', callback: (e: MouseEvent, isDown: boolean, preventObj: {prevent: boolean}) => void): void; + + /** + * Triggers eventName event with args passed through to listeners. + */ + shout(eventName: string, ...args: any[]): void; +} + +/** + * Default UI class for PhotoSwipe. This class is largely undocumented and doesn't seem to have a public facing API. + */ +declare class PhotoSwipeUI_Default implements PhotoSwipe.UI { + constructor(pswp: PhotoSwipe, framework: PhotoSwipe.UIFramework); + init(): void; + + /** + * Call this method to update the UI after the items array has been modified in the original PhotoSwipe element. + */ + update(): void; +} + +declare module PhotoSwipeUI_Default { + /** + * Options for the PhotoSwipe Default UI. Derived from http://photoswipe.com/documentation/options.html + */ + interface Options extends PhotoSwipe.Options { + /** + * Size of top & bottom bars in pixels. "bottom" parameter can be 'auto' (will calculate height of caption). + * Option applies only when mouse is used, or when width of screen is more than 1200px. + * Also look at `parseVerticalMargin` event. + * + * Default {top: 44, bottom: "auto"}. + */ + barsSize?: { top: number; bottom: number | string }; + + /** + * Adds class pswp__ui--idle to pswp__ui element when mouse isn't moving for timeToIdle milliseconds. + * + * Default 4000. + */ + timeToIdle?: number; + + /** + * Adds class pswp__ui--idle to pswp__ui element when mouse leaves the window for timeToIdleOutside milliseconds. + * + * Default 1000. + */ + timeToIdleOutside?: number; + + /** + * Delay in milliseconds until loading indicator is displayed. + * + * Default 1000. + */ + loadingIndicatorDelay?: number; + + /** + * Function to build caption markup. The function takes three parameters: + * + * item - slide object + * captionEl - caption DOM element + * isFake - true when content is added to fake caption container + * (used to get size of next or previous caption) + * + * Return whether to show the caption or not. + * + * Default is: + * + * function(item, captionEl, isFake) { + * if(!item.title) { + * captionEl.children[0].innerHTML = ''; + * return false; + * } + * captionEl.children[0].innerHTML = item.title; + * return true; + * } + * + */ + addCaptionHTMLFn?: (item: Item, captionEl: HTMLElement, isFake: boolean) => boolean; + + /** + * Whether to show the close button. + * + * Default true. + */ + closeEl?: boolean; + + /** + * Whether to show the caption. + * + * Default true. + */ + captionEl?: boolean; + + /** + * Whether to show the fullscreen button. + * + * Default true. + */ + fullscreenEl?: boolean; + + /** + * Whether to show the zoom button. + * + * Default true. + */ + zoomEl?: boolean; + + /** + * Whether to show the share button. + * + * Default true. + */ + shareEl?: boolean; + + /** + * Whether to show the current image's index in the gallery (located in top-left corner by default). + * + * Default true. + */ + counterEl?: boolean; + + /** + * Whether to show the left/right directional arrows. + * + * Default true. + */ + arrowEl?: boolean; + + /** + * Whether to show the preloader element. + * + * Default true. + */ + preloaderEl?: boolean; + + /** + * Tap on sliding area should close gallery. + * + * Default false. + */ + tapToClose?: boolean; + + /** + * Tap should toggle visibility of controls. + * + * Default true. + */ + tapToToggleControls?: boolean; + + /** + * Mouse click on image should close the gallery, only when image is smaller than size of the viewport. + * + * Default true. + */ + clickToCloseNonZoomable?: boolean; + + /** + * Element classes that should close PhotoSwipe when clicked on. + * In HTML markup, class should always start with "pswp__", e.g.: "pswp__item", "pswp__caption". + * + * "pswp__ui--over-close" class will be added to root element of UI when mouse is over one of these elements + * By default it's used to highlight the close button. + * + * Default ['item', 'caption', 'zoom-wrap', 'ui', 'top-bar']. + */ + closeElClasses?: string[]; + + /** + * Separator for "1 of X" counter. + * + * Default ' / '. + */ + indexIndicatorSep?: string; + + /** + * The entries that show up when you click the Share button. + * + * Default is: + * + * [ + * {id:'facebook', label:'Share on Facebook', url:'https://www.facebook.com/sharer/sharer.php?u='}, + * {id:'twitter', label:'Tweet', url:'https://twitter.com/intent/tweet?text=&url='}, + * {id:'pinterest', label:'Pin it', url:'http://www.pinterest.com/pin/create/button/?url=&media=&description='}, + * {id:'download', label:'Download image', url:'', download:true} + * ] + * + */ + shareButtons?: ShareButtonData[]; + + /** + * A callback that should return the URL for the currently selected image. The callback is passed + * the shareButtonData entry that was clicked on. + * + * Default is: + * + * function( shareButtonData ) { + * // `shareButtonData` - object from shareButtons array + * // + * // `pswp` is the gallery instance object, + * // you should define it by yourself + * // + * return pswp.currItem.src || ''; + * } + * + */ + getImageURLForShare?: (shareButtonData: ShareButtonData) => string; + + /** + * A callback that should return the "Page" associated with the selected image. (e.g. on Facebook, the shared + * content will be associated with the returned page). The callback is passed the shareButtonData entry that + * was clicked on. + * + * Default is: + * + * function( shareButtonData ) { + * return window.location.href; + * } + * + */ + getPageURLForShare?: (shareButtonData: ShareButtonData) => string; + + /** + * A callback that should return the Text associated with the selected image. The callback is passed + * the shareButtonData entry that was clicked on. + * + * Default is: + * + * function( shareButtonData ) { + * return pswp.currItem.title || ''; + * } + * + */ + getTextForShare?: (shareButtonData: ShareButtonData) => string; + + /** + * A final output callback that you can use to further modify the share button's HTML. The callback is passed + * (1) the shareButtonData entry being generated, and (2) the default HTML generated by PhotoSwipUI_Default. + * + * Default is: + * + * function(shareButtonData, shareButtonOut) { + * return shareButtonOut; + * } + * + */ + parseShareButtonOut?: (shareButtonData: ShareButtonData, shareButtonOut: string) => string; + } + + interface ShareButtonData { + /** + * An id for this share button entry. The share element associated with this entry will be classed with + * 'pswp__share--' + id + */ + id: string; + + /** + * The user-visible text to display for this entry. + */ + label: string; + + /** + * The full sharing endpoint URL for this social media site (e.g. Facebook's is facebook.com/sharer/sharer.php), with URL parameters. + * PhotoSwipUI_Default treats the URL specially. In the url string, any of the following text is treated specially: + * '{{url}}', '{{image_url}}, '{{raw_image_url}}, '{{text}}'. PhotoSwipeUI_Default will replace each of them with the following value: + * + * {{url}} becomes the (URIEncoded) url to the current "Page" (as returned by getPageURLForShare). + * {{image_url}} becomes the (URIEncoded) url of the selected image (as returned by getImageURLForShare). + * {{raw_image_url}} becomes the raw url of the selected image (as returned by getImageURLForShare). + * {{text}} becomes the (URIEncoded) share text of the selected image (as returned by getTextForShare). + */ + url: string; + + /** + * Whether this link is a direct download button or not. + * + * Default false. + */ + download?: boolean; + } + + /** + * Extra properties that the Default UI accepts. + */ + interface Item extends PhotoSwipe.Item { + /** + * The caption for this item. + */ + title?: string; + } +} diff --git a/polymer/polymer-tests.ts b/polymer/polymer-tests.ts index a606692fd3..f594b4f226 100644 --- a/polymer/polymer-tests.ts +++ b/polymer/polymer-tests.ts @@ -10,6 +10,31 @@ class AbstractPolymerElement implements PolymerElement { asyncFire(eventName: string, details?: any, targetNode?: any, bubbles?: boolean, cancelable?: boolean): void { } cancelUnbindAll(): void { } + + /** + * User must call from attached callback + */ + resizableAttachedHandler(): void {} + + /** + * User must call from detached callback + */ + resizableDetachedHandler(): void {} + + /** + * User must call from attached callback + */ + resizerAttachedHandler(): void {} + + /** + * User must call from detached callback + */ + resizerDetachedHandler(): void {} + + /** + * User should call when resizing or un-hiding children + */ + notifyResize(): void {} } class AbstractWebComponent extends AbstractPolymerElement { diff --git a/polymer/polymer.app-router.d.ts b/polymer/polymer.app-router.d.ts index 633479ba2b..adf2f8d3b9 100644 --- a/polymer/polymer.app-router.d.ts +++ b/polymer/polymer.app-router.d.ts @@ -3,9 +3,11 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { module App { - export interface Router extends HTMLElement { + export interface Router extends PolymerElement, HTMLElement { init(): void; go(path: string, options?: { replace?: boolean }): void; } diff --git a/polymer/polymer.core-drawer-panel.d.ts b/polymer/polymer.core-drawer-panel.d.ts index 2bad7b633a..f219b4d0bc 100644 --- a/polymer/polymer.core-drawer-panel.d.ts +++ b/polymer/polymer.core-drawer-panel.d.ts @@ -3,9 +3,11 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { export module Core { - export interface DrawerPanel extends HTMLElement { + export interface DrawerPanel extends PolymerElement, HTMLElement { /** * Width of the drawer panel. default: '256px' */ diff --git a/polymer/polymer.core-overlay.d.ts b/polymer/polymer.core-overlay.d.ts new file mode 100644 index 0000000000..706dee8990 --- /dev/null +++ b/polymer/polymer.core-overlay.d.ts @@ -0,0 +1,92 @@ +// Type definitions for polymer's paper-toast +// Project: https://github.com/Polymer/core-selector +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module PolymerComponents { + export module Core { + export interface Overlay extends PolymerElement, HTMLElement { + /** + * The target element that will be shown when the overlay is opened. If unspecified, the core-overlay itself is the target. + * default: the overlay element + */ + target: Object; + + /** + * A core-overlay's size is guaranteed to be constrained to the window size. To achieve this, the sizingElement is sized with a max-height/width. By default this element is the target element, but it can be specifically set to a specific element inside the target if that is more appropriate. This is useful, for example, when a region inside the overlay should scroll if needed. + * default: the target element + */ + sizingTarget: Object; + + /** + * Set opened to true to show an overlay and to false to hide it. A core-overlay may be made initially opened by setting its opened attribute. + * default: false + */ + opened: boolean; + + /** + * If true, the overlay has a backdrop darkening the rest of the screen. The backdrop element is attached to the document body and may be styled with the class core-overlay-backdrop. When opened the core-opened class is applied. + * default: false + */ + backdrop: boolean; + + /** + * If true, the overlay is guaranteed to display above page content. + * default: false + */ + layered: boolean; + + /** + * By default an overlay will close automatically if the user taps outside it or presses the escape key. Disable this behavior by setting the autoCloseDisabled property to true. + * default: false + */ + autoCloseDisabled: boolean; + + /** + * By default an overlay will focus its target or an element inside it with the autoFocus attribute. Disable this behavior by setting the autoFocusDisabled property to true. + * default: false + */ + autoFocusDisabled: boolean; + + /** + * This property specifies an attribute on elements that should close the overlay on tap. Should not set closeSelector if this is set. + * default: "core-overlay-toggle" + */ + closeAttribute: string; + + /** + * This property specifies a selector matching elements that should close the overlay on tap. Should not set closeAttribute if this is set. + * default: '' + */ + closeSelector: string; + + /** + * The transition property specifies a string which identifies a core-transition element that will be used to help the overlay open and close. The default core-transition-fade will cause the overlay to fade in and out. + * default: 'core-transition-fade' + */ + transition: string; + + /** + * Toggle the opened state of the overlay. + */ + toggle(): void; + + /** + * Open the overlay. This is equivalent to setting the opened property to true. + */ + open(): void; + + /** + * Close the overlay. This is equivalent to setting the opened property to false. + */ + close(): void; + + /** + * Extensions of core-overlay should implement the resizeHandler method to adjust the size and position of the overlay when the browser window resizes. + */ + resizeHandler(): void; + } + } +} \ No newline at end of file diff --git a/polymer/polymer.core-selector.d.ts b/polymer/polymer.core-selector.d.ts new file mode 100644 index 0000000000..c7941cdde7 --- /dev/null +++ b/polymer/polymer.core-selector.d.ts @@ -0,0 +1,20 @@ +// Type definitions for polymer's paper-toast +// Project: https://github.com/Polymer/core-selector +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module PolymerComponents { + export module Core { + export interface Selector extends PolymerElement, HTMLElement { + } + + export interface SelectorOnSelectEvent extends Event { + detail: { + item: HTMLElement; + isSelected: boolean; + }; + } + } +} \ No newline at end of file diff --git a/polymer/polymer.d.ts b/polymer/polymer.d.ts index dfb812f8c0..ed084a4485 100644 --- a/polymer/polymer.d.ts +++ b/polymer/polymer.d.ts @@ -18,6 +18,31 @@ interface PolymerElement { domReady? (): void; detached? (): void; attributeChanged? (attrName: string, oldVal: any, newVal: any): void; + + /** + * User must call from attached callback + */ + resizableAttachedHandler(): void; + + /** + * User must call from detached callback + */ + resizableDetachedHandler(): void; + + /** + * User must call from attached callback + */ + resizerAttachedHandler(): void; + + /** + * User must call from detached callback + */ + resizerDetachedHandler(): void; + + /** + * User should call when resizing or un-hiding children + */ + notifyResize(): void; } interface Polymer { @@ -34,9 +59,6 @@ interface Polymer { (tagName: string, prototype: any): void; (prototype: PolymerElement): void; (): void; - // hacks for mixins - CoreResizer: any; - CoreResizable: any; } declare var Polymer: Polymer; diff --git a/polymer/polymer.paper-dialog.d.ts b/polymer/polymer.paper-dialog.d.ts new file mode 100644 index 0000000000..51758e42cb --- /dev/null +++ b/polymer/polymer.paper-dialog.d.ts @@ -0,0 +1,30 @@ +// Type definitions for polymer's paper-dialog +// Project: https://github.com/Polymer/paper-dialog +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module PolymerComponents { + export module Paper { + export interface Dialog extends PolymerComponents.Core.Overlay, HTMLElement { + /** + * The title of the dialog. + * default: '' + */ + heading: string; + + /** + * See paper-dialog-transition + * default: '' + */ + transition: string; + + /** + * default: true + */ + layered: boolean; + } + } +} \ No newline at end of file diff --git a/polymer/polymer.paper-toast.d.ts b/polymer/polymer.paper-toast.d.ts index fbf8cd7a65..6e29c1c8b6 100644 --- a/polymer/polymer.paper-toast.d.ts +++ b/polymer/polymer.paper-toast.d.ts @@ -3,9 +3,11 @@ // Definitions by: Louis Grignon // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module PolymerComponents { export module Paper { - export interface Toast extends HTMLElement { + export interface Toast extends PolymerElement, HTMLElement { /** * The text shows in a toast. * default: '' diff --git a/slickgrid/slick.autotooltips-tests.ts b/slickgrid/slick.autotooltips-tests.ts new file mode 100644 index 0000000000..f2e7f6f39c --- /dev/null +++ b/slickgrid/slick.autotooltips-tests.ts @@ -0,0 +1,8 @@ +/// + +var grid = new Slick.Grid("#myGrid", [], [], {}); +grid.registerPlugin(new Slick.AutoTooltips({ + enableForCells: true, + enableForHeaderCells: true, + maxToolTipLength: 100 +})); diff --git a/slickgrid/slick.autotooltips.d.ts b/slickgrid/slick.autotooltips.d.ts new file mode 100644 index 0000000000..34e761754a --- /dev/null +++ b/slickgrid/slick.autotooltips.d.ts @@ -0,0 +1,35 @@ +// Type definitions for SlickGrid AutoToolTips Plugin 2.1.0 +// Project: https://github.com/mleibman/SlickGrid +// Definitions by: Ryo Iwamoto +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Slick { + export interface SlickGridAutoTooltipsOption extends PluginOptions { + /** + * Enable tooltip for grid cells + * @default true + */ + enableForCells?: boolean; + + /** + * Enable tooltip for header cells + * @default false + */ + enableForHeaderCells?: boolean; + + /** + * The maximum length for a tooltip + * @default null + */ + maxToolTipLength?: number; + } + + /** + * AutoTooltips plugin to show/hide tooltips when columns are too narrow to fit content. + */ + export class AutoTooltips extends Plugin { + constructor(option?: SlickGridAutoTooltipsOption); + } +} diff --git a/squirejs/squirejs-tests.ts b/squirejs/squirejs-tests.ts new file mode 100644 index 0000000000..fc1701fbf6 --- /dev/null +++ b/squirejs/squirejs-tests.ts @@ -0,0 +1,37 @@ +/// + +import Squire = require('Squire'); + +// Default Configuration +var injector = new Squire(); + +// Different Context +injector = new Squire('other-requirejs-context'); + +// require(Array dependencies, Function callback, Function errback) +injector.require(['a'], function(A: any) {}, function(err: any) {}); + +// mock(String name | Object(name: mock), Object mock) +injector.mock("a", {}); +injector.mock({a: {}}); + +// store(String name | Array names) +injector.store('a'); +injector.store(['a', 'b']); + +// clean(Optional (String name | Array names)) +injector.clean('a'); +injector.clean(['a', 'b']); +injector.clean(); + +// remove() +injector.remove(); + +// run() +injector.run(['a'], function test(a: any) {})(function done() {}); + +// Squire.Helpers.returns(Any what) +Squire.Helpers.returns({}); + +// Squire.Helpers.constructs(Any what) +Squire.Helpers.constructs({}); diff --git a/squirejs/squirejs.d.ts b/squirejs/squirejs.d.ts new file mode 100644 index 0000000000..693ca7d907 --- /dev/null +++ b/squirejs/squirejs.d.ts @@ -0,0 +1,28 @@ +// Type definitions for Squire 0.2.1 +// Project: https://github.com/iammerrick/Squire.js +// Definitions by: Bradley Ayers +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'Squire' { + class Squire { + constructor(); + constructor(context: string); + mock(name: string, mock: any): Squire; + mock(mocks: {[name: string]: any}): Squire; + require(dependencies: string[], callback: Function, errback: Function): Squire; + store(name: string | string[]): Squire; + clean(): Squire; + clean(name: string | string[]): Squire; + remove(): String; + run(dependencies: string[], test: Function): (done: Function) => void; + } + + module Squire { + module Helpers { + export function returns(what: T): () => T; + export function constructs(what: T): () => (() => T); + } + } + + export = Squire; +} diff --git a/switchery/switchery-tests.ts b/switchery/switchery-tests.ts new file mode 100644 index 0000000000..2a06795027 --- /dev/null +++ b/switchery/switchery-tests.ts @@ -0,0 +1,71 @@ +/// + +// +// Examples from https://github.com/abpetkov/switchery +// + +function multipleSwitches() { + + var elems = Array.prototype.slice.call( document.querySelectorAll( '.js-switch' ) ); + + elems.forEach( (html: Element) => { + var switchery = new Switchery( html ); + } ); +} + + +function disabledSwitch() { + + var elem = document.querySelector( '.js-switch' ) + + //inactive switch + var switchery = new Switchery( elem, {disabled: true} ); + + //Customize the default opacity of the disabled switch, using the disabledOpacity option. + switchery = new Switchery( elem, {disabled: true, disabledOpacity: 0.75} ); +} + + +function coloredSwitch() { + + var elem = document.querySelector( '.js-switch' ) + + //You can change the primary color of the switch to fit your design perfectly: + var switchery = new Switchery( elem, {color: '#41b7f1'} ); + + //Or the secondary color, which will change the switch background color and border color: + switchery = new Switchery( elem, {secondaryColor: '#bbf0f0'} ); + + //Since version 0.6.3, you're even allowed to change the jack color from JS, as follows: + switchery = new Switchery( elem, {jackColor: '#fffc00'} ); +} + +function switchSizes() { + + var elem = document.querySelector( '.js-switch' ) + + var switchery = new Switchery( elem, {size: 'small'} ); + switchery = new Switchery( elem, {size: 'large'} ); +} + +function checkingState() { + + var elem = document.querySelector( '.js-switch' ) + + //On click: + + var clickCheckbox = document.querySelector( '.js-check-click' ) + var clickButton = document.querySelector( '.js-check-click-button' ); + + clickButton.addEventListener( 'click', () => { + alert( clickCheckbox.checked ); + } ); + + //On change: + + var changeCheckbox = document.querySelector( '.js-check-change' ); + + changeCheckbox.onchange = function () { + alert( changeCheckbox.checked ); + }; +} \ No newline at end of file diff --git a/switchery/switchery.d.ts b/switchery/switchery.d.ts new file mode 100644 index 0000000000..4d953aff88 --- /dev/null +++ b/switchery/switchery.d.ts @@ -0,0 +1,64 @@ +// Type definitions for switchery 0.7.0 +// Project: https://github.com/abpetkov/switchery +// Definitions by: Bruno Grieder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Switchery { + + export interface Options { + + /** + * color of the switch element (HEX or RGB value) + * @default '#64bd63' + */ + color? : string; + /** + * secondary color for background color and border, when the switch is off + * @default '#dfdfdf' + */ + secondaryColor? : string; + /** + * color of the jack/handle element + * @default '#fff' + */ + jackColor? : string; + /** + * class name for the switch element (by default styled in switchery.css) + * @default 'switchery' + */ + className? : string; + /** + * enable or disable click events and changing the state of the switch (boolean value) + * @default false + */ + disabled? : boolean; + /** + * opacity of the switch when it's disabled (0 to 1) + * @default 0.5 + */ + disabledOpacity? : number; + /** + * length of time that the transition will take, ex. '0.4s', '1s', '2.2s' (Note: transition speed of the handle is twice shorter) + * @default '0.4s' + */ + speed? : string; + /** + * size of the switch element (small or large) + * @default 'default' + */ + size? : string; + } + + +} + +declare class Switchery { + + constructor(node: Node, options?: Switchery.Options); + +} + +declare module "switchery" { + + export = Switchery +} \ No newline at end of file diff --git a/titanium/titanium-tests.ts b/titanium/titanium-tests.ts index a4057b80cb..087ba05c27 100644 --- a/titanium/titanium-tests.ts +++ b/titanium/titanium-tests.ts @@ -26,7 +26,7 @@ function test_window() { } function test_tableview() { - var data = []; + var data : Ti.UI.View[] = []; for (var i = 0; i < 10; i++) { var row = Ti.UI.createTableViewRow(); var label = Ti.UI.createLabel({ @@ -73,12 +73,12 @@ function test_network() { var url = "http://www.appcelerator.com"; var client = Ti.Network.createHTTPClient({ // function called when the response data is available - onload : function(e) { + onload : function(e: SuccessResponse) { alert(this.responseText); }, // function called when an error occurs, including a timeout - onerror : function(e) { - alert(e.rror); + onerror : function(e: FailureResponse) { + alert(e.error); }, timeout : 5000 // in milliseconds }); diff --git a/titanium/titanium.d.ts b/titanium/titanium.d.ts index 5ebe930241..a325611df3 100644 --- a/titanium/titanium.d.ts +++ b/titanium/titanium.d.ts @@ -1,33 +1,36 @@ -// Type definitions for Titanium Movile 3.1.3.GA +// Type definitions for Titanium Mobile 3.5.0 // Project: http://www.appcelerator.com/ -// Definitions by: Airam Rguez +// Definitions by: Craig Younkins // Definitions: https://github.com/borisyankov/DefinitelyTyped -// This file has been automatically generated. declare module Ti { + export var apiName : string; export var bubbleParent : boolean; export var buildDate : string; export var buildHash : string; export var userAgent : string; - export var version : number; + 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 () : number; + 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; @@ -175,6 +178,9 @@ declare module Ti { } export interface Text extends Ti.XML.CharacterData { splitText (offset: number) : Ti.XML.Text; + } + export enum Comment { + } export enum DocumentFragment { @@ -184,9 +190,6 @@ declare module Ti { systemId : string; getPublicId () : string; getSystemId () : string; - } - export enum Comment { - } export interface NodeList extends Ti.Proxy { length : number; @@ -349,6 +352,12 @@ declare module Ti { 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; @@ -370,6 +379,7 @@ declare module Ti { 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; @@ -378,7 +388,7 @@ declare module Ti { 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: string) : number; + 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; @@ -401,6 +411,7 @@ declare module Ti { 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; @@ -420,6 +431,7 @@ declare module Ti { 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; @@ -439,6 +451,7 @@ declare module Ti { 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; @@ -446,6 +459,7 @@ declare module Ti { 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; @@ -460,220 +474,447 @@ declare module Ti { } export interface DocumentViewer extends Ti.UI.View { setUrl (url: string) : void; - show(animated?: boolean, view?: any) : void; + show () : void; } - export interface Popover extends Ti.UI.View { + 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 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 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; - enabled : boolean; - focusable : boolean; - height : any; - horizontalWrap : boolean; - keepScreenOn : boolean; - layout : string; - left : any; - opacity : number; - rect : Dimension; - right : any; - size : Dimension; - softKeyboardOnFocus : number; - tintColor : any; - top : any; - touchEnabled : boolean; - transform : any; - 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; - getEnabled () : boolean; - getFocusable () : boolean; - getHeight () : any; - getHorizontalWrap () : boolean; - getKeepScreenOn () : boolean; - getLayout () : string; - getLeft () : any; - getOpacity () : number; - getRect () : Dimension; - getRight () : any; - getSize () : Dimension; - getSoftKeyboardOnFocus () : number; - getTintColor () : string; - getTop () : any; - getTouchEnabled () : boolean; - getTransform () : any; - 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; - 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; - 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; - setVisible (visible: boolean) : void; - setWidth (width: number) : void; - setWidth (width: string) : void; - setZIndex (zIndex: number) : void; - show (...args: Array) : void; - startLayout () : void; - toImage (callback?: (...args : any[]) => any, honorScaleFactor?: boolean) : Ti.Blob; - updateLayout (params: Dictionary) : 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; @@ -684,6 +925,7 @@ declare module Ti { 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; @@ -693,6 +935,7 @@ declare module Ti { 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; @@ -703,8 +946,6 @@ declare module Ti { export function setAppBadge (appBadge: number) : void; export function setAppSupportsShakeToEdit (appSupportsShakeToEdit: boolean) : void; export function setBubbleParent (bubbleParent: boolean) : void; - export function setStatusBarHidden (statusBarHidden: boolean) : void; - export function setStatusBarStyle (statusBarStyle: number) : void; export function showStatusBar (params?: showStatusBarParams) : void; export enum ScrollIndicatorStyle { BLACK, @@ -848,6 +1089,7 @@ declare module Ti { } export interface TextArea extends Ti.UI.View { appearance : number; + attributedString : Ti.UI.iOS.AttributedString; autoLink : number; autocapitalization : number; autocorrect : boolean; @@ -857,6 +1099,7 @@ declare module Ti { ellipsize : boolean; enableReturnKey : boolean; font : Font; + handleLinks : boolean; hintText : string; keyboardToolbar : any; keyboardToolbarColor : string; @@ -866,6 +1109,7 @@ declare module Ti { returnKeyType : number; scrollable : boolean; scrollsToTop : boolean; + selection : textAreaSelectedParams; suppressReturn : boolean; textAlign : any; value : string; @@ -873,6 +1117,7 @@ declare module Ti { blur () : void; focus () : void; getAppearance () : number; + getAttributedString () : Ti.UI.iOS.AttributedString; getAutoLink () : number; getAutocapitalization () : number; getAutocorrect () : boolean; @@ -882,6 +1127,7 @@ declare module Ti { getEllipsize () : boolean; getEnableReturnKey () : boolean; getFont () : Font; + getHandleLinks () : boolean; getHintText () : string; getKeyboardToolbar () : any; getKeyboardToolbarColor () : string; @@ -891,12 +1137,14 @@ declare module Ti { 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; @@ -906,6 +1154,7 @@ declare module Ti { 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; @@ -924,6 +1173,169 @@ declare module Ti { 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, @@ -933,8 +1345,11 @@ declare module Ti { 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; @@ -942,8 +1357,10 @@ declare module Ti { verticalAlign : any; getColor () : string; getFont () : Font; + getOnTintColor () : string; getStyle () : number; getTextAlign () : any; + getThumbTintColor () : string; getTitle () : string; getTitleOff () : string; getTitleOn () : string; @@ -951,9 +1368,11 @@ declare module Ti { 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; @@ -961,6 +1380,22 @@ declare module Ti { 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; @@ -1056,6 +1491,18 @@ declare module Ti { 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; @@ -1169,12 +1616,14 @@ declare module Ti { 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; @@ -1225,22 +1674,6 @@ declare module Ti { show () : 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 DashboardView extends Ti.UI.View { columnCount : number; data : Array; @@ -1308,192 +1741,6 @@ declare module Ti { setTitle (title: string) : void; show () : 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 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 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 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 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 createCoverFlowView (parameters?: Dictionary) : Ti.UI.iOS.CoverFlowView; - export function createDocumentViewer (parameters?: Dictionary) : Ti.UI.iOS.DocumentViewer; - export function createNavigationWindow (parameters?: Dictionary) : Ti.UI.iOS.NavigationWindow; - export function createTabbedBar (parameters?: Dictionary) : Ti.UI.iOS.TabbedBar; - export function createToolbar (parameters?: Dictionary) : Ti.UI.iOS.Toolbar; - export function fireEvent (name: string, event: Dictionary) : void; - export function getBubbleParent () : boolean; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : 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 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 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 interface _2DMatrix extends Ti.Proxy { a : number; b : number; @@ -1540,26 +1787,35 @@ declare module Ti { 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; @@ -1572,28 +1828,38 @@ declare module Ti { 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; @@ -1602,29 +1868,39 @@ declare module Ti { 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; @@ -1653,6 +1929,7 @@ declare module Ti { rightButton : any; rightButtonMode : number; rightButtonPadding : number; + selection : textFieldSelectedParams; suppressReturn : boolean; textAlign : any; value : string; @@ -1660,6 +1937,8 @@ declare module Ti { blur () : void; focus () : void; getAppearance () : number; + getAttributedHintText () : Ti.UI.iOS.AttributedString; + getAttributedString () : Ti.UI.iOS.AttributedString; getAutoLink () : number; getAutocapitalization () : number; getAutocorrect () : boolean; @@ -1688,12 +1967,15 @@ declare module Ti { 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; @@ -1791,11 +2073,13 @@ declare module Ti { 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; @@ -1811,11 +2095,13 @@ declare module Ti { 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; @@ -1837,11 +2123,13 @@ declare module Ti { 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; @@ -1862,6 +2150,58 @@ declare module Ti { 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; @@ -1890,6 +2230,7 @@ declare module Ti { contentHeight : any; contentOffset : Dictionary; contentWidth : any; + decelerationRate : number; disableBounce : boolean; horizontalBounce : boolean; maxZoomScale : number; @@ -1907,6 +2248,7 @@ declare module Ti { getContentHeight () : any; getContentOffset () : Dictionary; getContentWidth () : any; + getDecelerationRate () : number; getDisableBounce () : boolean; getHorizontalBounce () : boolean; getMaxZoomScale () : number; @@ -1928,6 +2270,7 @@ declare module Ti { 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; @@ -1947,13 +2290,16 @@ declare module Ti { 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; @@ -1961,6 +2307,7 @@ declare module Ti { sectionIndexTitles : Array; sections : Array; separatorColor : string; + separatorInsets : Dictionary; separatorStyle : number; showVerticalScrollIndicator : boolean; style : number; @@ -1975,20 +2322,24 @@ declare module Ti { 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 () : Ti.UI.SearchBar; + getSearchView () : any; getSectionCount () : number; getSectionIndexTitles () : Array; getSections () : Array; getSeparatorColor () : string; + getSeparatorInsets () : Dictionary; getSeparatorStyle () : number; getShowVerticalScrollIndicator () : boolean; getStyle () : number; @@ -2014,12 +2365,15 @@ declare module Ti { 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; @@ -2041,6 +2395,7 @@ declare module Ti { editButtonTitle : string; exitOnClose : boolean; navBarHidden : boolean; + navTintColor : any; shadowImage : string; tabDividerColor : string; tabDividerWidth : any; @@ -2056,6 +2411,9 @@ declare module Ti { tabsBackgroundSelectedColor : string; tabsBackgroundSelectedImage : string; tabsTintColor : any; + title : string; + titleAttributes : titleAttributesParams; + translucent : boolean; windowSoftInputMode : number; addTab (tab: Ti.UI.Tab) : void; close () : void; @@ -2075,6 +2433,7 @@ declare module Ti { getEditButtonTitle () : string; getExitOnClose () : boolean; getNavBarHidden () : boolean; + getNavTintColor () : string; getShadowImage () : string; getTabDividerColor () : string; getTabDividerWidth () : any; @@ -2090,6 +2449,9 @@ declare module Ti { getTabsBackgroundSelectedColor () : string; getTabsBackgroundSelectedImage () : string; getTabsTintColor () : string; + getTitle () : string; + getTitleAttributes () : titleAttributesParams; + getTranslucent () : boolean; getWindowSoftInputMode () : number; open () : void; removeTab (tab: Ti.UI.Tab) : void; @@ -2107,7 +2469,9 @@ declare module Ti { 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; @@ -2125,6 +2489,9 @@ declare module Ti { 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; @@ -2132,10 +2499,13 @@ declare module Ti { 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; @@ -2146,6 +2516,7 @@ declare module Ti { moveable : boolean; moving : boolean; overScrollMode : number; + refreshControl : Ti.UI.RefreshControl; rowHeight : number; scrollIndicatorStyle : number; scrollable : boolean; @@ -2156,6 +2527,7 @@ declare module Ti { sectionCount : number; sections : Array; separatorColor : string; + separatorInsets : Dictionary; separatorStyle : number; showVerticalScrollIndicator : boolean; style : number; @@ -2176,10 +2548,13 @@ declare module Ti { 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; @@ -2190,6 +2565,7 @@ declare module Ti { getMoveable () : boolean; getMoving () : boolean; getOverScrollMode () : number; + getRefreshControl () : Ti.UI.RefreshControl; getRowHeight () : number; getScrollIndicatorStyle () : number; getScrollable () : boolean; @@ -2200,6 +2576,7 @@ declare module Ti { getSectionCount () : number; getSections () : Array; getSeparatorColor () : string; + getSeparatorInsets () : Dictionary; getSeparatorStyle () : number; getShowVerticalScrollIndicator () : boolean; getStyle () : number; @@ -2222,6 +2599,7 @@ declare module Ti { 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; @@ -2236,6 +2614,7 @@ declare module Ti { 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; @@ -2246,6 +2625,7 @@ declare module Ti { 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; @@ -2254,9 +2634,13 @@ declare module Ti { } 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; @@ -2264,9 +2648,13 @@ declare module Ti { 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; @@ -2274,10 +2662,14 @@ declare module Ti { 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; @@ -2292,6 +2684,7 @@ declare module Ti { buttonNames : Array; cancel : number; destructive : number; + opaquebackground : boolean; options : Array; persistent : boolean; selectedIndex : number; @@ -2301,6 +2694,7 @@ declare module Ti { getButtonNames () : Array; getCancel () : number; getDestructive () : number; + getOpaquebackground () : boolean; getOptions () : Array; getPersistent () : boolean; getSelectedIndex () : number; @@ -2309,22 +2703,21 @@ declare module Ti { 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 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 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; @@ -2460,10 +2853,12 @@ declare module Ti { 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, @@ -2480,6 +2875,7 @@ declare module Ti { } } export interface Label extends Ti.UI.View { + attributedString : Ti.UI.iOS.AttributedString; autoLink : number; backgroundPaddingBottom : number; backgroundPaddingLeft : number; @@ -2490,14 +2886,17 @@ declare module Ti { font : Font; highlightedColor : string; html : string; + includeFontPadding : boolean; minimumFontSize : number; shadowColor : string; - shadowOffset : any; + 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; @@ -2508,14 +2907,17 @@ declare module Ti { getFont () : Font; getHighlightedColor () : string; getHtml () : string; + getIncludeFontPadding () : boolean; getMinimumFontSize () : number; getShadowColor () : string; - getShadowOffset () : any; + 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; @@ -2526,9 +2928,11 @@ declare module Ti { 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: any) : void; + setShadowOffset (shadowOffset: Dictionary) : void; + setShadowRadius (shadowRadius: number) : void; setText (text: string) : void; setTextAlign (textAlign: string) : void; setTextAlign (textAlign: number) : void; @@ -2608,55 +3012,6 @@ declare module Ti { setHeaderTitle (headerTitle: string) : void; setHeaderView (headerView: Ti.UI.View) : 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 Animation extends Ti.Proxy { anchorPoint : Point; autoreverse : boolean; @@ -2764,20 +3119,73 @@ declare module Ti { 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 Picker extends Ti.Proxy { + 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; @@ -2795,6 +3203,7 @@ declare module Ti { getCalendarViewShown () : boolean; getColumns () : Array; getCountDownDuration () : number; + getFont () : Font; getFormat24 () : boolean; getLocale () : string; getMaxDate () : Date; @@ -2810,6 +3219,7 @@ declare module Ti { 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; @@ -2828,7 +3238,7 @@ declare module Ti { export enum Module { } - export interface API { + export interface API { debug (message: Array) : void; debug (message: string) : void; error (message: Array) : void; @@ -2857,10 +3267,12 @@ declare module Ti { 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; @@ -2874,6 +3286,7 @@ declare module Ti { 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; @@ -2893,6 +3306,7 @@ declare module Ti { 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; @@ -2923,6 +3337,7 @@ declare module Ti { 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; @@ -2932,6 +3347,7 @@ declare module Ti { 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; @@ -2984,16 +3400,149 @@ declare module Ti { } } 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; @@ -3003,6 +3552,7 @@ declare module Ti { 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; @@ -3012,6 +3562,7 @@ declare module Ti { 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; @@ -3026,13 +3577,6 @@ declare module Ti { show (parameters?: Dictionary, callback?: (...args : any[]) => any) : void; update (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 SocialIntegrations { externalAccountLink (parameters: Dictionary, callback: (...args : any[]) => any) : void; externalAccountLogin (parameters: Dictionary, callback: (...args : any[]) => any) : void; @@ -3042,10 +3586,16 @@ declare module Ti { 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; @@ -3066,6 +3616,7 @@ declare module Ti { 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; @@ -3107,6 +3658,8 @@ declare module Ti { 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; @@ -3115,6 +3668,12 @@ declare module Ti { 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; @@ -3128,6 +3687,22 @@ declare module Ti { 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; @@ -3138,8 +3713,11 @@ declare module Ti { } 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; @@ -3234,11 +3812,13 @@ declare module Ti { 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; @@ -3257,12 +3837,14 @@ declare module Ti { 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; @@ -3278,29 +3860,87 @@ declare module Ti { 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 enum Android { - R + 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 { + + } } 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 createLocalNotification (parameters?: Dictionary) : Ti.App.iOS.LocalNotification; + 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: Dictionary) : Ti.App.iOS.LocalNotification; + 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; + } export interface LocalNotification extends Ti.Proxy { cancel () : 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; @@ -3534,6 +4174,7 @@ declare module Ti { 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; @@ -3549,6 +4190,7 @@ declare module Ti { 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; @@ -3587,29 +4229,6 @@ declare module Ti { putExtraUri (name: string, value: string) : void; setFlags (flags: number) : void; } - export interface Activity extends Ti.Proxy { - actionBar : Ti.Android.ActionBar; - intent : Ti.Android.Intent; - onCreateOptionsMenu : (...args : any[]) => any; - onPrepareOptionsMenu : (...args : any[]) => any; - requestedOrientation : number; - finish () : void; - getActionBar () : Ti.Android.ActionBar; - getIntent () : Ti.Android.Intent; - getOnCreateOptionsMenu () : (...args : any[]) => any; - getOnPrepareOptionsMenu () : (...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; - setOnCreateOptionsMenu (onCreateOptionsMenu: (...args : any[]) => any) : void; - setOnPrepareOptionsMenu (onPrepareOptionsMenu: (...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 Notification extends Ti.Proxy { audioStreamType : number; contentIntent : Ti.Android.PendingIntent; @@ -3679,6 +4298,7 @@ declare module Ti { 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; @@ -3686,6 +4306,7 @@ declare module Ti { 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; @@ -3837,20 +4458,27 @@ declare module Ti { 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; } @@ -3878,6 +4506,50 @@ declare module Ti { 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; @@ -3919,10 +4591,12 @@ declare module Ti { 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; @@ -3972,6 +4646,7 @@ declare module Ti { 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; @@ -3981,6 +4656,7 @@ declare module Ti { 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; @@ -3995,10 +4671,12 @@ declare module Ti { 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 { @@ -4100,6 +4778,11 @@ declare module Ti { } } 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; @@ -4113,6 +4796,7 @@ declare module Ti { getShowTrayNotification () : boolean; getShowTrayNotificationsWhenFocused () : boolean; getSingleCallback () : boolean; + isGooglePlayServicesAvailable () : number; retrieveDeviceToken (config: CloudPushNotificationConfig) : void; setEnabled (enabled: boolean) : void; setFocusAppOnPush (focusAppOnPush: boolean) : void; @@ -4145,14 +4829,38 @@ declare module Ti { 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; @@ -4224,9 +4932,11 @@ declare module Ti { 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; @@ -4234,7 +4944,9 @@ declare module Ti { 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; @@ -4249,9 +4961,11 @@ declare module Ti { 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; @@ -4259,7 +4973,9 @@ declare module Ti { 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; @@ -4275,12 +4991,15 @@ declare module Ti { 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; @@ -4289,6 +5008,15 @@ declare module Ti { 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; @@ -4315,64 +5043,6 @@ declare module Ti { setVolume (volume: number) : void; stop () : void; } - 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 VideoPlayer extends Ti.UI.View { allowsAirPlay : boolean; autoplay : boolean; @@ -4450,6 +5120,64 @@ declare module Ti { 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; @@ -4494,11 +5222,13 @@ declare module Ti { 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; @@ -4506,11 +5236,13 @@ declare module Ti { 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; @@ -4522,6 +5254,7 @@ declare module Ti { 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; @@ -4533,274 +5266,13 @@ declare module Ti { setSystemWallpaper (image: Ti.Blob, scale: boolean) : 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 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 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 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 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 getBubbleParent () : boolean; - 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 registerForPushNotifications (config: PushNotificationConfig) : void; - export function removeConnectivityListener (callback: (...args : any[]) => any) : void; - export function removeEventListener (name: string, callback: (...args : any[]) => any) : void; - export function setBubbleParent (bubbleParent: boolean) : void; - export function setHttpURLFormatter (httpURLFormatter: (...args : any[]) => any) : void; - export function unregisterForPushNotifications () : 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 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 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; - } - 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; - } - } - 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 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; - 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; - 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 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; @@ -4827,6 +5299,7 @@ declare module Ti { 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; @@ -4867,13 +5340,6 @@ declare module Ti { getPlatformWidth () : number; getXdpi () : number; getYdpi () : number; - setDensity (density: string) : void; - setDpi (dpi: number) : void; - setLogicalDensityFactor (logicalDensityFactor: number) : void; - setPlatformHeight (platformHeight: number) : void; - setPlatformWidth (platformWidth: number) : void; - setXdpi (xdpi: number) : void; - setYdpi (ydpi: number) : void; } export interface Android { API_LEVEL : number; @@ -4943,6 +5409,7 @@ declare module Ti { 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; @@ -4953,8 +5420,9 @@ declare module Ti { export function getAllAlerts () : Array; export function getAllCalendars () : Array; export function getAllEditableCalendars () : Array; + export function getApiName () : string; export function getBubbleParent () : boolean; - export function getCalendarById (id: number) : Ti.Calendar.Calendar; + export function getCalendarById (id: string) : Ti.Calendar.Calendar; export function getDefaultCalendar () : Ti.Calendar.Calendar; export function getEventsAuthorization () : number; export function getSelectableCalendars () : Array; @@ -5087,138 +5555,11 @@ declare module Ti { setRelativeOffset (relativeOffset: number) : 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 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 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 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; @@ -5235,20 +5576,21 @@ declare module Ti { 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) : Ti.Filesystem.File; + 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) : Ti.Filesystem.FileStream; + 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 { @@ -5305,6 +5647,320 @@ declare module Ti { } } + 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; + } + 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; + } + } + 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; + } + } export interface Yahoo { yql (yql: string, callback: (...args : any[]) => any) : void; } @@ -5334,6 +5990,7 @@ declare module Ti { 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; @@ -5348,6 +6005,7 @@ declare module Ti { 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; @@ -5381,6 +6039,7 @@ declare module Ti { 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; @@ -5437,6 +6096,12 @@ declare class FacebookRESTResponsev1 { success : boolean; } +declare class titleAttributesParams { + color : string; + font : Font; + shadow : shadowDict; +} + declare class MapRegionType { latitude : number; latitudeDelta : number; @@ -5462,8 +6127,8 @@ declare class ErrorResponse { success : boolean; } -declare enum CloudPushNotificationsResponse { - +declare class CloudPushNotificationsQueryResponse extends CloudResponse { + subscriptions : Array>; } declare class CloudResponse { @@ -5474,6 +6139,15 @@ declare class CloudResponse { success : boolean; } +declare enum CloudPushNotificationsResponse { + +} + +declare class textFieldSelectedParams { + length : number; + location : number; +} + declare class recurrenceEndDictionary { endDate : Date; occurrenceCount : number; @@ -5513,6 +6187,10 @@ declare module Global { } } +declare class CloudGeoFenceResponse extends CloudResponse { + geo_fences : Array>; +} + declare class ServiceIntentOptions { startMode : number; url : string; @@ -5609,6 +6287,10 @@ declare class ListViewAnimationProperties { position : number; } +declare class CloudPushSchedulesResponse extends CloudResponse { + push_schedules : Array; +} + declare class DataCallbackArgs { address : string; bytesData : Array; @@ -5650,13 +6332,19 @@ declare class CloudEventsResponse extends CloudResponse { events : Array>; } +declare class ReadyStatePayload { + readyState : number; +} + declare class ErrorCallbackArgs { errorCode : number; socket : Ti.Network.Socket.TCP; } -declare enum FailureResponse { - +declare class FailureResponse { + code: Number; + error: string; + success: boolean; } declare class WriteCallbackArgs extends ErrorResponse { @@ -5691,6 +6379,11 @@ declare class ListViewContentInsetOption { duration : number; } +declare class RouteDescription { + inputs : Array; + outputs : Array; +} + declare class CreateStreamArgs { mode : number; source : any; @@ -5772,6 +6465,12 @@ declare class MusicLibraryOptionsType { success : (...args : any[]) => any; } +declare class shadowDict { + blurRadius : number; + color : string; + offset : Dictionary; +} + declare class launchOptions { launchOptionsLocationKey : boolean; source : string; @@ -5813,11 +6512,21 @@ 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>; } @@ -5826,11 +6535,16 @@ 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; @@ -6004,6 +6718,7 @@ declare class NotificationParams { alertBody : string; alertLaunchImage : string; badge : number; + category : string; date : Date; repeat : string; sound : string; @@ -6024,11 +6739,24 @@ declare class Modules { } +declare class ReferenceInsets { + bottom : number; + left : number; + right : number; + top : number; +} + declare class hideStatusBarParams { animated : boolean; animationStyle : number; } +declare class PreviewImageOptions { + error : (...args : any[]) => any; + image : Ti.Blob; + success : (...args : any[]) => any; +} + declare class ListDataItem { properties : Dictionary; template : any; @@ -6062,6 +6790,12 @@ declare class ListViewEdgeInsets { top : number; } +declare class BoundaryIdentifier { + identifier : string; + point1 : Point; + point2 : Point; +} + declare enum CloudEmailsResponse { } @@ -6076,6 +6810,7 @@ declare class Font { fontSize : any; fontStyle : string; fontWeight : string; + textStyle : string; } declare class CloudPlacesResponse extends CloudResponse { @@ -6119,6 +6854,13 @@ 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; @@ -6153,6 +6895,12 @@ declare class showStatusBarParams { animationStyle : number; } +declare class transitionAnimationParam { + duration : number; + tranistionTo : Ti.UI.Animation; + transitionFrom : Ti.UI.Animation; +} + declare class MapPointType { latitude : number; longitude : number; @@ -6173,6 +6921,16 @@ 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; @@ -6189,9 +6947,13 @@ declare class closeWindowParams { animated : boolean; } +declare class CloudLikesResponse extends CloudResponse { + likes : Array>; +} + declare class showParams { animated : boolean; - rect : Dictionary; + rect : Dimension; view : Ti.UI.View; } @@ -6203,6 +6965,10 @@ declare class CloudMessagesResponse extends CloudResponse { messages : Array>; } +declare class CloudPushNotificationsShowChannelResponse extends CloudResponse { + devices : Dictionary; +} + declare class ImageAsCroppedDict { height : number; width : number; @@ -6210,14 +6976,9 @@ declare class ImageAsCroppedDict { y : number; } -declare class PreviewImageOptions { - error : (...args : any[]) => any; - image : Ti.Blob; - success : (...args : any[]) => any; -} - -declare class contentOffsetOption { - animated : boolean; +declare class UserNotificationSettings { + categories : Array; + types : Array; } declare class TableViewAnimationProperties { @@ -6237,4 +6998,4 @@ declare class EncodeStringDict { source : string; sourceLength : number; sourcePosition : number; -} \ No newline at end of file +} diff --git a/vex-js/vex-js.d.ts b/vex-js/vex-js.d.ts new file mode 100644 index 0000000000..118c618672 --- /dev/null +++ b/vex-js/vex-js.d.ts @@ -0,0 +1,45 @@ +// Type definitions for Vex v2.3.2 +// Project: https://github.com/HubSpot/vex +// Definitions by: Greg Cohan +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module vex { + + interface ICSSAttributes { + [property: string]: string | number; + } + + interface IVexOptions { + afterClose?: (() => void); + afterOpen?: ((vexContent: JQuery) => void); + content?: string; + showCloseButton?: boolean; + escapeButtonCloses?: boolean; + overlayClosesOnClick?: boolean; + appendLocation?: HTMLElement | JQuery | string; + className?: string; + css?: ICSSAttributes; + overlayClassName?: string; + overlayCSS?: ICSSAttributes; + contentClassName?: string; + contentCSS?: ICSSAttributes; + closeClassName?: string; + closeCSS?: ICSSAttributes; + } + + interface Vex { + open(options: IVexOptions): JQuery; + close(id?: number): boolean; + closeAll(): boolean; + closeByID(id: number): boolean; + } + +} + +declare module "vex" { + export = vex; +} + +declare var vex: vex.Vex; diff --git a/vex-js/vex-tests.ts b/vex-js/vex-tests.ts new file mode 100644 index 0000000000..ea1778d610 --- /dev/null +++ b/vex-js/vex-tests.ts @@ -0,0 +1,26 @@ +/// +/// + +var vexContent = vex.open({ + afterClose: (() => null), + afterOpen: ((vexContent: JQuery) => null), + content: "

Modal

", + showCloseButton: false, + escapeButtonCloses: true, + overlayClosesOnClick: false, + appendLocation: "body", + className: "vex-dialog", + css: {background: "blue"}, + overlayClassName: "vex-overlay", + overlayCSS: {border: 0}, + contentClassName: "vex-content", + contentCSS: {margin: "0 auto"}, + closeClassName: "vex-close", + closeCSS: {margin: 0} +}); + +var id = vexContent.data().vex.id; + +vex.close(id); +vex.closeByID(id); +vex.closeAll(); diff --git a/yamljs/yamljs-tests.ts b/yamljs/yamljs-tests.ts new file mode 100644 index 0000000000..9780c504d4 --- /dev/null +++ b/yamljs/yamljs-tests.ts @@ -0,0 +1,13 @@ +/// + +import yamljs = require('yamljs'); + +yamljs.load('yaml-testfile.yml'); + +yamljs.parse('this_is_no_ymlstring'); + +yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }}); + +yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }}, 1); + +yamljs.stringify({ a : 'val', b : { ba : 123, bb : 'nothing' }}, 1, 2); \ No newline at end of file diff --git a/yamljs/yamljs.d.ts b/yamljs/yamljs.d.ts new file mode 100644 index 0000000000..65d2fd9239 --- /dev/null +++ b/yamljs/yamljs.d.ts @@ -0,0 +1,14 @@ +// Type definitions for yamljs 0.2.1 +// Project: https://github.com/jeremyfa/yaml.js +// Definitions by: Tim Jonischkat +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "yamljs" { + + export function load(path : string) : any; + + export function stringify(nativeObject : any, inline? : number, spaces? : number) : string; + + export function parse(yamlString : string) : any; + +} \ No newline at end of file