// Base definitions that can't be generated yet
///
type _Omit = Pick>;
type FunctionPropertyNames = {
// tslint:disable-next-line:ban-types
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
}[keyof T];
type Dictionary = Partial<_Omit>>;
interface ProxyEventMap {}
/**
* An extension of the [NSURLConnectionDelegate](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate) protocol to allow users to participate in authentication and resource management for this HTTPClient.
*/
interface APSConnectionDelegate {
}
/**
* Options object for the [accept](Titanium.Network.Socket.TCP.accept) method.
*/
interface AcceptDict {
/**
* Callback to be fired when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state.
*/
error?: (param0: ErrorCallbackArgs) => void;
/**
* Timeout, in milliseconds, for all `write` operations.
*/
timeout?: number;
}
/**
* Argument object passed to the [accepted](Titanium.Network.Socket.TCP.accepted)
* callback when a listener accepts a connection.
*/
interface AcceptedCallbackArgs {
/**
* Socket which represents the inbound connection.
*/
inbound?: Titanium.Network.Socket.TCP;
/**
* Socket which received the connection.
*/
socket?: Titanium.Network.Socket.TCP;
}
/**
* Simple object passed to the callbacks for
* onCreate, onDestroy, onPause, onResume, onStart, onStop, onRestart.
* Additional properties may be set on the Object.
*/
interface ActivityLifecycleCallbackObject {
/**
* The Activity firing the callback.
*/
source?: Titanium.Android.Activity;
}
/**
* Simple object passed to the
* [startActivityForResult](Titanium.Android.Activity.startActivityForResult) callback.
*/
interface ActivityResult {
/**
* Intent that can contain data returned to the caller. Data can be attached to
* the intent as "extras").
*/
intent?: Titanium.Android.Intent;
/**
* Unique, automatically generated integer request code.
*/
requestCode?: number;
/**
* Integer result code that the started activity passed to
* [setResult](Titanium.Android.Activity.setResult).
*/
resultCode?: number;
}
/**
* A JavaScript object holding an `animated` property. Used for many UI methods as a means of specifying some transition should be animated.
*/
interface AnimatedOptions {
/**
* If `true`, animate a transition for the method/value change.
* Note that for most uses cases the default is assumed to be `false`. The exceptions tend to be methods.
*/
animated?: boolean;
}
/**
* A JavaScript object holding `animated` and `duration` properties. Used on iOS For [TableView](Titanium.UI.TableView) and [ListView](Titanium.UI.ListView) content offset transitions.
*/
interface AnimatedWithDurationOptions extends AnimatedOptions {
/**
* The duration in `milliseconds` for animation
*/
duration?: number;
}
/**
* An abstract datatype for specifying an attributed string attribute.
*/
interface Attribute {
/**
* Attribute range.
*/
range: number[];
/**
* Attribute to apply to the text.
*/
type: number;
/**
* Attribute value.
*/
value: any;
}
/**
* The object returned to the method.
*/
interface BackForwardList {
/**
* The item immediately preceding the current item.
*/
backItem?: BackForwardListItem;
/**
* The portion of the list preceding the current item.
*/
backList?: BackForwardListItem[];
/**
* The current item.
*/
currentItem?: BackForwardListItem;
/**
* The item immediately following the current item.
*/
forwardItem?: BackForwardListItem;
/**
* The portion of the list following the current item.
*/
forwardList?: BackForwardListItem[];
}
/**
* The object represents a webpage in the back-forward of a web view.
*/
interface BackForwardListItem {
/**
* The URL of the initial request that created this item.
*/
initialUrl?: string;
/**
* The title of the webpage represented by this item.
*/
title?: string;
/**
* The URL of the webpage represented by this item.
*/
url?: string;
}
/**
* Object describing a button bar or tabbed bar item.
*/
interface BarItemType {
/**
* A succint label associated with the bar item for the device's accessibility service.
*/
accessibilityLabel?: string;
/**
* Whether the button is enabled initially.
*/
enabled?: boolean;
/**
* Button icon. If specified, takes precedence over `title`.
*/
image?: string | Titanium.Blob | Titanium.Filesystem.File;
/**
* Button title, used if no `image` is specified.
*/
title?: string;
/**
* Width for this button.
*/
width?: number;
}
/**
* Simple `Error` instance thrown from the
* [executeAll](Titanium.Database.DB.executeAll) method in case of failure
*/
interface BatchQueryError {
/**
* Index of the failed query
*/
index?: number;
/**
* partial `ResultSet`s of any successful queries before the failure
*/
results?: Titanium.Database.ResultSet[];
}
/**
* Dictionary to specify a boundary identifier for .
*/
interface BoundaryIdentifier {
/**
* Arbitrary identifier for the boundary
*/
identifier?: string;
/**
* Start point for the boundary
*/
point1?: Point;
/**
* End point for the boundary
*/
point2?: Point;
}
/**
* Simple object holding the data for a logical cpu.
*/
interface CPU {
/**
* General description of the CPU
*/
model?: string;
/**
* Speed of the CPU in MHz
*/
speed?: number;
/**
* A collection of timings for this logical CPU.
*/
times?: CPUTimes;
}
/**
* Simple object holding the data for a logical CPU execution times.
*/
interface CPUTimes {
/**
* The number of milliseconds the CPU has spent in idle mode.
*/
idle?: number;
/**
* The number of milliseconds the CPU has spent in irq mode.
*/
irq?: number;
/**
* The number of milliseconds the CPU has spent in nice mode.
*/
nice?: number;
/**
* The number of milliseconds the CPU has spent in sys mode.
*/
sys?: number;
/**
* The number of milliseconds the CPU has spent in user mode.
*/
user?: number;
}
/**
* A media object from the camera or photo gallery.
*/
interface CameraMediaItemType extends SuccessResponse {
/**
* Error code. Returns 0.
*/
code?: number;
/**
* Simple object defining the user's selected crop rectangle, or `null` if the user has not edited the photo. `width`/`height` values are assumed to be in pixels.
*/
cropRect?: Dimension;
/**
* Error message, if any returned.
*/
error?: string;
/**
* The live photo object, as a and
* `undefined` if no live photo is selected.
*/
livePhoto?: Titanium.UI.iOS.LivePhoto;
/**
* The media object, as a [Blob](Titanium.Blob).
*/
media?: Titanium.Blob;
/**
* The type of media, either `MEDIA_TYPE_PHOTO`, `MEDIA_TYPE_LIVEPHOTO` or `MEDIA_TYPE_VIDEO` defined in .
*/
mediaType?: string;
/**
* The path of the image when returning data from the gallery.
*/
path?: string;
/**
* Simple object defining the preview image size. This will be undefined when custom camera overlay is not used. Values are assumed to be in pixels.
*/
previewRect?: Size;
/**
* Indicates if the operation succeeded. Returns `true`.
*/
success?: boolean;
}
/**
* A media object from photo gallery when is `true`.
*/
interface CameraMediaMultipleItemsType extends SuccessResponse {
/**
* The list of selected images.
*/
images?: CameraMediaItemType[];
/**
* The list of selected live photo objects.
*/
livePhotos?: Titanium.UI.iOS.LivePhoto[];
/**
* The list of selected videos.
*/
videos?: CameraMediaItemType[];
}
/**
* Parameters of the open callback
*/
interface CameraOpen {
/**
* Height of the preview camera image
*/
height?: number;
/**
* Width of the preview camera image
*/
width?: number;
}
/**
* Simple object for specifying options to [showCamera](Titanium.Media.showCamera).
*/
interface CameraOptionsType {
/**
* Specifies if the media should be editable after capture/selection.
*/
allowEditing?: boolean;
/**
* Function to call if the user presses the back button.
*/
androidback?: (param0: FailureResponse) => void;
/**
* Specifies if the dialog should be animated upon showing and hiding.
*/
animated?: boolean;
/**
* Controls the type of arrow and position of the popover.
*/
arrowDirection?: number;
/**
* Specifies if the camera should be hidden automatically after the media capture is completed.
*/
autohide?: boolean;
/**
* Determines if the camera preview should rotate or not.
*/
autorotate?: boolean;
/**
* Function to call if the user presses the cancel button.
*/
cancel?: (param0: FailureResponse) => void;
/**
* Function to call upon receiving an error.
*/
error?: (param0: FailureResponse) => void;
/**
* Show the camera in a popover.
*/
inPopOver?: boolean;
/**
* Array of media type constants to allow. Note: If you want to select live photos, iOS only allows
* you to select existing live photos from the gallery, capturing new live photos is not supported by
* iOS public API, yet.
*/
mediaTypes?: string[];
/**
* Function to call when the camera is shown
*/
open?: (param0: CameraOpen) => void;
/**
* View to added as an overlay to the camera UI (on top).
*/
overlay?: Titanium.UI.View;
/**
* View to position the camera or photo gallery popover on top of.
*/
popoverView?: Titanium.UI.View;
/**
* Function to call during recording. Returns size and duration.
*/
recording?: (param0: CameraRecordingCallback) => void;
/**
* Specifies if the media should be saved to the photo gallery upon successful capture.
*/
saveToPhotoGallery?: boolean;
/**
* Indicates if the built-in camera controls should be displayed.
*/
showControls?: boolean;
/**
* Function to call when the camera is closed after a successful capture/selection.
*/
success?: (param0: CameraMediaItemType) => void;
/**
* Maximum height of the saved image. Depending on your phone and your value this might not be
* exactly the value you specify. Check `Ti.Media.cameraOutputSizes` first.
*/
targetImageHeight?: number;
/**
* Maximum width of the saved image. Depending on your phone and your value this might not be
* exactly the value you specify. Check `Ti.Media.cameraOutputSizes` first.
*/
targetImageWidth?: number;
/**
* Transformation matrix to apply to the camera or photogallery view.
*/
transform?: Titanium.UI.Matrix2D;
/**
* Maximum duration (in milliseconds) to allow video capture before completing.
*/
videoMaximumDuration?: number;
/**
* Constant to indicate the video quality during capture.
*/
videoQuality?: number;
/**
* Opens the camera with the specified camera direction.
*/
whichCamera?: number;
/**
* Specifies if pinch to zoom is enabled or not.
*/
zoomEnabled?: boolean;
}
/**
* Infos about the current video recording
*/
interface CameraRecordingCallback {
/**
* Length in milliseconds
*/
duration?: number;
/**
* Size of the video in bytes
*/
size?: number;
}
/**
* Dictionary describing the items for .
*/
interface ClipboardItemsType {
/**
* An array of key-value items to add to the clipboard. The key must a valid mime-type
* matching the mime-type of the value.
* Alterntaively, iOS supports using [Universal Type Identifiers](https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html)
*/
items?: any[];
/**
* The privacy options to apply to all the items on the clipboard. The available options are
* described in `Ti.UI.CLIPBOARD_OPTION_*`. Depending on the key, the value can be a Date or
* Boolean.
*/
options?: any;
}
/**
* Argument object passed to the [connected](Titanium.Network.Socket.TCP.connected) callback when the socket connects.
*/
interface ConnectedCallbackArgs {
/**
* Socket instance that has been connected.
*/
socket?: Titanium.Network.Socket.TCP;
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface ContactsAuthorizationResponse extends ErrorResponse {
}
/**
* Simple object for defining a single image in a cover flow view.
*/
interface CoverFlowImageType {
/**
* Display height of the image, in Apple points.
*/
height?: number;
/**
* Image to use, as a local file URL, `Blob`, or `File`.
*/
image?: string | Titanium.Blob | Titanium.Filesystem.File;
/**
* Display width for the image, in Apple points.
*/
width?: number;
}
/**
* Arguments to be passed to createBuffer
*/
interface CreateBufferArgs {
/**
* The byte order of this buffer.
*/
byteOrder?: number;
/**
* The length of the buffer.
*/
length?: number;
/**
* The type of data encoding to use with `value`.
*/
type?: string;
/**
* An initial value which will be encoded and placed in the buffer. If value is a Number, type must also be set. (this is simply a convenient way of calling or and placing the encoded value in the returned buffer.)
*/
value?: string | number;
}
/**
* Argument passed to [createStream](Titanium.Stream.createStream).
*/
interface CreateStreamArgs {
/**
* Mode to open the stream in.
*/
mode?: number;
/**
* Object that the stream will read from or write to.
*/
source?: Titanium.Blob | Titanium.Buffer;
}
/**
* Dictionary object of parameters for the .
*/
interface CutoutSize {
/**
* The height of the cutout
*/
height?: number;
/**
* The left position of the cutout.
*/
left?: number;
/**
* The top position of the cutout.
*/
top?: number;
/**
* The width of the cutout
*/
width?: number;
}
/**
* The parameter passed to the or callback.
*/
interface DataCreationResult {
/**
* The created data.
*/
data?: Titanium.Blob;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Indicates if the data creation successful or not.
*/
success?: boolean;
}
/**
* Success callback in .
*/
interface DataCreationResultAndroid {
/**
* The created data.
*/
data?: Titanium.Blob;
}
/**
* Generic type for elements of returned `Array` from
*/
interface DateTimeFormattedPart {
/**
* The type of the locale-specific token.
* See [MDN formatToParts documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts)
* for details on the possible types and typical values.
*/
type?: string;
/**
* The locale-specific token value
*/
value?: string;
}
/**
* Named parameters for .
*/
interface DecodeNumberDict {
/**
* byte order to decode with.
*/
byteOrder?: number;
/**
* Index in the `source` buffer of the first byte of data to decode.
*/
position?: number;
/**
* Buffer to decode.
*/
source: Titanium.Buffer;
/**
* The encoding type to use.
*/
type: string;
}
/**
* Named parameters for .
*/
interface DecodeStringDict {
/**
* Character set to use when encoding this string to bytes.
*/
charset?: string;
/**
* Number of bytes to decode.
*/
length?: number;
/**
* Index in the `source` buffer of the first byte of data to decode.
*/
position?: number;
/**
* Buffer to decode.
*/
source: Titanium.Buffer;
}
/**
* A simple object consisting of the position and size measurements. Effectively combines and but ensures numeric x/y values.
*/
interface Dimension extends Size {
/**
* The x-axis coordinate of the position. When returned by the position is relative to it's parent.
*/
x?: number;
/**
* The y-axis coordinate of the position. When returned by the position is relative to it's parent.
*/
y?: number;
}
/**
* An extension of where Android returns additional absolute X/Y values/properties for
*/
interface DimensionWithAbsolutes extends Dimension {
/**
* The x-axis coordinate of the position relative to the main window.
*/
absoluteX?: number;
/**
* The y-axis coordinate of the position relative to the main window.
*/
absoluteY?: number;
}
/**
* A simple object for specifying options when showing or dismissing a .
*/
interface DocumentViewerOptions {
/**
* Indicates whether to animate the transition.
*/
animated?: boolean;
/**
* Anchors the options menu to the specified view.
*/
view?: Titanium.UI.View;
}
/**
* Named parameters for .
*/
interface EncodeNumberDict {
/**
* Byte order to encode with.
*/
byteOrder?: number;
/**
* Destination buffer.
*/
dest: Titanium.Buffer;
/**
* Index in the `dest` buffer of the first byte of encoded data.
*/
position?: number;
/**
* Number to encode.
*/
source: number;
/**
* Encoding type to use.
*/
type: string;
}
/**
* Named parameters for .
*/
interface EncodeStringDict {
/**
* Character encoding to use when encoding this string to bytes.
*/
charset?: string;
/**
* Destination buffer.
*/
dest: Titanium.Buffer;
/**
* Index in the `dest` buffer of the first byte of the encoded string.
*/
destPosition?: number;
/**
* Source string to encode.
*/
source: string;
/**
* Number of characters in `source` to encode.
*/
sourceLength?: number;
/**
* Position in `source` to start encoding.
*/
sourcePosition?: number;
}
/**
* Object passed to the error callback when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state.
*/
interface ErrorCallbackArgs extends FailureResponse {
/**
* Error code. Returns a non-zero value.
*/
code?: number;
/**
* Socket that experienced the error.
*/
socket?: Titanium.Network.Socket.TCP;
/**
* Indicates if the operation succeeded. Returns `false`.
*/
success?: boolean;
}
/**
* Properties used in any event or callback which needs to report a success or failure.
*/
interface ErrorResponse {
/**
* Error code. Returns 0 if `success` is `true`.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Indicates if the operation succeeded.
*/
success?: boolean;
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface EventsAuthorizationResponse {
/**
* Error code, if any returned.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Indicates whether the request succeeded.
*/
success?: boolean;
}
/**
* Properties used in any event or callback which needs to report a failure.
*/
interface FailureResponse extends ErrorResponse {
/**
* Error code. Returns a non-zero value.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Indicates if the operation succeeded. Returns `false`.
*/
success?: boolean;
}
/**
* An object representing a FairPlay Streaming configuration.
*/
interface FairPlayConfiguration {
/**
* The FairPlay Streaming public certificate to authenticate the content key request.
*/
certificate?: Titanium.Blob;
/**
* The FairPlay Streaming license URL to handle the server-side authentication flow.
*/
licenseURL?: string;
}
/**
* An abstract datatype for specifying a text font.
*/
interface Font {
/**
* Specifies the font family or specific font to use.
*/
fontFamily?: string;
/**
* Font size, in platform-dependent units.
*/
fontSize?: number | string;
/**
* Font style. Valid values are "italic" or "normal".
*/
fontStyle?: string;
/**
* Font weight. Valid values are "bold", "semibold", "normal", "thin",
* "light" and "ultralight".
*/
fontWeight?: string;
/**
* The text style for the font.
*/
textStyle?: string;
}
/**
* Simple object returned in the callback from the
* [forwardGeocoder](Titanium.Geolocation.forwardGeocoder) method.
* Note that Android includes a number of extra fields.
*/
interface ForwardGeocodeResponse extends ErrorResponse {
/**
* Estimated accuracy of the geocoding, in meters.
*/
accuracy?: number;
/**
* Full address.
*/
address?: string;
/**
* City name.
*/
city?: string;
/**
* Error code. Returns 0 if `success` is `true`.
*/
code?: number;
/**
* Country name.
*/
country?: string;
/**
* Country code.
*/
countryCode?: string;
/**
* Country code. Same as `countryCode`.
*/
country_code?: string;
/**
* Display address. Identical to `address`.
*/
displayAddress?: string;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Latitude of the geocoded address.
*/
latitude?: string;
/**
* Longitude of the geocoded address.
*/
longitude?: string;
/**
* Postal code.
*/
postalCode?: string;
/**
* First line of region.
*/
region1?: string;
/**
* Not used.
*/
region2?: string;
/**
* Street name, without street address.
*/
street?: string;
/**
* Street name.
*/
street1?: string;
/**
* Indicates if the operation succeeded.
*/
success?: boolean;
}
/**
* Simple object representing a place, returned in the callback from the
* [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) method.
*/
interface GeocodedAddress {
/**
* Full address.
*/
address?: string;
/**
* City name.
*/
city?: string;
/**
* Country name.
*/
country?: string;
/**
* Country code.
*/
countryCode?: string;
/**
* Latitude of the geocoded point.
*/
latitude?: number;
/**
* Longitude of the geocoded point.
*/
longitude?: number;
/**
* Postal code
*/
postalCode?: string;
/**
* First line of region.
*/
region1?: string;
/**
* Not used.
*/
region2?: string;
/**
* State name.
*/
state?: string;
/**
* Street name, without street address.
*/
street?: string;
/**
* Street name.
*/
street1?: string;
}
/**
* Dictionary object of parameters used to register the application with local notifications using
* the method.
*/
interface GetUserNotificationSettings {
/**
* The current alert settings.
*/
alertSetting?: number;
/**
* The current alert style used to display notifications.
*/
alertStyle?: number;
/**
* The current authorization status for using notifications.
*/
authorizationStatus?: number;
/**
* The current badge settings.
*/
badgeSetting?: number;
/**
* The current CarPlay settings.
*/
carPlaySetting?: number;
/**
* Set of categories of user notification actions required by the application to use.
*/
categories?: Titanium.App.iOS.UserNotificationCategory[];
/**
* The authorization status to play sounds for critical alerts.
* Available in Titanium SDK 7.4.0 and later.
*/
criticalAlertSetting?: number;
/**
* The current lock-screen settings.
*/
lockScreenSetting?: number;
/**
* The current notification-center settings.
*/
notificationCenterSetting?: number;
/**
* A Boolean value indicating the system displays a button for in-app notification settings.
* Available in Titanium SDK 7.4.0 and later.
*/
providesAppNotificationSettings?: number;
/**
* The current sound settings.
*/
soundSetting?: number;
/**
* Notification types to use.
*/
types?: number[];
}
/**
* Object of options for configuring the glass effect on a .
*/
interface GlassEffectConfiguration {
/**
* Whether the glass effect responds to user interaction.
*/
interactive?: boolean;
/**
* The style of the glass effect.
*/
style: number;
/**
* The tint color to apply to the glass effect.
*/
tintColor?: string;
}
/**
* A simple object defining a color gradient.
*/
interface Gradient {
/**
* Set to `true` to continue filling with the final color beyond the `endPoint`.
*/
backfillEnd?: boolean;
/**
* Set to `true` to continue filling with the starting color beyond the `startPoint`.
*/
backfillStart?: boolean;
/**
* An array of colors, as a color name or hex triplet.
*/
colors?: string[] | GradientColorRef[];
/**
* End point for the gradient.
*/
endPoint?: Point;
/**
* For a radial gradient, the radius at the `endPoint`.
*/
endRadius?: number;
/**
* Start point for the gradient.
*/
startPoint?: Point;
/**
* For a radial gradient, the radius at the `startPoint`.
*/
startRadius?: number;
/**
* Type of gradient, either 'linear' or 'radial'.
*/
type?: string;
}
/**
* A simple object consisting of a color and an offset.
*/
interface GradientColorRef {
/**
* Color value at this point in the gradient, as a color name or hex triplet.
*/
color?: string | Titanium.UI.Color;
/**
* The color's normalized position within the gradient, ranging from 0 (start) to 1 (end).
*/
offset?: number;
}
/**
* Simple object holding compass heading data.
*/
interface HeadingData {
/**
* Accuracy of the compass heading, in platform-specific units.
*/
accuracy?: number;
/**
* Declination in degrees from magnetic North.
*/
magneticHeading?: number;
/**
* Timestamp for the heading data, in milliseconds.
*/
timestamp?: number;
/**
* Declination in degrees from true North.
*/
trueHeading?: number;
/**
* Raw geomagnetic data for the X axis.
*/
x?: number;
/**
* Raw geomagnetic data for the Y axis.
*/
y?: number;
/**
* Raw geomagnetic data for the Z axis.
*/
z?: number;
}
/**
* Argument passed to the [getCurrentHeading](Titanium.Geolocation.getCurrentHeading) callback.
*/
interface HeadingResponse extends ErrorResponse {
/**
* Error code.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* If `success` is true, the actual heading data.
*/
heading?: HeadingData;
/**
* Indicates a successful operation.
*/
success?: boolean;
}
/**
* Dictionary object of parameters for horizontal-only insets applied to [Table](Titanium.UI.TableView) and [List](Titanium.UI.ListView) views. Only `left` and `right` properties are used (see ).
*/
interface HorizontalInsets {
/**
* Left padding/inset
*/
left?: number;
/**
* Right padding/inset
*/
right?: number;
}
/**
* Template that represents the basic appearance of a list item.
*/
interface ItemTemplate {
/**
* Contains an array of subview templates to be added (in order) as children to this view.
*/
childTemplates?: ViewTemplate[];
/**
* Contains key-value pairs of view events and their listeners that are applied to the ListItem.
*/
events?: any;
/**
* Contains key-value pairs of view properties and their values that are applied to the ListItem.
*/
properties?: Dictionary;
}
/**
* See [TextView.setLineSpacing](https://developer.android.com/reference/android/widget/TextView#setLineSpacing(float,%20float))
*/
interface LabelLineSpacing {
/**
* The value in pixels that should be added to each line other than the last line. This will be applied after the multiplier
*/
add?: number;
/**
* The value by which each line height other than the last line will be multiplied by
*/
multiply?: number;
}
/**
* Dictionary object of parameters used to identify an incoming URL that is handled
* by the application.
*/
interface LaunchOptionsType {
/**
* The application or service that triggered the handled URL.
*/
source?: string;
/**
* The URL that was triggered by the application or service.
*/
url?: string;
}
/**
* Represents displayed item data.
*/
interface ListDataItem {
/**
* Contains key-value pairs of view properties and their values that are applied to the
* `ListItem`.
*/
properties?: Dictionary;
/**
* Template ID configured with the property or
* .
*/
template?: string | number;
[index: string]: any;
}
/**
* The arguments for the and events.
*/
interface ListItemEventType {
/**
* The item ID bound to the list item that generated the event.
*/
itemId?: string;
/**
* Item index.
*/
itemIndex?: number;
/**
* List section if the item is contained in a list section.
*/
section?: Titanium.UI.ListSection;
/**
* Section index.
*/
sectionIndex?: number;
}
/**
* A simple object for specifying the animation properties to use when inserting or deleting
* sections or cells, or scrolling the list.
*/
interface ListViewAnimationProperties {
/**
* Whether this list change should be animated. Ignored if any `animationStyle` value is specified.
*/
animated?: boolean;
/**
* Type of animation to use for cell insertions and deletions.
*/
animationStyle?: number;
/**
* Specifies what position to scroll the selected cell to.
*/
position?: number;
}
/**
* A simple object that represents an index entry in a `ListView`.
*/
interface ListViewIndexEntry {
/**
* Section index associated with this title.
*/
index?: number;
/**
* Title to display in the index bar.
*/
title?: string;
}
/**
* The parameter for [setMarker](Titanium.UI.ListView.setMarker) and [addMarker](Titanium.UI.ListView.addMarker) methods.
*/
interface ListViewMarkerProps {
/**
* The itemIndex of the reference item.
*/
itemIndex?: number;
/**
* The sectionIndex of the reference item.
*/
sectionIndex?: number;
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface LocationAccuracyAuthorizationResponse extends ErrorResponse {
/**
* The level of location accuracy the app has granted.
*/
accuracyAuthorization?: number;
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface LocationAuthorizationResponse extends ErrorResponse {
}
/**
* Simple object holding the data for a location update.
*/
interface LocationCoordinates {
/**
* Accuracy of the location update, in meters.
*/
accuracy?: number;
/**
* Altitude of the location update, in meters.
*/
altitude?: number;
/**
* Vertical accuracy of the location update, in meters.
*/
altitudeAccuracy?: number;
/**
* The floor of the building on which the user is located.
*/
floor?: LocationCoordinatesFloor;
/**
* Compass heading, in degrees. May be unknown if device is not moving. On
* iOS, a negative value indicates that the heading data is not valid.
*/
heading?: number;
/**
* Latitude of the location update, in decimal degrees.
*/
latitude?: number;
/**
* Longitude of the location update, in decimal degrees.
*/
longitude?: number;
/**
* Current speed in meters/second. On iOS, a negative value indicates that the
* heading data is not valid or the accuracy is configured incorrectly.
* Note: Due to the Apple Geolocation API, set the
* property to in order to properly
* measure speed changes and prevent the app from returning negative values.
*/
speed?: number;
/**
* Timestamp for this location update, in milliseconds.
*/
timestamp?: number;
}
/**
* Simple object holding floor of the building on which the user is located.
*/
interface LocationCoordinatesFloor {
/**
* The logical floor of the building.
*/
level?: number;
}
/**
* Simple object describing a location provider.
*/
interface LocationProviderDict {
/**
* Accuracy of the location provider, either fine (1) or coarse (2).
*/
accuracy?: number;
/**
* Name of the location provider.
*/
name?: string;
/**
* Power consumption for this provider, either low (1), medium (2), or high (3).
*/
power?: number;
}
/**
* Argument passed to the [getCurrentPosition](Titanium.Geolocation.getCurrentPosition) callback.
*/
interface LocationResults extends ErrorResponse {
/**
* If `success` is true, actual location data for this update.
*/
coords?: LocationCoordinates;
/**
* If `success` is true, object describing the location provider generating this update.
*/
provider?: LocationProviderDict;
}
/**
* Simple object passed to to initialize a matrix.
*/
interface Matrix2DCreationDict {
/**
* Point to rotate around, specified as a dictionary object with `x` and `y`
* properties, where { x: 0.5, y: 0.5 } represents the center of whatever is being
* rotated.
*/
anchorPoint?: Point;
/**
* Rotation angle, in degrees. See the [rotate](Titanium.UI.Matrix2D.rotate) method
* for a discussion of rotation.
*/
rotate?: number;
/**
* Scale the matrix by the specified scaling factor. The same scaling factor is used
* for both horizontal and vertical scaling.
*/
scale?: number;
}
/**
* Simple object passed to to initialize a matrix.
*/
interface Matrix3DCreationDict {
/**
* Scale the matrix by the specified scaling factor.
*/
scale?: number;
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface MediaAuthorizationResponse extends ErrorResponse {
}
/**
* A full query descriptor for a filtering predicate.
*/
interface MediaQueryInfoType {
/**
* Whether or not the predicate is for an exact match. The default is `true`.
*/
exact?: boolean;
/**
* The value for the given predicate. See the descriptions in for information about which properties require which values.
*/
value?: number | string | boolean;
}
/**
* A specifier for a media library query. By default, filters perform an exact match.
*/
interface MediaQueryType {
/**
* The album artist to filter on. Value should be a String.
*/
albumArtist?: MediaQueryInfoType | string;
/**
* The album artist persistent ID to filter on. Value should be a Number.
*/
albumArtistPersistentID?: MediaQueryInfoType | number;
/**
* The album persistent ID to filter on. Value should be a Number.
*/
albumPersistentID?: MediaQueryInfoType | number;
/**
* The album title to filter on. Value should be a String.
*/
albumTitle?: MediaQueryInfoType | string;
/**
* The artist to filter on. Value should be a String.
*/
artist?: MediaQueryInfoType | string;
/**
* The composer to filter on. Value should be a String.
*/
composer?: MediaQueryInfoType | string;
/**
* The composer persistent ID to filter on. Value should be a Number.
*/
composerPersistentID?: MediaQueryInfoType | number;
/**
* The genre to filter on. Value should be a String.
*/
genre?: MediaQueryInfoType | string;
/**
* The genre persistent ID to filter on. Value should be a Number.
*/
genrePersistentID?: MediaQueryInfoType | number;
/**
* A constant that specifies the ordering of the result array.
*/
grouping?: number;
/**
* Filter by whether or not the item is a protected asset.
* Value should be a Boolean.
*/
hasProtectedAsset?: MediaQueryInfoType | boolean;
/**
* Filter by whether or not the item is a cloud item.
* Value should be a Boolean.
*/
isCloudItem?: MediaQueryInfoType | boolean;
/**
* Filter by whether or not the item is a compilation.
* The value should be a Boolean.
*/
isCompilation?: MediaQueryInfoType | boolean;
/**
* The media type to filter on.
*/
mediaType?: MediaQueryInfoType | number;
/**
* The persistent ID to filter on. Value should be a Number.
*/
persistentID?: MediaQueryInfoType | number;
/**
* The play count to filter on. Value should be a Number.
*/
playCount?: MediaQueryInfoType | number;
/**
* The podcast persistent ID to filter on. Value should be a Number.
*/
podcastPersistentID?: MediaQueryInfoType | number;
/**
* The podcast title to filter on. Value should be a String.
*/
podcastTitle?: MediaQueryInfoType | string;
/**
* The title to filter on. Value should be a String.
*/
title?: MediaQueryInfoType | string;
}
/**
* Simple object passed to the [scanMediaFiles](Titanium.Media.Android.scanMediaFiles) callback.
*/
interface MediaScannerResponse {
/**
* Path to the media file that was scanned.
*/
path?: string;
/**
* URI to the file if it was scanned and added to the media library, or `null`
* if the file was not added.
*/
uri?: string;
}
/**
* Dictionary of options for showing a menu popup with .
*/
interface MenuPopupShowParams {
/**
* Determines whether the menu popup should be opened or closed animated.
*/
animated?: boolean;
/**
* Indicates the arrow direction of the menu popup.
*/
arrowDirection?: number;
/**
* The view where the menu pop is shown at.
*/
view: Titanium.UI.View;
}
/**
* Reply message received from watch app.
*/
interface MessageReply {
/**
* Error code. Returns 0 if `success` is `true`.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Reply message from watch app.
*/
message?: any;
/**
* Indicates if the operation succeeded.
*/
success?: boolean;
}
/**
* An object for setting `min`/`max` value pairs.
*/
interface MinMaxOptions {
/**
* Maximum value
*/
max?: number;
/**
* Minimum value
*/
min?: number;
}
/**
* Simple object used to describe the size of a movie.
*/
interface MovieSize {
/**
* Height of the movie.
*/
height?: number;
/**
* Width of the movie.
*/
width?: number;
}
/**
* Simple object for specifying options to [openMusicLibrary](Titanium.Media.openMusicLibrary).
*/
interface MusicLibraryOptionsType {
/**
* Set to `true` to allow the user to select multiple items from the library.
*/
allowMultipleSelections?: boolean;
/**
* Boolean if the dialog should be animated when showing and hiding.
*/
animated?: boolean;
/**
* Specifies that the library should be hidden automatically after media selection is completed.
*/
autohide?: boolean;
/**
* Function to call if the user presses the cancel button.
*/
cancel?: (param0: FailureResponse) => void;
/**
* Function to call upon receiving an error.
*/
error?: (param0: FailureResponse) => void;
/**
* An array of media type constants defining selectable media.
*/
mediaTypes?: number | number[];
/**
* Function to call when the music library selection is made.
*/
success?: (param0: MusicLibraryResponseType) => void;
}
/**
* Simple object passed to the [openMusicLibrary](Titanium.Media.openMusicLibrary)
* `success` callback function.
*/
interface MusicLibraryResponseType {
/**
* A list of all the items chosen by the user.
*/
items?: Titanium.Media.Item[];
/**
* A single representative of the selected items.
*/
representative?: Titanium.Media.Item;
/**
* Media types in this collection, represented as the bitwise OR of the media type
* values for all media types represented in `items`.
*/
types?: number;
}
/**
* The parameter passed to the `error` callback of .
*/
interface NotificationChannels {
/**
* ID of the channel
*/
id?: string;
/**
* Name of the channel
*/
name?: string;
}
/**
* Dictionary object of parameters used to create a notification using
* .
*/
interface NotificationParams {
/**
* Alert button text ('Open', by default) or home text ('Press Home to unlock', by default)
* to display.
*/
alertAction?: string;
/**
* Alert message to display.
*/
alertBody?: string;
/**
* Image to display instead of `Default.png` when launching the application.
*/
alertLaunchImage?: string;
/**
* Alert subtitle to display.
*/
alertSubtitle?: string;
/**
* Alert title to display.
*/
alertTitle?: string;
/**
* Notification attachments to display.
*/
attachments?: UserNotificationAttachment[];
/**
* Application badge value.
*/
badge?: number;
/**
* String identifier of category of actions to be displayed for an interactive notification.
*/
category?: string;
/**
* Date and time for the notification to occur.
*/
date?: Date;
/**
* The notification identifier.
*/
identifier: string;
/**
* Region the notification will be triggered in. Allowed parameter are:
* - `latitude`: Latitude of the location center, in decimal degrees (required).
* - `longitude`: Longitude of the location center, in decimal degrees (required).
* - `triggersOnce`: Whether or not the notification will only fire once (optional, default: true).
*/
region?: any;
/**
* Interval to repeat the notification. One of `weekly`, `daily`, `yearly,` `monthly`.
*/
repeat?: string;
/**
* Path to the sound file to play when notification occurs, relative to the `Resources` folder.
*/
sound?: string;
/**
* The string the notification adds to the category's summary format string.
*/
summaryArgument?: string;
/**
* The number of items the notification adds to the category's summary format string.
*/
summaryArgumentCount?: string;
/**
* Timezone of the date configured for the notification. If not set, the system timezone is used.
*/
timezone?: string;
/**
* Data to pass to the application with the notification event.
*/
userInfo?: any;
}
/**
* Generic type for elements of returned `Array` from
*/
interface NumberFormattedPart {
/**
* The type of the locale-specific token.
* See [MDN formatToParts documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/formatToParts)
* for details on the possible types and typical values.
*/
type?: string;
/**
* The locale-specific token value
*/
value?: string;
}
/**
* An object returned when the callback is fired.
*/
interface OnLinkURLResponse {
/**
* The URL of the link that should be navigated to.
*/
url?: string;
}
/**
* The optional options to pass to the URL handling (iOS 10+). Pass a
* dictionary with one or more of the following string-keys:
* * `UIApplicationOpenURLOptionsSourceApplicationKey` (String value)
* * `UIApplicationOpenURLOptionsAnnotationKey` (Array value)
* * `UIApplicationOpenURLOptionsOpenInPlaceKey` (Boolean value)
* * `UIApplicationOpenURLOptionUniversalLinksOnly` (Boolean value)
* Read more about the available keys in the [Apple documentation](https://developer.apple.com/documentation/uikit/uiapplicationopenurloptionskey?language=objc).
*/
interface OpenURLOptions {
/**
* When you include this key in the options dictionary, the method opens the URL only if the URL is a valid universal link and there is an installed app capable of opening that URL.
*/
UIApplicationOpenURLOptionUniversalLinksOnly?: boolean;
/**
* contains the information passed to a document interaction controller object's annotation property.
*/
UIApplicationOpenURLOptionsAnnotationKey?: any[];
/**
* When the value of this property is `false`, you must copy the document to maintain access to it. If the flag is not set, you also must copy the document before you can use it.
*/
UIApplicationOpenURLOptionsOpenInPlaceKey?: boolean;
/**
* The value of this key is an String containing the bundle ID of the app that made the request. If the request originated from another app belonging to your team, UIKit sets the value of this key to the ID of that app. If the team identifier of the originating app is different than the team identifier of the current app, the value of the key is nil.
*/
UIApplicationOpenURLOptionsSourceApplicationKey?: string;
}
/**
* Simple object passed to the callbacks for
* onPrepareOptionsMenu and onCreateOptionsMenu.
* Additional properties may be set on the Object.
*/
interface OptionsMenuCallbackObject {
/**
* The relevant Menu.
*/
menu?: Titanium.Android.Menu;
}
/**
* Dictionary object of parameters for the padding/insets applied to all kinds of views.
*/
interface Padding extends HorizontalInsets {
/**
* Bottom padding/inset
*/
bottom?: number;
/**
* Top padding/inset
*/
top?: number;
}
/**
* An abstract datatype for specifying an Paragraph style attribute.
*/
interface ParagraphAttribute {
/**
* The text alignment of the receiver.
*/
alignment?: number;
/**
* A Boolean value indicating whether the system may tighten inter-character spacing
* before truncating text.
*/
allowsDefaultTighteningForTruncation?: boolean;
/**
* The indentation of the first line of the receiver.
*/
firstLineHeadIndent?: number | string;
/**
* The indentation of the lines of lines other than the first.
*/
headIndent?: number | string;
/**
* The threshold of paragraph for hyphenation.
*/
hyphenationFactor?: number;
/**
* The mode that should be used to break lines in the receiver.
*/
lineBreakMode?: number;
/**
* The line height multiple.
*/
lineHeightMultiple?: number;
/**
* The distance in points between the bottom of one line fragment and the top of the next.
*/
lineSpacing?: number | string;
/**
* The maximum line height of receiver.
*/
maximumLineHeight?: number | string;
/**
* The minimum height of receiver.
*/
minimumLineHeight?: number | string;
/**
* The space after the end of the paragraph.
*/
paragraphSpacingAfter?: number | string;
/**
* The distance between the top of paragraph and the beginning of its text content.
*/
paragraphSpacingBefore?: number | string;
/**
* The trailing indentation of the receiver.
*/
tailIndent?: number | string;
}
/**
* Simple object for specifying options to
* [openPhotoGallery](Titanium.Media.openPhotoGallery).
*/
interface PhotoGalleryOptionsType {
/**
* Specifies if the media should be editable after capture/selection.
*/
allowEditing?: boolean;
/**
* Specifies if the user should be able to select multiple photos.
*/
allowMultiple?: boolean;
/**
* Specifies if the video should be transcoded (using highest quality preset) . If set to false no video transcoding will be performed.
*/
allowTranscoding?: boolean;
/**
* Specifies if the dialog should be animated upon showing and hiding.
*/
animated?: boolean;
/**
* Controls the type of arrow and position of the popover.
*/
arrowDirection?: number;
/**
* Specifies if the photo gallery should be hidden automatically after the media
* selection is completed.
*/
autohide?: boolean;
/**
* Function to call if the user presses the cancel button.
*/
cancel?: (param0: FailureResponse) => void;
/**
* Function to call upon receiving an error.
*/
error?: (param0: FailureResponse) => void;
/**
* Specifies the number of images a user can select at maximum.
*/
maxImages?: boolean;
/**
* Array of media type constants to allow.
* Live photos is only supported on the iOS platform, starting with iOS 9.1. If you want
* to allow live photos with , you also need to specify
* at least as a fallback. If you do not allow live
* photos, they still can be selected, but will be represented as a normal static photo.
*/
mediaTypes?: string[];
/**
* Do not include the blob in the result
*/
pathOnly?: boolean;
/**
* View to position the photo gallery popover on top of.
*/
popoverView?: Titanium.UI.View;
/**
* Specifies number of media item that can be selected.
*/
selectionLimit?: boolean;
/**
* Function to call when the photo gallery is closed after a successful selection.
*/
success?: ((param0: CameraMediaItemType) => void) | ((param0: CameraMediaMultipleItemsType) => void);
}
/**
* A pair of coordinates used to describe the location of a .
*/
interface Point {
/**
* The x-axis coordinate of this point.
*/
x?: number | string;
/**
* The y-axis coordinate of this point.
*/
y?: number | string;
}
/**
* Simple `Error` argument provided to the callback from the
* [executeAllAsync](Titanium.Database.DB.executeAllAsync) method in case of failure
*/
interface PossibleBatchQueryError {
/**
* Index of the failed query
*/
index?: number;
}
/**
* The parameter passed to the `error` callback of .
*/
interface PreviewImageError extends FailureResponse {
/**
* Error code, if applicable.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Description of the error.
* @deprecated Use `error` property instead
*/
message: never;
/**
* Indicates if the operation succeeded. Returns `false`.
*/
success?: boolean;
}
/**
* Options passed to .
*/
interface PreviewImageOptions {
/**
* Function called back if the preview fails. Check the `message` property of passed back parameter.
*/
error?: (param0: PreviewImageError) => void;
/**
* The image to preview. Must be a blob based on a file, such as from .
*/
image?: Titanium.Blob;
/**
* Function to be called back if the preview succeeds. No info is passed.
*/
success?: (param0: SuccessResponse) => void;
}
/**
* Argument passed to the callback each time the
* [pump](Titanium.Stream.pump) operation has new data to deliver.
*/
interface PumpCallbackArgs extends ErrorResponse {
/**
* Buffer object holding the data currently being pumped to the handler method.
*/
buffer?: Titanium.Buffer;
/**
* Number of bytes being passed to this invocation of the handler, or
* -1 in the event of an error or end of stream.
*/
bytesProcessed?: number;
/**
* Error code. Returns 0 if `success` is `true`.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Stream being read from.
*/
source?: Titanium.IOStream;
/**
* Indicates if the operation succeeded.
*/
success?: boolean;
/**
* Total number of bytes read from the stream so far,
* including the data passed to this current invocation of the handler.
*/
totalBytesProcessed?: number;
}
/**
* Simple object for specifying push notification options to
* [registerForPushNotifications](Titanium.Network.registerForPushNotifications).
*/
interface PushNotificationConfig {
/**
* Callback function invoked upon receiving a new push notification.
*/
callback?: (param0: PushNotificationData) => void;
/**
* Callback function called when an error occurs during registration.
*/
error?: (param0: PushNotificationErrorArg) => void;
/**
* Callback function called when the push registration is successfully completed.
*/
success?: (param0: PushNotificationSuccessArg) => void;
/**
* Array of `NOTIFICATION_TYPE` constants that the application would like to receive.
*/
types?: number[];
}
/**
* A simple object representing a push notification.
*/
interface PushNotificationData {
/**
* The `userinfo` dictionary passed to the Apple Push Notification Service.
*/
data?: any;
/**
* Boolean indicating if notification was received while app was in background.
*/
inBackground?: boolean;
}
/**
* A simple object passed to the
* [registerForPushNotifications](Titanium.Network.registerForPushNotifications) error callback.
*/
interface PushNotificationErrorArg extends FailureResponse {
/**
* Error code. Returns a non-zero value.
*/
code?: number;
/**
* Indicates if the operation succeeded. Returns `false`.
*/
success?: boolean;
/**
* The value of this string is always "remote".
*/
type?: string;
}
/**
* A simple object passed to the
* [registerForPushNotifications](Titanium.Network.registerForPushNotifications) success callback.
*/
interface PushNotificationSuccessArg extends SuccessResponse {
/**
* Error code. Returns 0.
*/
code?: number;
/**
* The device token which this device was registered for.
*/
deviceToken?: string;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Indicates if the operation succeeded. Returns `true`.
*/
success?: boolean;
/**
* The value of this string is always "remote".
*/
type?: string;
}
/**
* Argument passed to the read callback when an asynchronous [read](Titanium.Stream.read) operation
* finishes.
*/
interface ReadCallbackArgs extends ErrorResponse {
/**
* Number of bytes processed, or -1 in the event of an error or end of stream.
*/
bytesProcessed?: number;
/**
* Error code. Returns 0 if `success` is `true`.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Stream being read.
*/
source?: Titanium.IOStream;
/**
* Indicates if the operation succeeded.
*/
success?: boolean;
}
/**
* An Object describing the current ready state. See [onreadystatechange](Titanium.Network.HTTPClient.onreadystatechange) for more information.
*/
interface ReadyStatePayload {
/**
* The state for which `onreadystatechange` was invoked. Set to one of `Titanium.Network.HTTPClient` ready-state constants
*/
readyState?: number;
}
/**
* Offset of the refresh control view.
*/
interface RefreshControlOffset {
/**
* The offset from the top of this view at which the progress spinner should come to rest after a successful swipe gesture.
*/
end?: number;
/**
* The offset from the top of this view at which the progress spinner should appear.
*/
start?: number;
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface RequestCameraAccessResult extends ErrorResponse {
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface RequestMusicLibraryAccessResult extends ErrorResponse {
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface RequestPermissionAccessResult extends ErrorResponse {
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface RequestPhotoGalleryAccessResult extends ErrorResponse {
}
/**
* Argument passed to the callback when a request finishes successfully or erroneously.
*/
interface RequestStorageAccessResult extends ErrorResponse {
}
/**
* Simple object returned in the callback from the
* [reverseGeocoder](Titanium.Geolocation.reverseGeocoder) method.
*/
interface ReverseGeocodeResponse extends ErrorResponse {
/**
* Error code. Returns 0 if `success` is `true`.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* An array of reverse-geocoded addresses matching the requested location.
*/
places?: GeocodedAddress[];
}
/**
* An Object describing the current audio route.
*/
interface RouteDescription {
/**
* An Array of current input ports for the session. See the `AUDIO_SESSION_PORT` constants.
*/
inputs?: string[];
/**
* An Array of current output ports for the session. See the `AUDIO_SESSION_PORT` constants.
*/
outputs?: string[];
}
/**
* Represents the custom edit action for a ListItem or TableViewRow.
*/
interface RowActionType {
/**
* The background color of the row action.
*/
color?: string;
/**
* The [identifier](RowActionType. identifier) of the row action. Only included in the event
* if previously defined. Available in Titanium 6.0.0 and later.
*/
identifier?: string;
/**
* The image/icon of the row action.
*/
image?: string;
/**
* The state to show this edit action. Either "trailing" (default) or "leading".
*/
state?: string;
/**
* The style of the row action.
*/
style: number;
/**
* The title of the row action.
*/
title: string;
}
/**
* The parameter passed to the callback.
*/
interface ScreenshotResult {
/**
* The screenshot image.
*/
media?: Titanium.Blob;
}
/**
* The search bar token for the method.
*/
interface SearchBarToken {
/**
* The identifier of the search bar token.
*/
identifier: string;
/**
* The image of the search bar token.
*/
image?: string;
/**
* The text of the search bar token (displayed in the search bar).
*/
text: string;
}
/**
* The parameter passed to the .
*/
interface SearchResult {
/**
* Error message, if any returned.
*/
error?: string;
/**
* Indicates if string found or not.
*/
success?: boolean;
}
/**
* The protocol that the must implement.
*/
interface SecurityManagerProtocol {
/**
* The for this connection.
*/
connectionDelegateForUrl(url: any): APSConnectionDelegate;
/**
* Returns an array of objects implementing the [X509KeyManager](https://developer.android.com/reference/javax/net/ssl/X509KeyManager.html) protocol for the SSL Context.
*/
getKeyManagers(proxy: any): any[];
/**
* Returns an array of objects implementing the [X509TrustManager](https://developer.android.com/reference/javax/net/ssl/X509TrustManager.html) protocol for the SSL Context.
*/
getTrustManagers(proxy: any): any[];
/**
* Returns if the security manager will participate in authentication of this end point.
*/
willHandleURL(url: any): boolean;
}
/**
* The arguments for the event.
*/
interface SelectedItem {
/**
* Item index.
*/
itemIndex?: number;
/**
* List section if the item is contained in a list section.
*/
section?: Titanium.UI.ListSection;
/**
* Section index.
*/
sectionIndex?: number;
}
/**
* The arguments for the event.
*/
interface SelectedRowObject {
/**
* Row index.
*/
index?: number;
/**
* Table view row object.
*/
row?: Titanium.UI.TableViewRow;
/**
* Properties of the row. Use this property rather than `row` to access any custom row properties.
*/
rowData?: Dictionary;
/**
* Table view section object, if the clicked row is contained in a section.
*/
section?: Titanium.UI.TableViewSection;
}
/**
* Options passed to .
*/
interface ServiceIntentOptions {
/**
* One of the `START_*` constants from to specify the "stickiness" of the Service when Android shuts down the host application.
*/
startMode?: number;
/**
* URL for the service's JavaScript.
*/
url?: string;
}
/**
* Object of options for .
*/
interface ShortcutParams {
/**
* The icon to be displayed on the application shortcut. You can either use one of the constants like
* , a local image specified by the image path or a reference to a
* .
*/
icon?: number | string | Titanium.Contacts.Person;
/**
* The unique key for the application shortcut. Equates to the underlying `UIApplicationShortcutItemIconType` key
*/
identifier: string;
/**
* The subtitle displayed on the application shortcut.
*/
subtitle?: string;
/**
* The title of the application shortcut.
*/
title: string;
/**
* The userInfo of the application shortcut.
*/
userInfo?: any;
}
/**
* Dictionary of options for .
*/
interface ShowPopoverParams {
/**
* Indicates whether to animate showing the popover.
*/
animated?: boolean;
/**
* Sets the arrow position of the popover relative to the attached view object's dimensions
* when showing the popover.
*/
rect?: Dimension;
/**
* Attaches the popover to the specified view when showing the popover.
*/
view: Titanium.UI.View;
}
/**
* A simple object consisting of size measurements.
*/
interface Size {
/**
* The height measurement.
*/
height?: number;
/**
* The width measurement.
*/
width?: number;
}
/**
* The parameter passed to the callback.
*/
interface SnapshotResult {
/**
* Error message, if any returned.
*/
error?: string;
/**
* The snapshot image.
*/
snapshot?: Titanium.Blob;
/**
* Indicates if the snapshot taken.
*/
success?: boolean;
}
/**
* The optional options to pass to the . Pass a
* dictionary with one or more of the following string-keys:
* * `caseSensitive` (Boolean value)
* * `backward` (Boolean value)
* * `wraps` (Boolean value)
*/
interface StringSearchOptions {
/**
* The direction to search from the current selection. The search will respect the writing direction of the document
*/
backward?: boolean;
/**
* Whether or not the search should be case sensitive.
*/
caseSensitive?: boolean;
/**
* Whether the search should start at the beginning of the document once it reaches the end.
*/
wraps?: boolean;
}
/**
* Properties used in any event or callback which needs to report a success.
*/
interface SuccessResponse extends ErrorResponse {
/**
* Error code. Returns 0.
*/
code?: number;
/**
* Error message, if any returned.
*/
error?: string;
/**
* Indicates if the operation succeeded. Returns `true`.
*/
success?: boolean;
}
/**
* Dictionary object of parameters for the 2nd parameter of the method
* to pass additional configuration options like `weight` and `size`. Available in Titanium SDK 10.1.0
* and later.
*/
interface SystemImageParameters {
/**
* The symbol point size to use for the SF Symbol
*/
size?: number;
/**
* The symbol weight to use for the SF Symbol.
* Can be one of `ultralight`, `light`, `thin`, `normal`, `semibold`, `bold`, `heavy` or `black`.
*/
weight?: string;
}
/**
* Dictionary to specify edge insets for . Difference from typical is that `right` and `bottom` are ignored and calculated internally from `top`/`left` values.
*/
interface TabIconInsets extends Padding {
/**
* Bottom padding/inset
*/
bottom: never;
/**
* Left inset.
*/
left?: number;
/**
* Right padding/inset
*/
right: never;
/**
* Top inset.
*/
top?: number;
}
/**
* A simple object for specifying the animation properties to use when inserting or deleting rows, or scrolling the table.
*/
interface TableViewAnimationProperties {
/**
* Whether this table change should be animated. Ignored if any `animationStyle` value is specified.
*/
animated?: boolean;
/**
* Type of animation to use for row insertions and deletions.
*/
animationStyle?: number;
/**
* Specifies what position to scroll the selected row to.
*/
position?: number;
}
/**
* A simple object that represents an index entry in a `TableView`.
*/
interface TableViewIndexEntry {
/**
* Row index associated with this item.
*/
index?: number;
/**
* Title to display in the index bar for this item.
*/
title?: string;
}
/**
* Dictionary object of parameters for the that describes the padding. Most notable difference from typical is that `top`/`bottom` are only supported on Android.
*/
interface TextFieldPadding extends Padding {
/**
* Bottom padding (Android only, since 6.1.0)
*/
bottom?: number;
/**
* Left padding
*/
left?: number;
/**
* Right padding
*/
right?: number;
/**
* Top padding (Android only, since 6.1.0)
*/
top?: number;
}
/**
* Simple object passed to the thumbnail callback in response to the
* [requestThumbnailImagesAtTimes](Titanium.Media.VideoPlayer.requestThumbnailImagesAtTimes)
* method.
*/
interface ThumbnailResponse extends ErrorResponse {
/**
* Error code. Returns `0` if `success` is `true`.
*/
code?: number;
/**
* Thumbnail image, as a `Blob`.
*/
image?: Titanium.Blob;
/**
* Time offset for the thumbnail, in seconds.
*/
time?: number;
}
/**
* An abstract type to represent a metadata item inside the `metadata` event (iOS only).
*/
interface TiMetadataItemType {
/**
* A dictionary of the additional attributes.
*/
extraAttributes?: any;
/**
* The key of the metadata item, e.g. "title".
*/
key?: string;
/**
* The key-path of the metadata item.
*/
keySpace?: string;
/**
* The value of the metadata item. Can be represented as various types.
*/
value?: string | number | boolean;
}
/**
* The top-level Titanium module.
*/
declare namespace Titanium {
/**
* Date of the Titanium build.
*/
const buildDate: string;
/**
* Git hash of the Titanium build.
*/
const buildHash: string;
/**
* User-agent string used by Titanium.
*/
let userAgent: string;
/**
* Version of Titanium that is executing.
*/
const version: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
function addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Creates a new buffer based on the params.
*/
function createBuffer(params: CreateBufferArgs): Titanium.Buffer;
/**
* Fires a synthesized event to any registered listeners.
*/
function fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
function removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* The top-level Android module.
*/
namespace Android {
/**
* User switched airplane mode on or off.
*/
const ACTION_AIRPLANE_MODE_CHANGED: string;
/**
* List all applications.
*/
const ACTION_ALL_APPS: string;
/**
* Handle an incoming phone call.
*/
const ACTION_ANSWER: string;
/**
* Used to indicate that the data is an attachment.
*/
const ACTION_ATTACH_DATA: string;
/**
* Listen to battery state change status.
*/
const ACTION_BATTERY_CHANGED: string;
/**
* Indicates low battery condition on the device.
*/
const ACTION_BATTERY_LOW: string;
/**
* Indicates the battery is now okay after being low.
*/
const ACTION_BATTERY_OKAY: string;
/**
* Indicates the system has finished booting.
*/
const ACTION_BOOT_COMPLETED: string;
/**
* Show activity for reporting a bug.
*/
const ACTION_BUG_REPORT: string;
/**
* Perform a call to someone specified by the `data` property.
*/
const ACTION_CALL: string;
/**
* User pressed the call button.
*/
const ACTION_CALL_BUTTON: string;
/**
* The camera button was pressed.
*/
const ACTION_CAMERA_BUTTON: string;
/**
* Display an activity chooser.
*/
const ACTION_CHOOSER: string;
/**
* User dismissed a temporary system dialog, such as the notification drawer or recent-app drawer.
*/
const ACTION_CLOSE_SYSTEM_DIALOGS: string;
/**
* The device's configuration changed.
*/
const ACTION_CONFIGURATION_CHANGED: string;
/**
* Create a shortcut.
*/
const ACTION_CREATE_SHORTCUT: string;
/**
* Date changed.
*/
const ACTION_DATE_CHANGED: string;
/**
* Default action, which is `Titanium.Android.ACTION_VIEW`
*/
const ACTION_DEFAULT: string;
/**
* Delete the data specified by the Intent's `data` property.
*/
const ACTION_DELETE: string;
/**
* Indicates a low memory condition on the device.
*/
const ACTION_DEVICE_STORAGE_LOW: string;
/**
* Dial a number specified by the Intent's `data` property.
*/
const ACTION_DIAL: string;
/**
* Provide editable access to the data specified by the Intent's `data` property.
*/
const ACTION_EDIT: string;
/**
* Allow the user to select a particular kind of data specified by the Intent's `type` property.
*/
const ACTION_GET_CONTENT: string;
/**
* GTalk connection has been established.
*/
const ACTION_GTALK_SERVICE_CONNECTED: string;
/**
* GTalk connection has been disconnected.
*/
const ACTION_GTALK_SERVICE_DISCONNECTED: string;
/**
* A wired headset has been plugged in or unplugged.
*/
const ACTION_HEADSET_PLUG: string;
/**
* An input method has been changed.
*/
const ACTION_INPUT_METHOD_CHANGED: string;
/**
* Insert an empty item into the given container.
*/
const ACTION_INSERT: string;
/**
* Pick an existing item or insert an empty item, then edit it.
*/
const ACTION_INSERT_OR_EDIT: string;
/**
* Start as the main entry point.
*/
const ACTION_MAIN: string;
/**
* Indicates low memory condition notification acknowledged by user and package management should be started.
*/
const ACTION_MANAGE_PACKAGE_STORAGE: string;
/**
* External media was removed from SD card slot, but mount point was not unmounted.
*/
const ACTION_MEDIA_BAD_REMOVAL: string;
/**
* The media button was pressed.
*/
const ACTION_MEDIA_BUTTON: string;
/**
* External media is present and being disk-checked.
*/
const ACTION_MEDIA_CHECKING: string;
/**
* User has expressed the desire to remove the external storage media.
*/
const ACTION_MEDIA_EJECT: string;
/**
* External media is present and mounted at its mount point.
*/
const ACTION_MEDIA_MOUNTED: string;
/**
* External media is present, but is using an incompatible filesystem or is blank.
*/
const ACTION_MEDIA_NOFS: string;
/**
* External media has been removed.
*/
const ACTION_MEDIA_REMOVED: string;
/**
* The media scanner has finished scanning a directory.
*/
const ACTION_MEDIA_SCANNER_FINISHED: string;
/**
* Request the media scanner to scan a file and add it to the media database.
*/
const ACTION_MEDIA_SCANNER_SCAN_FILE: string;
/**
* The media scanner has started scanning a directory.
*/
const ACTION_MEDIA_SCANNER_STARTED: string;
/**
* External media is unmounted because it is being shared via USB mass storage.
*/
const ACTION_MEDIA_SHARED: string;
/**
* Corresponds to the Android `Intent.ACTION_MEDIA_UNMOUNTABLE` constant.
*/
const ACTION_MEDIA_UNMOUNTABLE: string;
/**
* External media is present, but not mounted at its mount point.
*/
const ACTION_MEDIA_UNMOUNTED: string;
/**
* An outgoing call is about to be placed.
*/
const ACTION_NEW_OUTGOING_CALL: string;
/**
* A new application package has been installed on the device.
*/
const ACTION_PACKAGE_ADDED: string;
/**
* An existing application package has been changed.
*/
const ACTION_PACKAGE_CHANGED: string;
/**
* The user has cleared the data of a package.
*/
const ACTION_PACKAGE_DATA_CLEARED: string;
/**
* An existing application package has been removed from the device.
*/
const ACTION_PACKAGE_REMOVED: string;
/**
* A new version of an application package has been installed, replacing an existing version that was previously installed.
*/
const ACTION_PACKAGE_REPLACED: string;
/**
* The user has restarted a package, and all of its processes have been killed.
*/
const ACTION_PACKAGE_RESTARTED: string;
/**
* Pick an item from the directory indicated by the Intent's `data` property.
*/
const ACTION_PICK: string;
/**
* Pick an activity given an intent.
*/
const ACTION_PICK_ACTIVITY: string;
/**
* External power has been connected to the device.
*/
const ACTION_POWER_CONNECTED: string;
/**
* External power has been disconnected from the device.
*/
const ACTION_POWER_DISCONNECTED: string;
/**
* Show power usage information to the user.
*/
const ACTION_POWER_USAGE_SUMMARY: string;
/**
* Content provider published new events or items.
*/
const ACTION_PROVIDER_CHANGED: string;
/**
* Device rebooted.
*/
const ACTION_REBOOT: string;
/**
* Run the data.
*/
const ACTION_RUN: string;
/**
* Sent when the device goes to sleep and becomes non-interactive.
*/
const ACTION_SCREEN_OFF: string;
/**
* Sent when the device wakes up and becomes interactive.
*/
const ACTION_SCREEN_ON: string;
/**
* Perform a search.
*/
const ACTION_SEARCH: string;
/**
* Start action associated with long pressing on the search key.
*/
const ACTION_SEARCH_LONG_PRESS: string;
/**
* Deliver data to another activity.
*/
const ACTION_SEND: string;
/**
* Deliver data to the recipient specified by the Intent's `data` property.
*/
const ACTION_SENDTO: string;
/**
* Deliver multiple data to another activity.
*/
const ACTION_SEND_MULTIPLE: string;
/**
* Show settings for choosing the system wallpaper.
*/
const ACTION_SET_WALLPAPER: string;
/**
* Device is shutting down.
*/
const ACTION_SHUTDOWN: string;
/**
* Perform data synchronization.
*/
const ACTION_SYNC: string;
/**
* Start the platform-defined tutorial.
*/
const ACTION_SYSTEM_TUTORIAL: string;
/**
* The time was set.
*/
const ACTION_TIME_CHANGED: string;
/**
* The current time changed. Sent every minute.
*/
const ACTION_TIME_TICK: string;
/**
* A user ID was removed from the system.
*/
const ACTION_UID_REMOVED: string;
/**
* Sent when the user is present after device wakes up.
*/
const ACTION_USER_PRESENT: string;
/**
* Display data to the user.
*/
const ACTION_VIEW: string;
/**
* Start voice command.
*/
const ACTION_VOICE_COMMAND: string;
/**
* The current system wallpaper has changed.
*/
const ACTION_WALLPAPER_CHANGED: string;
/**
* Perform a web search.
*/
const ACTION_WEB_SEARCH: string;
/**
* Notification category indicating an alarm or timer.
*/
const CATEGORY_ALARM: string;
/**
* Set if the activity should be considered as an alternative action to the data the user is currently viewing.
*/
const CATEGORY_ALTERNATIVE: string;
/**
* Activity can browse the Internet.
*/
const CATEGORY_BROWSABLE: string;
/**
* Notification category indicating an incoming call (voice or video) or similar synchronous
* communication request.
*/
const CATEGORY_CALL: string;
/**
* Activity should be used as the default action to perform on a piece of data.
*/
const CATEGORY_DEFAULT: string;
/**
* Activity is in the development preference panel.
*/
const CATEGORY_DEVELOPMENT_PREFERENCE: string;
/**
* Notification category indicating an asynchronous bulk message (email).
*/
const CATEGORY_EMAIL: string;
/**
* Activity can run inside a parent activity.
*/
const CATEGORY_EMBED: string;
/**
* Notification category indicating an error in background operation or authentication status.
*/
const CATEGORY_ERROR: string;
/**
* Notification category indicating a calendar event.
*/
const CATEGORY_EVENT: string;
/**
* To be used as test code for framework instrumentation tests.
*/
const CATEGORY_FRAMEWORK_INSTRUMENTATION_TEST: string;
/**
* Home activity, the first activity that is displayed when the device boots.
*/
const CATEGORY_HOME: string;
/**
* Provides information about the package it is in.
*/
const CATEGORY_INFO: string;
/**
* Activity is in the device's launcher.
*/
const CATEGORY_LAUNCHER: string;
/**
* Notification category indicating an incoming direct message (SMS, instant message, etc.).
*/
const CATEGORY_MESSAGE: string;
/**
* This activity may be exercised by the monkey or other automated test tools.
*/
const CATEGORY_MONKEY: string;
/**
* Activity can open raw `file://` or `scheme://` URIs.
*/
const CATEGORY_OPENABLE: string;
/**
* This activity is a preference panel.
*/
const CATEGORY_PREFERENCE: string;
/**
* Notification category indicating the progress of a long-running background operation.
*/
const CATEGORY_PROGRESS: string;
/**
* Notification category indicating a promotion or advertisement.
*/
const CATEGORY_PROMO: string;
/**
* Notification category indicating a specific, timely recommendation for a single thing.
*/
const CATEGORY_RECOMMENDATION: string;
/**
* To be used as a sample code example (not part of the normal user experience).
*/
const CATEGORY_SAMPLE_CODE: string;
/**
* Activity should be considered as an alternative selection action to the data the user
* has currently selected.
*/
const CATEGORY_SELECTED_ALTERNATIVE: string;
/**
* Notification category for a running background service.
*/
const CATEGORY_SERVICE: string;
/**
* Notification category for a social network or sharing update.
*/
const CATEGORY_SOCIAL: string;
/**
* Notification category indicating ongoing information about device or contextual status.
*/
const CATEGORY_STATUS: string;
/**
* Activity to be used in a tab activity.
*/
const CATEGORY_TAB: string;
/**
* To be used as a test (not part of the normal user experience).
*/
const CATEGORY_TEST: string;
/**
* Notification category indicating media transport control for playback.
*/
const CATEGORY_TRANSPORT: string;
/**
* To be used as a unit test (run through the Test Harness).
*/
const CATEGORY_UNIT_TEST: string;
/**
* Use all default settings for a notification; see
* [Notification.defaults](Titanium.Android.Notification.defaults).
*/
const DEFAULT_ALL: number;
/**
* Use the default light settings for a notification; see
* [Notification.defaults](Titanium.Android.Notification.defaults).
*/
const DEFAULT_LIGHTS: number;
/**
* Use the default sound settings for a notification; see
* [Notification.defaults](Titanium.Android.Notification.defaults).
*/
const DEFAULT_SOUND: number;
/**
* Use the default vibration settings for a notification; see
* [Notification.defaults](Titanium.Android.Notification.defaults).
*/
const DEFAULT_VIBRATE: number;
/**
* Integer indicating how many pending alarms are being delivered with the intent.
*/
const EXTRA_ALARM_COUNT: string;
/**
* String array containing e-mail addresses for blind carbon copying.
*/
const EXTRA_BCC: string;
/**
* String array containing e-mail addresses for carbon copying.
*/
const EXTRA_CC: string;
/**
* Boolean indicating full uninstall (true) or partial uninstall (false).
*/
const EXTRA_DATA_REMOVED: string;
/**
* Boolean indicating to restart the application or not.
*/
const EXTRA_DONT_KILL_APP: string;
/**
* String array containing e-mail addresses.
*/
const EXTRA_EMAIL: string;
/**
* An Intent describing the choices you would like shown.
*/
const EXTRA_INTENT: string;
/**
* A KeyEvent object containing the event that triggered the creation of the Intent it is in.
*/
const EXTRA_KEY_EVENT: string;
/**
* String holding the phone number to call or number that was called.
*/
const EXTRA_PHONE_NUMBER: string;
/**
* Boolean indicating if the package is being replaced.
*/
const EXTRA_REPLACING: string;
/**
* Bitmap icon.
*/
const EXTRA_SHORTCUT_ICON: string;
/**
* Resource of the shortcut.
*/
const EXTRA_SHORTCUT_ICON_RESOURCE: string;
/**
* Intent of a shortcut.
*/
const EXTRA_SHORTCUT_INTENT: string;
/**
* Name of the shortcut.
*/
const EXTRA_SHORTCUT_NAME: string;
/**
* URI containing the stream data.
*/
const EXTRA_STREAM: string;
/**
* Subject line of a message.
*/
const EXTRA_SUBJECT: string;
/**
* Initial data to place in a newly created record.
*/
const EXTRA_TEMPLATE: string;
/**
* Corresponds to the Android `Intent.EXTRA_TEXT` constant.
*/
const EXTRA_TEXT: string;
/**
* Corresponds to the Android `Intent.EXTRA_TITLE` constant.
*/
const EXTRA_TITLE: string;
/**
* UID of the assigned packaged.
*/
const EXTRA_UID: string;
/**
* Not used.
*/
const FILL_IN_ACTION: number;
/**
* Not used.
*/
const FILL_IN_CATEGORIES: number;
/**
* Not used.
*/
const FILL_IN_COMPONENT: number;
/**
* Not used.
*/
const FILL_IN_DATA: number;
/**
* Not used.
*/
const FILL_IN_PACKAGE: number;
/**
* If activity is already running, bring it to the foreground.
*/
const FLAG_ACTIVITY_BROUGHT_TO_FRONT: number;
/**
* If the activity is present, removes any activities on top of it to make it the foreground activity.
*/
const FLAG_ACTIVITY_CLEAR_TOP: number;
/**
* Corresponds to the Android `Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET` constant.
*/
const FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET: number;
/**
* Exclude the activity from recently launched activities.
*/
const FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS: number;
/**
* Return result to the original calling activity.
*/
const FLAG_ACTIVITY_FORWARD_RESULT: number;
/**
* Activity was launched from history.
*/
const FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY: number;
/**
* Start the activity as a new task even if it exists.
*/
const FLAG_ACTIVITY_MULTIPLE_TASK: number;
/**
* Activity will be the start of a new task (collection of activities).
*/
const FLAG_ACTIVITY_NEW_TASK: number;
/**
* Prevent transition animation.
*/
const FLAG_ACTIVITY_NO_ANIMATION: number;
/**
* Do not keep the activity in the history stack.
*/
const FLAG_ACTIVITY_NO_HISTORY: number;
/**
* Disables the [onUserLeaveHint()](https://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()) callback.
*/
const FLAG_ACTIVITY_NO_USER_ACTION: number;
/**
* Corresponds to the Android `Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP` constant.
*/
const FLAG_ACTIVITY_PREVIOUS_IS_TOP: number;
/**
* If the activity already exists, place it at the top of the history stack.
*/
const FLAG_ACTIVITY_REORDER_TO_FRONT: number;
/**
* If the task already exists, resets the task to its initial state.
*/
const FLAG_ACTIVITY_RESET_TASK_IF_NEEDED: number;
/**
* Do not launch the activity if it is already running.
*/
const FLAG_ACTIVITY_SINGLE_TOP: number;
/**
* Cancel the notification when it is clicked by the user.
*/
const FLAG_AUTO_CANCEL: number;
/**
* Cancel the current pending intent before creating a new one.
*/
const FLAG_CANCEL_CURRENT: number;
/**
* Enable a log message to print out the resolution of the intent.
*/
const FLAG_DEBUG_LOG_RESOLUTION: number;
/**
* Indicates the intent is coming from a background operation.
*/
const FLAG_FROM_BACKGROUND: number;
/**
* Grant read permission on the URI in the Intent's data or clipboard.
*/
const FLAG_GRANT_READ_URI_PERMISSION: number;
/**
* Grants write permission on the URI in the Intent's data or clipboard.
*/
const FLAG_GRANT_WRITE_URI_PERMISSION: number;
/**
* Pending intent should be immutable.
*/
const FLAG_IMMUTABLE: number;
/**
* Repeat audio until the notification is cancelled or the notification window
* is opened.
*/
const FLAG_INSISTENT: number;
/**
* Pending intent should be mutable.
*/
const FLAG_MUTABLE: number;
/**
* Do not cancel the notification when the user clicks the Clear All button.
*/
const FLAG_NO_CLEAR: number;
/**
* If the current intent does not exist, do not create it.
*/
const FLAG_NO_CREATE: number;
/**
* The pending intent can only be used once.
*/
const FLAG_ONE_SHOT: number;
/**
* Specifies that a notification is in reference to something that is ongoing, like a phone call.
*/
const FLAG_ONGOING_EVENT: number;
/**
* Play an alert (sound, lights, and/or vibration) once each time the notification is sent, even if it has not been canceled before that.
*/
const FLAG_ONLY_ALERT_ONCE: number;
/**
* When sending a broadcast, only registered receivers will be called.
*/
const FLAG_RECEIVER_REGISTERED_ONLY: number;
/**
* Use LED lights to alert the user to the notification.
*/
const FLAG_SHOW_LIGHTS: number;
/**
* If the current pending intent already exists, only update the current intent's extra data.
*/
const FLAG_UPDATE_CURRENT: number;
/**
* Allows the camera to be used while the app is in the background.
*/
const FOREGROUND_SERVICE_TYPE_CAMERA: number;
/**
* Allows connecting to Android Auto, bluetooth, TV or other devices while app is in the background.
*/
const FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE: number;
/**
* Allows accessing location from the GPS, map, etc. while the app is in the background.
*/
const FOREGROUND_SERVICE_TYPE_LOCATION: number;
/**
* A special value indicates to use all types set in manifest file.
*/
const FOREGROUND_SERVICE_TYPE_MANIFEST: number;
/**
* Allows music, video, news or other media playback while the app is in the background.
*/
const FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK: number;
/**
* Allows managing a media projection session for screen recording or taking screenshots
* while app is in the background.
*/
const FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION: number;
/**
* Allows the microphone to be used while the app is in the background.
*/
const FOREGROUND_SERVICE_TYPE_MICROPHONE: number;
/**
* The default foreground service type.
*/
const FOREGROUND_SERVICE_TYPE_NONE: number;
/**
* Allows ongoing phone call or video conferencing access while the app is in the background.
*/
const FOREGROUND_SERVICE_TYPE_PHONE_CALL: number;
/**
* Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level.
*/
const IMPORTANCE_DEFAULT: number;
/**
* Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level.
*/
const IMPORTANCE_HIGH: number;
/**
* Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level.
*/
const IMPORTANCE_LOW: number;
/**
* Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level.
*/
const IMPORTANCE_MAX: number;
/**
* Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level.
*/
const IMPORTANCE_MIN: number;
/**
* Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level.
*/
const IMPORTANCE_NONE: number;
/**
* Used with [NotificationChannel](Titanium.Android.NotificationChannel) to specify an importance level.
*/
const IMPORTANCE_UNSPECIFIED: number;
/**
* Standard Action Bar navigation mode.
*/
const NAVIGATION_MODE_STANDARD: number;
/**
* Action Bar tab navigation mode.
*/
const NAVIGATION_MODE_TABS: number;
/**
* Not used.
* @deprecated
*/
const PENDING_INTENT_FOR_ACTIVITY: never;
/**
* Not used.
* @deprecated
*/
const PENDING_INTENT_FOR_BROADCAST: never;
/**
* Not used.
* @deprecated
*/
const PENDING_INTENT_FOR_SERVICE: never;
/**
* Not used.
* @deprecated
*/
const PENDING_INTENT_MAX_VALUE: never;
/**
* Default priority if it does not fit into another priority category.
*/
const PRIORITY_DEFAULT: number;
/**
* Use for high priority notifications like real-time chat messages.
*/
const PRIORITY_HIGH: number;
/**
* Use for low priority notifications like software updates.
*/
const PRIORITY_LOW: number;
/**
* Use for urgent or time-critical notifications, for example, turn-by-turn directions or
* emergency alerts.
*/
const PRIORITY_MAX: number;
/**
* Use for expired events.
*/
const PRIORITY_MIN: number;
/**
* Accessor for Android system resources.
*/
const R: Titanium.Android.R;
/**
* Used with [setResult](Titanium.Android.Activity.setResult) to specify that
* an activity was canceled.
*/
const RESULT_CANCELED: number;
/**
* Used with [setResult](Titanium.Android.Activity.setResult) to specify a
* user-defined result.
*/
const RESULT_FIRST_USER: number;
/**
* Used with [setResult](Titanium.Android.Activity.setResult) to specify that
* an activity succeeded.
*/
const RESULT_OK: number;
/**
* Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to
* specify the activity should run in the same orientation as the activity behind it
* in the activity stack.
*/
const SCREEN_ORIENTATION_BEHIND: number;
/**
* Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to
* specify a landscape screen orientation.
*/
const SCREEN_ORIENTATION_LANDSCAPE: number;
/**
* Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to
* specify that the sensor should be ignored and the display should not rotate.
*/
const SCREEN_ORIENTATION_NOSENSOR: number;
/**
* Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to
* specify a portrait screen orientation.
*/
const SCREEN_ORIENTATION_PORTRAIT: number;
/**
* Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to
* specify that orientation should be determined by the orientation sensor.
*/
const SCREEN_ORIENTATION_SENSOR: number;
/**
* Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to
* specify that the system should use its default rules for determining the best
* orientation.
*/
const SCREEN_ORIENTATION_UNSPECIFIED: number;
/**
* Use with [requestedOrientation](Titanium.Android.Activity.requestedOrientation) to
* specify that the system should use the user's preferred orientation.
*/
const SCREEN_ORIENTATION_USER: number;
/**
* Always show this item as an action button in the action bar.
*/
const SHOW_AS_ACTION_ALWAYS: number;
/**
* The action view can collapse to a normal menu item.
*/
const SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW: number;
/**
* Show this item as an action button if the system decides there is room for it.
*/
const SHOW_AS_ACTION_IF_ROOM: number;
/**
* Never display this item as an action button in the action bar.
*/
const SHOW_AS_ACTION_NEVER: number;
/**
* When this item is in the action bar, always show it with a text label.
*/
const SHOW_AS_ACTION_WITH_TEXT: number;
/**
* A Service start mode indicating that if the host application is stopped by Android, the service should not be restarted automatically.
*/
const START_NOT_STICKY: number;
/**
* A Service start mode indicating that if the host application is stopped by Android, the service should be restarted automatically and the original Intent re-sent.
*/
const START_REDELIVER_INTENT: number;
/**
* Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to
* request that the alarm stream type for notifications be used.
*/
const STREAM_ALARM: number;
/**
* Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the
* default stream type for notifications be used.
*/
const STREAM_DEFAULT: number;
/**
* Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to
* request that the music stream type for notifications be used.
*/
const STREAM_MUSIC: number;
/**
* Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the
* notification stream type for notifications be used.
*/
const STREAM_NOTIFICATION: number;
/**
* Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the
* ring stream type for notifications be used.
*/
const STREAM_RING: number;
/**
* Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the
* system stream type for notifications be used.
*/
const STREAM_SYSTEM: number;
/**
* Use with [audioStreamType](Titanium.Android.Notification.audioStreamType) to request that the
* voice call stream type for notifications be used.
*/
const STREAM_VOICE_CALL: number;
/**
* QuickSettings tile is active.
*/
const TILE_STATE_ACTIVE: number;
/**
* QuickSettings tile is inactive.
*/
const TILE_STATE_INACTIVE: number;
/**
* QuickSettings tile is unavailable.
*/
const TILE_STATE_UNAVAILABLE: number;
/**
* The URI scheme used for intent URIs.
*/
const URI_INTENT_SCHEME: number;
/**
* Shows basic information about the notification.
*/
const VISIBILITY_PRIVATE: number;
/**
* Shows the notification's full content on the lock screen. This is the system default if visibility is left unspecified.
*/
const VISIBILITY_PUBLIC: number;
/**
* Shows the most minimal information of the notification on the lock screen.
*/
const VISIBILITY_SECRET: number;
/**
* Turn the screen on when the wake lock is acquired.
*/
const WAKE_LOCK_ACQUIRE_CAUSES_WAKEUP: number;
/**
* Ensures that the screen and keyboard backlight are on at full brightness.
*/
const WAKE_LOCK_FULL: number;
/**
* When this wake lock is released, poke the user activity timer so the screen stays on for a little longer.
*/
const WAKE_LOCK_ON_AFTER_RELEASE: number;
/**
* Ensures that the CPU is running; the screen and keyboard backlight will be allowed to go off.
*/
const WAKE_LOCK_PARTIAL: number;
/**
* Ensures that the screen is on at full brightness; the keyboard backlight will be allowed to go off.
*/
const WAKE_LOCK_SCREEN_BRIGHT: number;
/**
* Ensures that the screen is on (but may be dimmed); the keyboard backlight will be allowed to go off.
*/
const WAKE_LOCK_SCREEN_DIM: number;
/**
* An action bar is a window feature that identifies the application and user location,
* and provides user actions and navigation modes.
*/
class ActionBar extends Titanium.Proxy {
/**
* The background image for the action bar, specified as a local file path or URL.
*/
backgroundImage: string;
/**
* Sets a view to be used for a custom navigation mode.
*/
customView: Titanium.UI.View;
/**
* Displays an "up" affordance on the "home" area of the action bar.
*/
displayHomeAsUp: boolean;
/**
* Sets a custom icon for the "home" button in the corner of the action bar.
*/
homeAsUpIndicator: string | number | Titanium.Blob;
/**
* Enable or disable the "home" button in the corner of the action bar.
*/
homeButtonEnabled: boolean;
/**
* Sets the application icon displayed in the "home" area of the action bar.
*/
icon: string | number | Titanium.Blob;
/**
* Sets the application logo displayed in the "home" area of the action bar.
*/
logo: string | number | Titanium.Blob;
/**
* Controls the navigation mode.
*/
navigationMode: number;
/**
* Callback function called when the home icon is clicked.
*/
onHomeIconItemSelected: (...args: any[]) => void;
/**
* Sets the subtitle of the action bar.
*/
subtitle: string;
/**
* Sets the title of the action bar.
*/
title: string;
/**
* Gets or sets the action bar visibility state.
*/
visible: boolean;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Hides the action bar if it is currently showing.
*/
hide(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Shows or hides the action bar home icon
*/
setDisplayShowHomeEnabled(show: boolean): void;
/**
* Shows or hides the action bar title/subtitle
*/
setDisplayShowTitleEnabled(show: boolean): void;
/**
* Shows the action bar if it is currently hidden.
*/
show(): void;
}
/**
* Base event for class Titanium.Android.Activity
*/
interface ActivityBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Android.Activity;
}
/**
* Fired when the activity is already running and an intent different than the one that launched it was received.
*/
interface Activity_newintent_Event extends ActivityBaseEvent {
/**
* The `Intent` passed to the native `onNewIntent` method.
*/
intent: Titanium.Android.Intent;
}
/**
* Fired when the activity is launched.
*/
interface Activity_onIntent_Event extends ActivityBaseEvent {
/**
* The `Intent` used to launch the Activity.
*/
intent: Titanium.Android.Intent;
}
/**
* Fired when the activity is about to go into the background as a result of user choice.
*/
interface Activity_userleavehint_Event extends ActivityBaseEvent {
}
/**
* Called whenever a key, touch, or trackball event is dispatched to the activity.
*/
interface Activity_userinteraction_Event extends ActivityBaseEvent {
}
interface ActivityEventMap extends ProxyEventMap {
newintent: Activity_newintent_Event;
onIntent: Activity_onIntent_Event;
userinteraction: Activity_userinteraction_Event;
userleavehint: Activity_userleavehint_Event;
}
/**
* The Titanium binding of an Android Activity.
*/
class Activity extends Titanium.Proxy {
/**
* The action bar for this activity.
*/
readonly actionBar: Titanium.Android.ActionBar;
/**
* The last `Intent` received by this activity.
*/
readonly intent: Titanium.Android.Intent;
/**
* Callback function called when the Android activity is created.
*/
onCreate: (param0: ActivityLifecycleCallbackObject) => void;
/**
* Callback function called to initially create an Android options menu
* for this Activity when the user presses the **Menu** button.
*/
onCreateOptionsMenu: (param0: OptionsMenuCallbackObject) => void;
/**
* Callback function called when the Android activity is destroyed.
*/
onDestroy: (param0: ActivityLifecycleCallbackObject) => void;
/**
* Callback function called when the Android activity is paused.
*/
onPause: (param0: ActivityLifecycleCallbackObject) => void;
/**
* Callback function called to prepare an options menu for display when the user presses
* the **Menu** button.
*/
onPrepareOptionsMenu: (param0: OptionsMenuCallbackObject) => void;
/**
* Callback function called when the Android activity is restarted.
*/
onRestart: (param0: ActivityLifecycleCallbackObject) => void;
/**
* Callback function called when the Android activity is resumed.
*/
onResume: (param0: ActivityLifecycleCallbackObject) => void;
/**
* Callback function called when the Android activity is started.
*/
onStart: (param0: ActivityLifecycleCallbackObject) => void;
/**
* Callback function called when the Android activity is stopped.
*/
onStop: (param0: ActivityLifecycleCallbackObject) => void;
/**
* Specifies a specific orientation for this activity.
*/
requestedOrientation: number;
/**
* Toolbar instance that serves as ActionBar
*/
supportToolbar: Titanium.UI.Toolbar;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Android.Activity, event: ActivityEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Closes this activity.
*/
finish(): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: ActivityEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Gets an Android or Application string using the specified Resource ID and optional format arguments.
*/
getString(resourceId: number, ...format: any[]): string;
/**
* Declares that the option menu has changed and should be recreated.
*/
invalidateOptionsMenu(): void;
/**
* Programmatically opens the options menu.
*/
openOptionsMenu(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Android.Activity, event: ActivityEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Broadcast the passed in `Intent` to all `BroadcastReceiver`s.
*/
sendBroadcast(intent: Titanium.Android.Intent): void;
/**
* Broadcast the passed in `Intent` to all `BroadcastReceiver`s with an optional permission.
*/
sendBroadcastWithPermission(intent: Titanium.Android.Intent, receiverPermission?: string): void;
/**
* Sets the requested Activity orientation.
* @deprecated Use the property instead
*/
setRequestedOrientation: never;
/**
* Sets the result of this activity using an `Intent`.
*/
setResult(resultCode: number, intent?: Titanium.Android.Intent): void;
/**
* Sets a toolbar instance to be used as an ActionBar.
*/
setSupportActionBar(toolbar: Titanium.UI.Toolbar): void;
/**
* Starts a new activity, using the passed in `Intent` as the description.
*/
startActivity(intent: Titanium.Android.Intent): void;
/**
* The same as `startActivity`, but also accepts a callback function for handling the result of the started Activity.
*/
startActivityForResult(intent: Titanium.Android.Intent, callback: (param0: ActivityResult) => void): void;
}
/**
* Helper object for generating large-format notifications that include a large image attachment.
*/
class BigPictureStyle extends Titanium.Proxy {
/**
* Overrides in the big form of the notification. This defaults to the value passed to .
*/
bigContentTitle: string;
/**
* Override the when the big notification is shown.
*/
bigLargeIcon: number | string;
/**
* Provide the bitmap to be used as the payload for the BigPicture notification.
*/
bigPicture: number | string | Titanium.Blob | Titanium.Filesystem.File;
/**
* Number of times to retry decoding the bitmap at bigPicture URL.
*/
decodeRetries: number;
/**
* Set the first line of text after the detail section in the big form of the notification.
*/
summaryText: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Helper object for generating large-format notifications that include a lot of text.
*/
class BigTextStyle extends Titanium.Proxy {
/**
* Overrides in the big form of the notification. This defaults to the value passed to .
*/
bigContentTitle: string;
/**
* Sets the longer text to be displayed in the big form of the notification in place of the content text.
*/
bigText: string;
/**
* Set the first line of text after the detail section in the big form of the notification.
*/
summaryText: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Monitor and handle Android system broadcasts.
*/
class BroadcastReceiver extends Titanium.Proxy {
/**
* The function called when a broadcast is received.
*/
onReceived: (param0: any) => void;
/**
* URL of the JavaScript file to handle the broadcast.
*/
url: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Message objects passed between Android application components.
*/
class Intent extends Titanium.Proxy {
/**
* The action associated with this intent.
*/
action: string;
/**
* The Java class name of the activity associated with this intent
* ([packageName](Titanium.Android.Intent.packageName) must also be set).
*/
className: string;
/**
* The Intent's Data URI.
*/
readonly data: string;
/**
* Intent flags.
*/
flags: number;
/**
* The fully-qualified Java package name of the activity.
*/
packageName: string;
/**
* The MIME type for this Intent.
*/
readonly type: string;
/**
* The URL to a Titanium JavaScript Activity.
*/
url: string;
/**
* Adds a category to this Intent.
*/
addCategory(name: string): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Adds to the existing flags on the `Intent`.
*/
addFlags(flags: number): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Get a property from this `Intent`.
*/
getBlobExtra(name: string): Titanium.Blob;
/**
* Get a boolean property from this Intent.
*/
getBooleanExtra(name: string, defaultValue: boolean): boolean;
/**
* Get the Data URI from this `Intent`.
* @deprecated Use the property instead.
*/
getData: never;
/**
* Get a double property from this `Intent`.
*/
getDoubleExtra(name: string, defaultValue: number): number;
/**
* Get an integer property from this `Intent`.
*/
getIntExtra(name: string, defaultValue: number): number;
/**
* Get a long property from this `Intent`.
*/
getLongExtra(name: string, defaultValue: number): number;
/**
* Get a string property from this `Intent`.
*/
getStringExtra(name: string): string;
/**
* Returns `true` if this `Intent` has the specified property.
*/
hasExtra(name: string): boolean;
/**
* Puts an extra property on this `Intent`.
*/
putExtra(name: string, value: any): void;
/**
* Put a URI property on this `Intent` (useful for ).
*/
putExtraUri(name: string, value: string | string[]): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* The Titanium binding of an Android Options Menu.
*/
class Menu extends Titanium.Proxy {
/**
* Array of menu items in this menu.
*/
readonly items: Titanium.Android.MenuItem[];
/**
* Creates a from the passed creation options.
*/
add(options: any): Titanium.Android.MenuItem;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Clears all items from this menu.
*/
clear(): void;
/**
* Closes the menu, if visible.
*/
close(): void;
/**
* Locates a [MenuItem](Titanium.Android.MenuItem) in this menu, by item ID or reference.
*/
findItem(item: number | Titanium.Android.MenuItem): Titanium.Android.MenuItem;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Returns the [MenuItem](Titanium.Android.MenuItem) at a specific index.
*/
getItem(index: number): Titanium.Android.MenuItem;
/**
* Returns `true` if this menu has visible items.
*/
hasVisibleItems(): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Removes all menu items with the specified
* [groupId](Titanium.Android.MenuItem.groupId).
*/
removeGroup(groupId: number): void;
/**
* Removes a specific [MenuItem](Titanium.Android.MenuItem) identified by its
* [itemId](Titanium.Android.MenuItem.itemId).
*/
removeItem(itemId: number): void;
/**
* Enables or disables a group of menu items identified by a
* [groupId](Titanium.Android.MenuItem.groupId).
*/
setGroupEnabled(groupId: number, enabled: boolean): void;
/**
* Shows or hides a group of menu items identified by a
* [groupId](Titanium.Android.MenuItem.groupId).
*/
setGroupVisible(groupId: number, visible: boolean): void;
/**
* Number of items in this menu.
*/
size(): number;
}
/**
* Base event for class Titanium.Android.MenuItem
*/
interface MenuItemBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Android.MenuItem;
}
/**
* Fired when the user clicks the menu item.
*/
interface MenuItem_click_Event extends MenuItemBaseEvent {
}
/**
* Fired when the action view has been expanded.
*/
interface MenuItem_expand_Event extends MenuItemBaseEvent {
}
/**
* Fired when the action view has been collapsed.
*/
interface MenuItem_collapse_Event extends MenuItemBaseEvent {
}
interface MenuItemEventMap extends ProxyEventMap {
click: MenuItem_click_Event;
collapse: MenuItem_collapse_Event;
expand: MenuItem_expand_Event;
}
/**
* The Titanium binding of an Android menu item.
*/
class MenuItem extends Titanium.Proxy {
/**
* Briefly describes what performing an action (such as a click) on the view will do.
*/
accessibilityHint: string;
/**
* A succinct label identifying the view for the device's accessibility service.
*/
accessibilityLabel: string;
/**
* A string describing the value (if any) of the view for the device's accessibility service.
*/
accessibilityValue: string;
/**
* Custom view that replaces the default menu item button.
*/
actionView: Titanium.UI.View;
/**
* True if this menu item's action view has been expanded.
*/
readonly actionViewExpanded: boolean;
/**
* Determines if the item can be checked.
*/
checkable: boolean;
/**
* Determines if the item is checked.
*/
checked: boolean;
/**
* Determines if the item is enabled.
*/
enabled: boolean;
/**
* Group ID for this item.
*/
readonly groupId: number;
/**
* Icon to display for the this menu item.
*/
icon: number | string;
/**
* Item ID for this item.
*/
readonly itemId: number;
/**
* Integer used for controlling the category and sort order for menu items.
*/
readonly order: number;
/**
* A set of flags that controls how this item appears in the action bar.
*/
showAsAction: number;
/**
* Title of the item.
*/
title: string;
/**
* Shortened version of the item's title.
*/
titleCondensed: string;
/**
* Determines whether the menu item is visible.
*/
visible: boolean;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Android.MenuItem, event: MenuItemEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Collapse the action view associated with this menu item.
*/
collapseActionView(): void;
/**
* Expand the action view associated with this menu item.
*/
expandActionView(): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: MenuItemEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Returns the [actionViewExpanded](Titanium.Android.MenuItem.actionViewExpanded) state of the menu item.
* @deprecated Use the property instead.
*/
isActionViewExpanded(): boolean;
/**
* Returns the [checkable](Titanium.Android.MenuItem.checkable) state of the menu item.
* @deprecated Use the property instead.
*/
isCheckable(): boolean;
/**
* Returns the [checked](Titanium.Android.MenuItem.checked) state of the menu item.
* @deprecated Use the property instead.
*/
isChecked(): boolean;
/**
* Returns the [enabled](Titanium.Android.MenuItem.enabled) state of the menu item.
* @deprecated Use the property instead.
*/
isEnabled(): boolean;
/**
* Returns the [visible](Titanium.Android.MenuItem.visible) state of the menu item.
* @deprecated Use the property instead.
*/
isVisible(): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Android.MenuItem, event: MenuItemEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Sets the [checkable](Titanium.Android.MenuItem.checkable) state of the menu item.
* @deprecated Use the property instead.
*/
setCheckable: never;
/**
* Sets the [checked](Titanium.Android.MenuItem.checked) state of the menu item.
* @deprecated Use the property instead.
*/
setChecked: never;
/**
* Sets the [enabled](Titanium.Android.MenuItem.enabled) state of the menu item.
* @deprecated Use the property instead.
*/
setEnabled: never;
/**
* Sets the [visible](Titanium.Android.MenuItem.visible) state of the menu item.
* @deprecated Use the property instead.
*/
setVisible: never;
}
/**
* UI notifications that can be sent while the application is in the background.
*/
class Notification extends Titanium.Proxy {
/**
* The audio stream type to use when playing the sound.
*/
audioStreamType: number;
/**
* Sets the notification's category.
*/
category: string;
/**
* The channel id specified for the notification.
*/
channelId: string;
/**
* Accent color used behind icon.
*/
color: string;
/**
* The `PendingIntent` to execute when the expanded status entry is clicked.
*/
contentIntent: Titanium.Android.PendingIntent;
/**
* Description text of the notification.
*/
contentText: string;
/**
* Title of the notification.
*/
contentTitle: string;
/**
* Custom layout to display in the notification.
*/
contentView: Titanium.Android.RemoteViews;
/**
* Specifies which values should be taken from the defaults.
*/
defaults: number;
/**
* The `PendingIntent` to execute when the status entry is deleted by the user with the "Clear All Notifications" button.
*/
deleteIntent: Titanium.Android.PendingIntent;
/**
* Set of flags for the notification.
*/
flags: number;
/**
* The group key that the notification will belong to.
*/
groupKey: string;
/**
* Specifies if this is a group summary notification.
*/
groupSummary: boolean;
/**
* Notification icon, specified as an Android resource ID, or a local URL to a density-specific image.
*/
icon: number | string;
/**
* Add a large icon to the notification (and the ticker on some devices) specified as an Android resource ID, or a local URL to a density-specific image.
*/
largeIcon: number | string;
/**
* The color for the LED to blink.
*/
ledARGB: number;
/**
* The number of milliseconds for the LED to be off while it's flashing.
*/
ledOffMS: number;
/**
* The number of milliseconds for the LED to be on while it's flashing.
*/
ledOnMS: number;
/**
* The number of events that this notification represents.
*/
number: number;
/**
* Sets the priority of the notification.
*/
priority: number;
/**
* A URL to the sound to play.
*/
sound: string;
/**
* Style object that can apply a rich notification style.
*/
style: Titanium.Android.BigTextStyle | Titanium.Android.BigPictureStyle;
/**
* Text to scroll across the screen when this item is added to the status bar.
*/
tickerText: string;
/**
* Allows user to conceal private information of the notification on the lock screen.
*/
visibility: number;
/**
* Will wake up the device for the given time (in milliseconds) when the notification is shown.
* The application needs to also set the `android.permission.WAKE_LOCK` permission
* in the Android manifest section of the `tiapp.xml` file.
* ``` xml
*
*
*
*
*
*
*
* ```
*/
wakeLock: wakeLockOptions;
/**
* The timestamp for the notification (defaults to the current time).
*/
when: Date | number;
/**
* Add an action button to the notification
*/
addAction(icon: number | string, title: string, intent: Titanium.Android.PendingIntent): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Sets the latest event info using the built-in notification view for this notification.
*/
setLatestEventInfo(
contentTitle: string,
contentText: string,
contentIntent: Titanium.Android.PendingIntent,
): void;
/**
* Set the progress this notification represents.
*/
setProgress(max: number, progress: number, indeterminate: boolean): void;
}
/**
* Module for notification channels.
*/
class NotificationChannel extends Titanium.Proxy {
/**
* Whether or not notifications posted to this channel can interrupt the user.
*/
bypassDnd: boolean;
/**
* User visible description of this channel.
*/
description: string;
/**
* Whether notifications posted to this channel should display notification lights
*/
enableLights: boolean;
/**
* Whether notification posted to this channel should vibrate.
*/
enableVibration: boolean;
/**
* Group id this channel belongs to.
*/
groupId: string;
/**
* The channel id specified for the notification channel.
*/
id: string;
/**
* The audio stream type to use when playing the sound.
*/
importance: number;
/**
* The notification light color for notifications posted to this channel.
*/
lightColor: number;
/**
* Whether or not notifications posted to this channel are shown on the lock screen in full or redacted form.
*/
lockscreenVisibility: number;
/**
* The visible name of this channel.
* The recommended maximum length is 40 characters; the value may be truncated if it is too long.
*/
name: string;
/**
* Whether notifications posted to this channel can appear as application icon badges in a Launcher.
*/
showBadge: boolean;
/**
* A URL to the sound to play.
*/
sound: string;
/**
* The vibration pattern for notifications posted to this channel.
*/
vibratePattern: number[];
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Module for managing notifications.
*/
class NotificationManager extends Titanium.Module {
/**
* Use instead.
*/
static readonly DEFAULT_ALL: number;
/**
* Use instead.
*/
static readonly DEFAULT_LIGHTS: number;
/**
* Use instead.
*/
static readonly DEFAULT_SOUND: number;
/**
* Use instead.
*/
static readonly DEFAULT_VIBRATE: number;
/**
* Use instead.
*/
static readonly FLAG_AUTO_CANCEL: number;
/**
* Use instead.
*/
static readonly FLAG_INSISTENT: number;
/**
* Use instead.
*/
static readonly FLAG_NO_CLEAR: number;
/**
* Use instead.
*/
static readonly FLAG_ONGOING_EVENT: number;
/**
* Use instead.
*/
static readonly FLAG_ONLY_ALERT_ONCE: number;
/**
* Use instead.
*/
static readonly FLAG_SHOW_LIGHTS: number;
/**
* Use instead.
*/
static readonly STREAM_DEFAULT: number;
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: boolean;
/**
* The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
*/
static lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup;
/**
* Returns an object with the ID and name of the notification channels
*/
static notificationChannels: Dictionary;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Applies the properties to the proxy.
*/
static applyProperties(props: any): void;
/**
* Returns whether showing notifications is enabled for the application.
*/
static areNotificationsEnabled(): boolean;
/**
* Cancels a previously displayed notification.
*/
static cancel(id: number): void;
/**
* Cancels all previously displayed notifications.
*/
static cancelAll(): void;
/**
* Create a notification channel.
*/
static createNotificationChannel(
parameters: Dictionary,
): Titanium.Android.NotificationChannel;
/**
* Deletes a notification channel.
*/
static deleteNotificationChannel(id: string): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: string, event?: any): void;
/**
* Adds a persistent notification to the status bar.
*/
static notify(id: number, notification: Titanium.Android.Notification): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* The Titanium binding of an Android `PendingIntent`.
*/
class PendingIntent extends Titanium.Proxy {
/**
* Flags used for creating the Pending Intent.
*/
flags: number;
/**
* The intent data to pass to the [Activity](Titanium.Android.Activity) launched by this `PendingIntent`.
*/
intent: Titanium.Android.Intent;
/**
* If this property is true, flag will be
* appended to `flags` automatically. Default value is true.
*/
updateCurrentIntent: boolean;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Base event for class Titanium.Android.QuickSettingsService
*/
interface QuickSettingsServiceBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Android.QuickSettingsService;
}
/**
* For Javascript-based services that you create, `pause` fires after each time the JavaScript
* code executes.
*/
interface QuickSettingsService_pause_Event extends QuickSettingsServiceBaseEvent {
/**
* Incrementing integer indicating which iteration of an interval-based Service is pausing.
* For example, if you have an interval-based Service running every 10 seconds, iteration
* 3 would occur at about 30 seconds after you start the instance (assuming your service
* code runs quickly).
*/
iteration: number;
}
/**
* For JavaScript-based Services which you create, `resume` fires each time the JavaScript
* code executes.
*/
interface QuickSettingsService_resume_Event extends QuickSettingsServiceBaseEvent {
/**
* Incrementing integer indicating which iteration of an interval-based Service is pausing.
* For example, if you have an interval-based Service running every 10 seconds, iteration
* 3 would occur at about 30 seconds after you start the instance (assuming your service
* code runs quickly).
*/
iteration: number;
}
/**
* Fired when the bound service instance starts.
*/
interface QuickSettingsService_start_Event extends QuickSettingsServiceBaseEvent {
}
/**
* Fired when the bound service instance stops.
*/
interface QuickSettingsService_stop_Event extends QuickSettingsServiceBaseEvent {
}
/**
* Fired when the task that comes from the service's application has been removed.
*/
interface QuickSettingsService_taskremoved_Event extends QuickSettingsServiceBaseEvent {
}
/**
* Tile is listening for events.
*/
interface QuickSettingsService_startlistening_Event extends QuickSettingsServiceBaseEvent {
}
/**
* Tile has stopped listening for events.
*/
interface QuickSettingsService_stoplistening_Event extends QuickSettingsServiceBaseEvent {
}
/**
* The Tile has been added in the quick menu.
*/
interface QuickSettingsService_tileadded_Event extends QuickSettingsServiceBaseEvent {
}
/**
* The Tile has been removed from the quick menu.
*/
interface QuickSettingsService_tileremoved_Event extends QuickSettingsServiceBaseEvent {
}
/**
* An item from the single choice menu has been selected.
*/
interface QuickSettingsService_tiledialogoptionselected_Event extends QuickSettingsServiceBaseEvent {
/**
* Index of the selected item from the single choice menu in the dialog.
*/
itemIndex: number;
}
/**
* Dispatched when the alert dialog has been cancelled.
*/
interface QuickSettingsService_tiledialogcancelled_Event extends QuickSettingsServiceBaseEvent {
}
/**
* Dispatched when the positive (index 0) button has been clicked.
*/
interface QuickSettingsService_tiledialogpositive_Event extends QuickSettingsServiceBaseEvent {
}
/**
* Dispatched when the neutral (index 1) button has been clicked.
*/
interface QuickSettingsService_tiledialogneutral_Event extends QuickSettingsServiceBaseEvent {
}
/**
* Dispatched when the negative (index 2) button has been clicked.
*/
interface QuickSettingsService_tiledialognegative_Event extends QuickSettingsServiceBaseEvent {
}
interface QuickSettingsServiceEventMap extends ProxyEventMap {
pause: QuickSettingsService_pause_Event;
resume: QuickSettingsService_resume_Event;
start: QuickSettingsService_start_Event;
startlistening: QuickSettingsService_startlistening_Event;
stop: QuickSettingsService_stop_Event;
stoplistening: QuickSettingsService_stoplistening_Event;
taskremoved: QuickSettingsService_taskremoved_Event;
tileadded: QuickSettingsService_tileadded_Event;
tiledialogcancelled: QuickSettingsService_tiledialogcancelled_Event;
tiledialognegative: QuickSettingsService_tiledialognegative_Event;
tiledialogneutral: QuickSettingsService_tiledialogneutral_Event;
tiledialogoptionselected: QuickSettingsService_tiledialogoptionselected_Event;
tiledialogpositive: QuickSettingsService_tiledialogpositive_Event;
tileremoved: QuickSettingsService_tileremoved_Event;
}
/**
* Android service for creating custom quick settings tiles and handling user's interaction with them.
*/
class QuickSettingsService extends Titanium.Android.Service {
/**
* Changes the Tile's icon.
*/
icon: string | Titanium.Blob | Titanium.Filesystem.File;
/**
* The Tile's label.
*/
label: string;
/**
* Sets the state of the Tile.
*/
state: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Android.QuickSettingsService, event: QuickSettingsServiceEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(
name: K,
event?: QuickSettingsServiceEventMap[K],
): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Returns the Tile's current icon.
* @deprecated Please use the [icon](Titanium.Android.QuickSettingsService.icon) property to get/set the value.
*/
getIcon(): string | Titanium.Blob | Titanium.Filesystem.File;
/**
* Returns the Tile's current label.
* @deprecated Please use the [label](Titanium.Android.QuickSettingsService.label) property to get/set the value.
*/
getLabel(): string;
/**
* Returns the Tile's current state.
* @deprecated Please use the [state](Titanium.Android.QuickSettingsService.state) property to get/set the value.
*/
getState(): number;
/**
* Returns 'true' if the device is currently locked, 'false' otherwise.
*/
isLocked(): boolean;
/**
* Returns 'true' if the device is in secure state, 'false' otherwise.
*/
isSecure(): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Android.QuickSettingsService, event: QuickSettingsServiceEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Changes the Tile's icon.
* @deprecated Please use the [icon](Titanium.Android.QuickSettingsService.icon) property to get/set the value.
*/
setIcon(icon: string | Titanium.Blob | Titanium.Filesystem.File): void;
/**
* Changes the Tile's label.
* @deprecated Please use the [label](Titanium.Android.QuickSettingsService.label) property to get/set the value.
*/
setLabel(label: string): void;
/**
* Sets the state of the Tile.
* @deprecated Please use the [state](Titanium.Android.QuickSettingsService.state) property to get/set the value.
*/
setState(state: number): void;
/**
* Opens an Alert dialog.
*/
showDialog(options: showParams): void;
/**
* Collapses the quick settings menu and starts an activity for the passed Intent.
*/
startActivityAndCollapse(intent: Titanium.Android.Intent): void;
/**
* Prompts the user to unlock the device and runs the JS code.
*/
unlockAndRun(jsCode: string): void;
/**
* Applies current tile's properties.
*/
updateTile(): void;
}
/**
* The Titanium binding of the native Android `R` class, giving access to
* Android system-wide resources or application resources.
*/
interface R extends Titanium.Proxy {
/**
* Animation resources. See
* [R.anim](https://developer.android.com/reference/android/R.anim.html)
* in the Android Developer Reference.
*/
readonly anim: any;
/**
* Animator resources. See
* [R.animator](https://developer.android.com/reference/android/R.animator.html)
* in the Android Developer Reference.
*/
readonly animator: any;
/**
* Array resources. See [R.array](https://developer.android.com/reference/android/R.array.html)
* in the Android Developer Reference.
*/
readonly array: any;
/**
* Attribute resources. See
* [R.attr](https://developer.android.com/reference/android/R.attr.html)
* in the Android Developer Reference.
*/
readonly attr: any;
/**
* Boolean resources. See
* [R.bool](https://developer.android.com/reference/android/R.bool.html)
* in the Android Developer Reference.
*/
readonly bool: any;
/**
* Color resources. See
* [R.color](https://developer.android.com/reference/android/R.color.html)
* in the Android Developer Reference.
*/
readonly color: any;
/**
* Dimension resources. See
* [https://developer.android.com/reference/android/R.dimen.html](https://developer.android.com/reference/android/R.dimen.html)
* in the Android Developer Reference.
*/
readonly dimen: any;
/**
* Drawable resources. See
* [R.drawable](https://developer.android.com/reference/android/R.drawable.html)
* in the Android Developer Reference.
*/
readonly drawable: any;
/**
* Fraction resources. See
* [R.fraction](https://developer.android.com/reference/android/R.fraction.html)
* in the Android Developer Reference.
*/
readonly fraction: any;
/**
* ID resources. See
* [R.id](https://developer.android.com/reference/android/R.id.html)
* in the Android Developer Reference.
*/
readonly id: any;
/**
* Integer resources. See
* [R.integer](https://developer.android.com/reference/android/R.integer.html)
* in the Android Developer Reference.
*/
readonly integer: any;
/**
* Interpolator resources. See
* [R.fraction](https://developer.android.com/reference/android/R.interpolator.html)
* in the Android Developer Reference.
*/
readonly interpolator: any;
/**
* Layout resources. See
* [R.layout](https://developer.android.com/reference/android/R.layout.html)
* in the Android Developer Reference.
*/
readonly layout: any;
/**
* Menu resources. See
* [R.menu](https://developer.android.com/reference/android/R.menu.html)
* in the Android Developer Reference.
*/
readonly menu: any;
/**
* Mipmap resources. See
* [R.mipmap](https://developer.android.com/reference/android/R.mipmap.html)
* in the Android Developer Reference.
*/
readonly mipmap: any;
/**
* Plurals resources. See
* [R.plurals](https://developer.android.com/reference/android/R.plurals.html)
* in the Android Developer Reference.
*/
readonly plurals: any;
/**
* Raw resources. See
* [R.raw](https://developer.android.com/reference/android/R.raw.html)
* in the Android Developer Reference.
*/
readonly raw: any;
/**
* String resources. See
* [R.string](https://developer.android.com/reference/android/R.string.html)
* in the Android Developer Reference.
*/
readonly string: any;
/**
* Style resources. See
* [R.style](https://developer.android.com/reference/android/R.style.html)
* in the Android Developer Reference.
*/
readonly style: any;
/**
* Styleable resources. See
* [R.styleable](https://developer.android.com/reference/android/R.styleable.html)
* in the Android Developer Reference.
*/
readonly styleable: any;
/**
* Transition resources. See
* [R.transition](https://developer.android.com/reference/android/R.transition.html)
* in the Android Developer Reference.
*/
readonly transition: any;
/**
* XML resources. See
* [R.xml](https://developer.android.com/reference/android/R.xml.html)
* in the Android Developer Reference.
*/
readonly xml: any;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* The Titanium binding of [Android RemoteViews](https://developer.android.com/reference/android/widget/RemoteViews.html).
*/
class RemoteViews extends Titanium.Proxy {
/**
* Android layout resource ID for the view to display. Required.
*/
layoutId: number;
/**
* Package name that the resource ID lives in. Optional.
*/
packageName: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Calls a method taking a single `boolean` argument on a view in the remote view
* hierarchy. See Android's documentation for
* [setBoolean](https://developer.android.com/reference/android/widget/RemoteViews.html#setBoolean(int, java.lang.String, boolean)).
*/
setBoolean(viewId: number, methodName: string, value: boolean): void;
/**
* Sets the base time, format string, and started flag for a chronometer
* in the remote view hierarchy.
*/
setChronometer(viewId: number, base: Date, format: string, started: boolean): void;
/**
* Calls a method taking a single `double` argument on a view in the remote view
* hierarchy.
*/
setDouble(viewId: number, methodName: string, value: number): void;
/**
* Sets the image for an image view in the remote view hierarchy using an Android drawable resource.
*/
setImageViewResource(viewId: number, srcId: number): void;
/**
* Sets the image for an image view in the remote view hierarchy using a URI.
*/
setImageViewUri(viewId: number, uri: string): void;
/**
* Calls a method taking a single `int` argument on a view in the remote view hierarchy.
*/
setInt(viewId: number, methodName: string, value: number): void;
/**
* Launches a when the specified view is clicked.
*/
setOnClickPendingIntent(viewId: number, pendingIntent: Titanium.Android.PendingIntent): void;
/**
* Sets the progress, max value, and indeterminate flag of a progress bar in the
* remote view hierarchy.
*/
setProgressBar(viewId: number, max: number, progress: number, indeterminate: boolean): void;
/**
* Calls a method taking a single String argument on a view in the remote view
* hierarchy.
*/
setString(viewId: number, methodName: string, value: string): void;
/**
* Sets the text color of a view in the remote view hierarchy.
*/
setTextColor(viewId: number, color: number): void;
/**
* Sets the text of a text view in the remote view hierarchy.
*/
setTextViewText(viewId: number, text: string): void;
/**
* Calls a method taking one URI on a view in the remote view hierarchy.
*/
setUri(viewId: number, methodName: string, value: string): void;
/**
* Sets the visibility of a view in the remote view hierarchy.
*/
setViewVisibility(viewId: number, visibility: number): void;
}
/**
* Base event for class Titanium.Android.Service
*/
interface ServiceBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Android.Service;
}
/**
* For Javascript-based services that you create, `pause` fires after each time the JavaScript
* code executes.
*/
interface Service_pause_Event extends ServiceBaseEvent {
/**
* Incrementing integer indicating which iteration of an interval-based Service is pausing.
* For example, if you have an interval-based Service running every 10 seconds, iteration
* 3 would occur at about 30 seconds after you start the instance (assuming your service
* code runs quickly).
*/
iteration: number;
}
/**
* For JavaScript-based Services which you create, `resume` fires each time the JavaScript
* code executes.
*/
interface Service_resume_Event extends ServiceBaseEvent {
/**
* Incrementing integer indicating which iteration of an interval-based Service is pausing.
* For example, if you have an interval-based Service running every 10 seconds, iteration
* 3 would occur at about 30 seconds after you start the instance (assuming your service
* code runs quickly).
*/
iteration: number;
}
/**
* Fired when the bound service instance starts.
*/
interface Service_start_Event extends ServiceBaseEvent {
}
/**
* Fired when the bound service instance stops.
*/
interface Service_stop_Event extends ServiceBaseEvent {
}
/**
* Fired when the task that comes from the service's application has been removed.
*/
interface Service_taskremoved_Event extends ServiceBaseEvent {
}
interface ServiceEventMap extends ProxyEventMap {
pause: Service_pause_Event;
resume: Service_resume_Event;
start: Service_start_Event;
stop: Service_stop_Event;
taskremoved: Service_taskremoved_Event;
}
/**
* Android application component that executes in the background.
*/
class Service extends Titanium.Proxy {
/**
* The intent used to start or bind to the Service.
*/
readonly intent: Titanium.Android.Intent;
/**
* A service can be started more than once -- this number (based on an incrementing integer)
* indicates which "start number" in the sequence the current service instance is.
*/
readonly serviceInstanceId: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Android.Service, event: ServiceEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: ServiceEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Puts the service into the "background" state and removes its foreground notification.
*/
foregroundCancel(): void;
/**
* Puts the service into the "foreground" state and displays a notification.
*/
foregroundNotify(
id: number,
notification: Titanium.Android.Notification,
foregroundServiceType?: number,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Android.Service, event: ServiceEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Starts the Service.
*/
start(): void;
/**
* Stops this running instance of the Service.
*/
stop(): void;
}
}
/**
* The top-level App module is mainly used for accessing information about the
* application at runtime, and for sending or listening for system events.
*/
namespace App {
/**
* Convenience constant for system event "accessibilityannouncement".
*/
const EVENT_ACCESSIBILITY_ANNOUNCEMENT: string;
/**
* Convenience constant for system event "accessibilitychanged".
*/
const EVENT_ACCESSIBILITY_CHANGED: string;
/**
* The top-level App iOS module, available only to iOS devices, that includes the facilities to
* create and manage local notifications and background services.
*/
namespace iOS {
/**
* Use with [setMinimumBackgroundFetchInterval](Titanium.App.iOS.setMinimumBackgroundFetchInterval) method.
* Specifies the smallest fetch interval supported by the system.
*/
const BACKGROUNDFETCHINTERVAL_MIN: number;
/**
* Use with [setMinimumBackgroundFetchInterval](Titanium.App.iOS.setMinimumBackgroundFetchInterval) method.
* Used to specify a fetch interval large enough to prevent fetch operations from occurring.
*/
const BACKGROUNDFETCHINTERVAL_NEVER: number;
/**
* Convenience constant for system event "accessibilitylayoutchanged".
*/
const EVENT_ACCESSIBILITY_LAYOUT_CHANGED: string;
/**
* Convenience constant for system event "accessibilityscreenchanged".
*/
const EVENT_ACCESSIBILITY_SCREEN_CHANGED: string;
/**
* A dark interface style.
* @deprecated Use instead, which is supported cross-platform.
*/
const USER_INTERFACE_STYLE_DARK: number;
/**
* A light interface style.
* @deprecated Use instead, which is supported cross-platform.
*/
const USER_INTERFACE_STYLE_LIGHT: number;
/**
* An unspecified interface style.
* @deprecated Use instead, which is supported cross-platform.
*/
const USER_INTERFACE_STYLE_UNSPECIFIED: number;
/**
* The action will execute in background. Use with the
* [activationMode](Titanium.App.iOS.UserNotificationAction.activationMode) property.
*/
const USER_NOTIFICATION_ACTIVATION_MODE_BACKGROUND: number;
/**
* The action will launch the application and execute in the foreground.
* Use with the [activationMode](Titanium.App.iOS.UserNotificationAction.activationMode) property.
*/
const USER_NOTIFICATION_ACTIVATION_MODE_FOREGROUND: number;
/**
* A alert dialog is presented when the notification is received.
*/
const USER_NOTIFICATION_ALERT_STYLE_ALERT: number;
/**
* A banner is presented when the notification is received.
*/
const USER_NOTIFICATION_ALERT_STYLE_BANNER: number;
/**
* No banner or alert dialog is presented when the notification is received.
*/
const USER_NOTIFICATION_ALERT_STYLE_NONE: number;
/**
* The application is authorized to post user notifications.
*/
const USER_NOTIFICATION_AUTHORIZATION_STATUS_AUTHORIZED: number;
/**
* The application is not authorized to post user notifications.
*/
const USER_NOTIFICATION_AUTHORIZATION_STATUS_DENIED: number;
/**
* The user has not yet made a choice regarding whether the application may post
* user notifications.
*/
const USER_NOTIFICATION_AUTHORIZATION_STATUS_NOT_DETERMINED: number;
/**
* The application is provisionally authorized to post non-interruptive user notifications.
*/
const USER_NOTIFICATION_AUTHORIZATION_STATUS_PROVISIONAL: number;
/**
* Default action behavior with no additional action support.
*/
const USER_NOTIFICATION_BEHAVIOR_DEFAULT: number;
/**
* Provides a textfield with the notification for the user to enter a text response.
*/
const USER_NOTIFICATION_BEHAVIOR_TEXTINPUT: number;
/**
* Allow CarPlay to display notifications of this type.
*/
const USER_NOTIFICATION_CATEGORY_OPTION_ALLOW_IN_CARPLAY: number;
/**
* Send dismiss actions to the UNUserNotificationCenter object's delegate for handling.
*/
const USER_NOTIFICATION_CATEGORY_OPTION_CUSTOM_DISMISS_ACTION: number;
/**
* Show the notification's subtitle, even if the user has disabled notification previews for the app.
*/
const USER_NOTIFICATION_CATEGORY_OPTION_HIDDEN_PREVIEWS_SHOW_SUBTITLE: number;
/**
* Show the notification's title, even if the user has disabled notification previews for the app.
*/
const USER_NOTIFICATION_CATEGORY_OPTION_HIDDEN_PREVIEWS_SHOW_TITLE: number;
/**
* No options.
*/
const USER_NOTIFICATION_CATEGORY_OPTION_NONE: number;
/**
* The notification setting is turned off.
*/
const USER_NOTIFICATION_SETTING_DISABLED: number;
/**
* The notification setting is turned on.
*/
const USER_NOTIFICATION_SETTING_ENABLED: number;
/**
* The application does not support this notification type.
*/
const USER_NOTIFICATION_SETTING_NOT_SUPPORTED: number;
/**
* The application may display an alert upon a notification being received.
* Use with the [types](UserNotificationSettings.types) property.
*/
const USER_NOTIFICATION_TYPE_ALERT: number;
/**
* The application may badge its icon upon a notification being received.
* Use with the [types](UserNotificationSettings.types) property.
*/
const USER_NOTIFICATION_TYPE_BADGE: number;
/**
* The ability to play sounds for critical alerts.
* Use with the [types](UserNotificationSettings.types) property.
*/
const USER_NOTIFICATION_TYPE_CRITICAL_ALERT: number;
/**
* The application may not present any UI upon a notification being received.
* Use with the [types](UserNotificationSettings.types) property.
*/
const USER_NOTIFICATION_TYPE_NONE: number;
/**
* An option indicating the system should display a button for in-app notification settings.
* Use with the [types](UserNotificationSettings.types) property.
*/
const USER_NOTIFICATION_TYPE_PROVIDES_APP_NOTIFICATION_SETTINGS: number;
/**
* The ability to post non-interrupting notifications provisionally to the Notification Center.
* Use with the [types](UserNotificationSettings.types) property.
*/
const USER_NOTIFICATION_TYPE_PROVISIONAL: number;
/**
* The application may play a sound upon a notification being received.
* Use with the [types](UserNotificationSettings.types) property.
*/
const USER_NOTIFICATION_TYPE_SOUND: number;
/**
* Uniform type identifier for macOS icon images.
*/
const UTTYPE_APPLE_ICNS: string;
/**
* Uniform type identifier for Apple-protected MPEG-4 audio.
*/
const UTTYPE_APPLE_PROTECTED_MPEG4_AUDIO: string;
/**
* Uniform type identifier for all audio content.
*/
const UTTYPE_AUDIO: string;
/**
* Uniform type identifier for Windows bitmap images.
*/
const UTTYPE_BMP: string;
/**
* Uniform type identifier for Rich Text with content embedding, pasteboard format.
*/
const UTTYPE_FLAT_RTFD: string;
/**
* Uniform type identifier for GIF images.
*/
const UTTYPE_GIF: string;
/**
* Uniform type identifier for HTML.
*/
const UTTYPE_HTML: string;
/**
* Uniform type identifier for Windows icon images.
*/
const UTTYPE_ICO: string;
/**
* Uniform type identifier for all image types.
*/
const UTTYPE_IMAGE: string;
/**
* Uniform type identifier for JPEG images.
*/
const UTTYPE_JPEG: string;
/**
* Uniform type identifier for JPEG 2000 images.
*/
const UTTYPE_JPEG2000: string;
/**
* Uniform type identifier for all audiovisual content.
*/
const UTTYPE_MOVIE: string;
/**
* Uniform type identifier for MP3 audio.
*/
const UTTYPE_MP3: string;
/**
* Uniform type identifier for MPEG-1 and MPEG-2 content.
*/
const UTTYPE_MPEG: string;
/**
* Uniform type identifier for MPEG-4 content.
*/
const UTTYPE_MPEG4: string;
/**
* Uniform type identifier for MPEG-4 audio.
*/
const UTTYPE_MPEG4_AUDIO: string;
/**
* Uniform type identifier for PDF data.
*/
const UTTYPE_PDF: string;
/**
* Uniform type identifier for PICT images.
*/
const UTTYPE_PICT: string;
/**
* Uniform type identifier for a plain text type, equivalent to MIME type text/plain.
*/
const UTTYPE_PLAIN_TEXT: string;
/**
* Uniform type identifier for PNG images.
*/
const UTTYPE_PNG: string;
/**
* Uniform type identifier for QuickTime images.
*/
const UTTYPE_QUICKTIME_IMAGE: string;
/**
* Uniform type identifier for QuickTime movies.
*/
const UTTYPE_QUICKTIME_MOVIE: string;
/**
* Uniform type identifier for Rich Text.
*/
const UTTYPE_RTF: string;
/**
* Uniform type identifier for Rich Text Format Directory, that is, Rich Text with content embedding, on-disk format.
*/
const UTTYPE_RTFD: string;
/**
* Uniform type identifier for all text types.
*/
const UTTYPE_TEXT: string;
/**
* Uniform type identifier for TIFF images.
*/
const UTTYPE_TIFF: string;
/**
* Uniform type identifier for MLTE (Textension) format for mixed text and multimedia data.
*/
const UTTYPE_TXN_TEXT_AND_MULTIMEDIA_DATA: string;
/**
* Uniform type identifier for Unicode-16 with byte-order mark (BOM), or if BOM is not present,
* an external representation byte order (big-endian).
*/
const UTTYPE_UTF16_EXTERNAL_PLAIN_TEXT: string;
/**
* Uniform type identifier for Unicode-16, native byte order, with an optional byte-order mark (BOM).
*/
const UTTYPE_UTF16_PLAIN_TEXT: string;
/**
* Uniform type identifier for Unicode-8 plain text type.
*/
const UTTYPE_UTF8_PLAIN_TEXT: string;
/**
* Uniform type identifier for all video content without audio.
*/
const UTTYPE_VIDEO: string;
/**
* Uniform type identifier for WebKit webarchive format.
*/
const UTTYPE_WEB_ARCHIVE: string;
/**
* Uniform type identifier for XML.
*/
const UTTYPE_XML: string;
/**
* Use this module to communicate with the native iOS 16+ Dynamic Island APIs.
*/
interface ActivityAttributes {
/**
* Starts a new activity (aka the Dynamic Island) with the provided parameters
*/
startActivity(value: any): void;
}
/**
* A service that runs when the application is placed in the background.
*/
class BackgroundService extends Titanium.Proxy {
/**
* A local URL to a JavaScript file containing the code to run in the background.
*/
url: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Stops the service from running during the current background session to conserve resources.
*/
stop(): void;
/**
* Unregisters the background service.
*/
unregister(): void;
}
/**
* A local notification to alert the user of new or pending application information.
*/
class LocalNotification extends Titanium.Proxy {
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Cancels the pending notification.
* @deprecated Use [Titanium.App.iOS.UserNotificationCenter.removePendingNotifications](Titanium.App.iOS.UserNotificationCenter.removePendingNotifications) instead.
*/
cancel(): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Base event for class Titanium.App.iOS.SearchQuery
*/
interface SearchQueryBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.App.iOS.SearchQuery;
}
/**
* Fired when the query finds a new batch of matching items.
*/
interface SearchQuery_founditems_Event extends SearchQueryBaseEvent {
/**
* The number of items that are currently fetched.
*/
foundItemsCount: number;
/**
* An array of indexed items that match the specified query.
*/
items: Titanium.App.iOS.SearchableItem[];
}
/**
* Fired when the query completes to inform you about it's success.
* To receive items, use the `founditems` event.
*/
interface SearchQuery_completed_Event extends SearchQueryBaseEvent {
/**
* Error message, if any returned. Undefined otherwise.
*/
error: string;
/**
* Indicates if the operation succeeded. Returns true if download succeeded, false otherwise.
*/
success: boolean;
}
interface SearchQueryEventMap extends ProxyEventMap {
completed: SearchQuery_completed_Event;
founditems: SearchQuery_founditems_Event;
}
/**
* A search query object manages the criteria to apply when searching app content that you have previously
* indexed by using the Core Spotlight APIs.
*/
class SearchQuery extends Titanium.Proxy {
/**
* An array of strings that represent the attributes of indexed items.
*/
attributes: string[];
/**
* A formatted string that defines the matching criteria to apply to indexed items.
*/
queryString: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.App.iOS.SearchQuery, event: SearchQueryEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Cancels a query operation.
*/
cancel(): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: SearchQueryEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* A Boolean value that indicates if the query has been cancelled (`true`) or not (`false`).
*/
isCancelled(): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.App.iOS.SearchQuery, event: SearchQueryEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Asynchronously queries the index for items that match the query object's specifications.
*/
start(): void;
}
/**
* The SearchableIndex module is used to add or remove Ti.App.iOS.SearchableItem objects from the device search index.
*/
class SearchableIndex extends Titanium.Proxy {
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Adds an array of Titanium.App.iOS.SearchableItem objects to the default search index.
*/
addToDefaultSearchableIndex(
Array: ReadonlyArray,
callback: (param0: any) => void,
): void;
/**
* Removes search items based on an array of domain identifiers.
*/
deleteAllSearchableItemByDomainIdentifiers(
Array: ReadonlyArray,
callback: (param0: any) => void,
): void;
/**
* Removes all search items added by the application.
*/
deleteAllSearchableItems(callback: (param0: any) => void): void;
/**
* Removes search items based on an array of identifiers.
*/
deleteSearchableItemsByIdentifiers(Array: ReadonlyArray, callback: (param0: any) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Indicates whether indexing is supported by the device.
*/
isSupported(): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Used to create a unique object containing all of the search information that will appear in the device search index.
*/
class SearchableItem extends Titanium.Proxy {
/**
* Set of metadata properties to display for the item.
*/
attributeSet: Titanium.App.iOS.SearchableItemAttributeSet;
/**
* Identifier that represents the "domain" or owner of this item.
*/
domainIdentifier: string;
/**
* Searchable items have an expiration date or time to live. By default it is set to one month.
*/
expirationDate: string;
/**
* Unique identifier to your application group.
*/
uniqueIdentifier: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* The SearchableItemAttributeSet module defines metadata properties for SearchItem and UserActivity objects.
*/
class SearchableItemAttributeSet extends Titanium.Proxy {
/**
* The date that the item was moved into the current location.
*/
addedDate: string;
/**
* The title for a collection of media.
*/
album: string;
/**
* An array of localized strings of alternate display names for this item.
*/
alternateNames: string[];
/**
* The artist for the media.
*/
artist: string;
/**
* A class of entity for whom the resource is intended or useful.
*/
audiences: string[];
/**
* The audio bit rate.
*/
audioBitRate: number;
/**
* The number of channels in the audio data contained in the file.
*/
audioChannelCount: number;
/**
* The name of the application that encoded the data contained in the audio file.
*/
audioEncodingApplication: string;
/**
* The sample rate of the audio data contained in the file.
*/
audioSampleRate: number;
/**
* The track number of a song/composition when it is part of an album.
*/
audioTrackNumber: number;
/**
* The codecs used to encode/decode the media.
*/
codecs: string[];
/**
* Comment related to a file.
*/
comment: string;
/**
* The composer of the song/composition contained in the audio file.
*/
composer: string;
/**
* A list of contacts that are somehow associated with this document beyond what is captured as Author.
*/
contactKeywords: string[];
/**
* Display of the search container
*/
containerDisplayName: string;
/**
* Identifier for the search container
*/
containerIdentifier: string;
/**
* Order the search container is displayed.
*/
containerOrder: number;
/**
* Title displayed in the search container
*/
containerTitle: string;
/**
* The date that the contents of the item were created.
*/
contentCreationDate: string;
/**
* An account of the content of the resource.
*/
contentDescription: string;
/**
* The date that the contents of the item were last modified.
*/
contentModificationDate: string;
/**
* Whether or not the item has explicit content. Set to `1` for explicit or `0` for clean.
*/
contentRating: number;
/**
* Used to indicate where the item was obtained from.
*/
contentSources: string[];
/**
* UTI Type pedigree for an item.
*/
contentType: string;
/**
* Array of strings related to the content tree of the item.
*/
contentTypeTree: string[];
/**
* File URL representing the content to be indexed.
*/
contentURL: string;
/**
* Used to designate the entity responsible for making contributions to the content of the resource.
*/
contributors: string[];
/**
* Copyright of the content.
*/
copyright: string;
/**
* Used to designate the extent or scope of the content of the resource.
*/
coverage: string[];
/**
* Application used to create the document content (e.g. "Word","Framemaker", etc.).
*/
creator: string;
/**
* The delivery type of the item. Set to `0` for fast start and `1` for RTSP.
*/
deliveryType: number;
/**
* Director of the item, for example, the movie director.
*/
director: string;
/**
* A localized string to be displayed in the UI for this item.
*/
displayName: string;
/**
* The date that the file was last downloaded / received.
*/
downloadedDate: string;
/**
* Duration in seconds of the content of the item (if appropriate).
*/
duration: number;
/**
* The list of editor/editors that have worked on this item.
*/
editors: string[];
/**
* Software used to convert the original content into a PDF stream.
*/
encodingApplications: string[];
/**
* Size of the document in MB.
*/
fileSize: number;
/**
* Array of font names used in the item.
*/
fontNames: string[];
/**
* The fully formatted address of the item (obtained from MapKit).
*/
fullyFormattedAddress: string;
/**
* Used to indicates whether the MIDI sequence contained in the file is setup for use with a General MIDI device.
*/
generalMIDISequence: number;
/**
* Genre of the item, for example, movie genre.
*/
genre: string;
/**
* Used to reference to the resource within a given context.
*/
identifier: string;
/**
* Information about the item.
*/
information: string;
/**
* Content type of the attribute set.
*/
itemContentType: string;
/**
* The musical key of the song/composition contained in an audio file.
*/
keySignature: string;
/**
* Represents keywords associated with this particular item. Example keywords might be Birthday etc.
*/
keywords: string[];
/**
* Kind that the item represents.
*/
kind: string;
/**
* Used to designate the languages of the intellectual content of the resource.
*/
languages: string[];
/**
* The date that the item was last used.
*/
lastUsedDate: string;
/**
* Whether or not the item is local. Set to `1` if true and `0` otherwise.
*/
local: number;
/**
* The lyricist/text writer for song/composition contained in the audio file.
*/
lyricist: string;
/**
* Media types present in the content.
*/
mediaTypes: string[];
/**
* The date that the last metadata attribute was changed.
*/
metadataModificationDate: string;
/**
* The musical genre of the song/composition contained in the audio file.
*/
musicalGenre: string;
/**
* Metadata attribute that stores the category of instrument.
*/
musicalInstrumentCategory: string;
/**
* Metadata attribute that stores the name of instrument.
*/
musicalInstrumentName: string;
/**
* Used to indicate company/Organization that created the document.
*/
organizations: string[];
/**
* Original format of the movie.
*/
originalFormat: string;
/**
* Original source of the movie.
*/
originalSource: string;
/**
* Number of pages in the item.
*/
pageCount: number;
/**
* Height in points (72 points per inch) of the document page.
*/
pageHeight: number;
/**
* Width in points (72 points per inch) of the document page.
*/
pageWidth: number;
/**
* The list of people who are visible in an image or movie or written about in a document.
*/
participants: string[];
/**
* The complete path to the item.
*/
path: string;
/**
* Performers in the movie.
*/
performers: string[];
/**
* User play count of this item.
*/
playCount: number;
/**
* The postal code for the item according to guidelines established by the provider.
*/
postalCode: string;
/**
* Producer of the content.
*/
producer: string;
/**
* The list of projects that this item is part of.
*/
projects: string[];
/**
* Used to designate the entity responsible for making the resource available.
*/
publishers: string[];
/**
* User rating of this item out of 5 stars.
*/
rating: number;
/**
* A description of the rating, for example, the number of reviewers.
*/
ratingDescription: string;
/**
* The recording date of the song/composition.
*/
recordingDate: string;
/**
* For activities this is the unique identifier for the item this activity is related to.
*/
relatedUniqueIdentifier: string;
/**
* Used to provide a link to information about rights held in and over resource.
*/
rights: string[];
/**
* Used to indicate the role of the document creator.
*/
role: string;
/**
* Security (encryption) method used in the file.
*/
securityMethod: string;
/**
* Whether the content is prepared for streaming. Set to `0` for not streamable and `1` for streamable.
*/
streamable: number;
/**
* The sub-location (e.g., street number) for the item according to guidelines established by the provider.
*/
subThoroughfare: string;
/**
* Subject of the the item.
*/
subject: string;
/**
* Used to determine if navigation is supported.
*/
supportsNavigation: number;
/**
* Used to indicate that using the phone number is appropriate.
*/
supportsPhoneCall: number;
/**
* The tempo of the music contained in the audio file in Beats Per Minute.
*/
tempo: number;
/**
* Theme of the the item.
*/
theme: string;
/**
* The location (e.g., street name) for the item according to guidelines established by the provider.
*/
thoroughfare: string;
/**
* Image data for thumbnail for this item.
*/
thumbnailData: string | Titanium.Blob;
/**
* File URL pointing to a thumbnail image for this item.
*/
thumbnailURL: string;
/**
* The time signature of the musical composition contained in the audio/MIDI file.
*/
timeSignature: string;
/**
* The title of the particular item.
*/
title: string;
/**
* The total bit rate (audio and video combined) of the media.
*/
totalBitRate: number;
/**
* URL of the item.
*/
url: string;
/**
* A version specifier for this item.
*/
version: string;
/**
* The video bit rate.
*/
videoBitRate: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Base event for class Titanium.App.iOS.UserActivity
*/
interface UserActivityBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.App.iOS.UserActivity;
}
/**
* Fired if the activity context needs to be saved before being continued on another device.
* To fire the event, set the UserActivity object's `needsSave ` property to `true`.
* The receiver should update the activity with current activity state.
* After the event is fired, iOS will reset the `needsSave` property to false.
*/
interface UserActivity_useractivitywillsave_Event extends UserActivityBaseEvent {
/**
* The activityType of the User Activity triggering the event.
*/
activityType: string;
/**
* The title of the User Activity if defined.
*/
title: string;
/**
* Dictionary object containing the userInfo data of the User Activity.
*/
userInfo: any;
/**
* The webpageURL of the User Activity if defined.
*/
webpageURL: string;
}
/**
* Fired when the user activity was continued on another device.
*/
interface UserActivity_useractivitywascontinued_Event extends UserActivityBaseEvent {
/**
* The activityType of the User Activity triggering the event.
*/
activityType: string;
/**
* The title of the User Activity if defined.
*/
title: string;
/**
* Dictionary object containing the userInfo data of the User Activity.
*/
userInfo: any;
/**
* The webpageURL of the User Activity if defined.
*/
webpageURL: string;
}
/**
* Fired when the user activity get deleted using the or
* methods.
*/
interface UserActivity_useractivitydeleted_Event extends UserActivityBaseEvent {
}
interface UserActivityEventMap extends ProxyEventMap {
useractivitydeleted: UserActivity_useractivitydeleted_Event;
useractivitywascontinued: UserActivity_useractivitywascontinued_Event;
useractivitywillsave: UserActivity_useractivitywillsave_Event;
}
/**
* The UserActivity module is used to enable device Handoff and to create User Activities.
*/
class UserActivity extends Titanium.Proxy {
/**
* Name of the activity type.
*/
activityType: string;
/**
* Set to true if this user activity should be eligible to be handed off to another device
*/
eligibleForHandoff: boolean;
/**
* A Boolean value that determines whether Siri can suggest the user activity as a shortcut to the user.
*/
eligibleForPrediction: boolean;
/**
* Set to `true` if the user activity can be publicly accessed by all iOS users.
*/
eligibleForPublicIndexing: boolean;
/**
* Set to true if the user activity should be added to the on-device index.
*/
eligibleForSearch: boolean;
/**
* Absolute date after which the activity is no longer eligible to be indexed or handed off.
*/
expirationDate: string;
/**
* An array of string keywords representing words or phrases that might help the user to find the activity in the application history.
*/
keywords: string[];
/**
* Set to true every time you have updated the user activity and need the changes to be saved before handing it off to another device.
*/
needsSave: boolean;
/**
* A value used to identify the user activity.
*/
persistentIdentifier: string;
/**
* An array of String keys from the userInfo property which represent the minimal information about the user activity that should be stored for later restoration.
*/
requiredUserInfoKeys: string[];
/**
* Determines if user activities are supported (`true`) or not (`false`) by the device.
* @deprecated Use [Titanium.App.iOS.UserActivity.isSupported](Titanium.App.iOS.UserActivity.isSupported) instead.
*/
supported: boolean;
/**
* An optional, user-visible title for this activity such as a document name or web page title.
*/
title: string;
/**
* The userInfo dictionary contains application-specific state needed to continue an activity on another device.
*/
userInfo: any;
/**
* When no suitable application is installed on a resuming device and the `webpageURL` property is set,
* the user activity will instead be continued in a web browser by loading the specified URL.
*/
webpageURL: string;
/**
* Adds a Titanium.App.iOS.SearchableItemAttributeSet to the user activity.
*/
addContentAttributeSet(contentAttributeSet: Titanium.App.iOS.SearchableItemAttributeSet): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.App.iOS.UserActivity, event: UserActivityEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Marks the activity as currently in use by the user.
*/
becomeCurrent(): void;
/**
* Deletes all user activities created by your app.
*/
deleteAllSavedUserActivities(): void;
/**
* Deletes user activities created by your app that have the specified persistent identifiers.
*/
deleteSavedUserActivitiesForPersistentIdentifiers(persistentIdentifiers: ReadonlyArray): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: UserActivityEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Invalidates an activity when it is no longer eligible for continuation.
*/
invalidate(): void;
/**
* Determines if user activities are supported (`true`) or not (`false`) by the device.
*/
isSupported(): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.App.iOS.UserActivity, event: UserActivityEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Marks the activity as currently **not** in use and ineligible to be continued.
*/
resignCurrent(): void;
}
/**
* Base event for class Titanium.App.iOS.UserDefaults
*/
interface UserDefaultsBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.App.iOS.UserDefaults;
}
/**
* Fired when a property is changed.
*/
interface UserDefaults_change_Event extends UserDefaultsBaseEvent {
}
interface UserDefaultsEventMap extends ProxyEventMap {
change: UserDefaults_change_Event;
}
/**
* The UserDefaults module is used for storing application-related data in property/value pairs
* that persist beyond application sessions and device power cycles. UserDefaults allows the suiteName
* of the UserDefaults to be specified at creation time.
* **Important**: Using this API requires the `NSPrivacyAccessedAPICategoryUserDefaults` property set in the
* privacy manifest that was introduced in iOS 17. You can learn more about it [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api).
*/
interface UserDefaults extends Titanium.App.Properties {
/**
* Sets the name of the suite to be used to access UserDefaults.
*/
suiteName: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.App.iOS.UserDefaults, event: UserDefaultsEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: UserDefaultsEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.App.iOS.UserDefaults, event: UserDefaultsEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* An action the user selects in response to an interactive notification.
*/
class UserNotificationAction extends Titanium.Proxy {
/**
* Selects how to activate the application.
*/
activationMode: number;
/**
* Set to true if the action requires the device to be unlocked. On the Apple Watch actions never require authentication.
*/
authenticationRequired: boolean;
/**
* Custom behavior the user notification supports.
*/
behavior: number;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
bubbleParent: never;
/**
* Set to true if the action causes destructive behavior to the user's data or the application.
*/
destructive: boolean;
/**
* Identifier for this action. Used to identify the action the user pressed.
*/
identifier: string;
/**
* Title of the button displayed in the notification.
*/
title: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener: never;
/**
* Applies the properties to the proxy.
*/
applyProperties: never;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent: never;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener: never;
}
/**
* A set of notification actions to associate with a notification.
*/
class UserNotificationCategory extends Titanium.Proxy {
/**
* Array of notification actions to associate with the group.
*/
actionsForDefaultContext: Titanium.App.iOS.UserNotificationAction[];
/**
* Array of notification actions to display for non-dialog-style notification.
*/
actionsForMinimalContext: Titanium.App.iOS.UserNotificationAction[];
/**
* Indicates if the proxy will bubble an event to its parent.
*/
bubbleParent: never;
/**
* A format string for the summary description used when the system groups the category's notifications.
*/
categorySummaryFormat: string;
/**
* The placeholder text to display when notification previews are disabled for the app.
*/
hiddenPreviewsBodyPlaceholder: string;
/**
* Identifier for this category.
*/
identifier: string;
/**
* The intents related to notifications of this category.
*/
intentIdentifiers: string[];
/**
* Options for how to handle notifications of this type.
*/
options: number[];
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener: never;
/**
* Applies the properties to the proxy.
*/
applyProperties: never;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent: never;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener: never;
}
/**
* The top-level App iOS Notification Center module. It is used to control scheduled notifications
* and receive details about the system-wide notification settings.
*/
class UserNotificationCenter extends Titanium.Module {
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: never;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener: never;
/**
* Applies the properties to the proxy.
*/
static applyProperties: never;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent: never;
/**
* Fetches the delivered notifications asynchronously.
*/
static getDeliveredNotifications(callback: (param0: UserNotificationCallbackResponse) => void): void;
/**
* Fetches the pending notifications asynchronously.
*/
static getPendingNotifications(callback: (param0: UserNotificationCallbackResponse) => void): void;
/**
* Removes the specified delivered notifications from the notification-center.
* If no notifications are specified, all delivered notifications will be removed.
*/
static removeDeliveredNotifications(notifications: ReadonlyArray): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener: never;
/**
* Removes the specified pending notifications to prevent them from being triggered.
* If no notifications are specified, all pending notifications will be removed.
*/
static removePendingNotifications(notifications: ReadonlyArray): void;
/**
* Notification types and user notification categories the application is registered to use.
*/
static requestUserNotificationSettings(callback: (param0: GetUserNotificationSettings) => void): void;
}
}
/**
* Base event for class Titanium.App.Android
*/
interface AndroidBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.App.Android;
}
/**
* Fired when a is clicked.
*/
interface Android_shortcutitemclick_Event extends AndroidBaseEvent {
/**
* Identifier of the clicked shortcut item.
*/
id: string;
}
interface AndroidEventMap extends ProxyEventMap {
shortcutitemclick: Android_shortcutitemclick_Event;
}
/**
* A module used to access Android application resources.
*/
class Android extends Titanium.Module {
/**
* The `R` namespace for application resources.
*/
static readonly R: Titanium.Android.R;
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* The version number of the application.
*/
static readonly appVersionCode: number;
/**
* The version name of the application.
*/
static readonly appVersionName: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: boolean;
/**
* Return the intent that was used to launch the application.
*/
static readonly launchIntent: Titanium.Android.Intent;
/**
* The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
*/
static lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(
name: K,
callback: (this: Titanium.App.Android, event: AndroidEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Applies the properties to the proxy.
*/
static applyProperties(props: any): void;
/**
* Clears app data and cache. This will close the app.
*/
static clearUserCache(): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: K, event?: AndroidEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(
name: K,
callback: (this: Titanium.App.Android, event: AndroidEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Base event for class Titanium.App.Properties
*/
interface PropertiesBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.App.Properties;
}
/**
* Fired when a property is changed.
*/
interface Properties_change_Event extends PropertiesBaseEvent {
}
interface PropertiesEventMap extends ProxyEventMap {
change: Properties_change_Event;
}
/**
* The App Properties module is used for storing application-related data in property/value pairs
* that persist beyond application sessions and device power cycles.
*/
class Properties extends Titanium.Module {
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: boolean;
/**
* The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
*/
static lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(
name: K,
callback: (this: Titanium.App.Properties, event: PropertiesEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Applies the properties to the proxy.
*/
static applyProperties(props: any): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: K, event?: PropertiesEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: string, event?: any): void;
/**
* Returns the value of a property as a boolean data type.
*/
static getBool(property: string, defaultValue?: boolean): boolean;
/**
* Returns the value of a property as a double (double-precision, floating point) data type.
*/
static getDouble(property: string, defaultValue?: number): number;
/**
* Returns the value of a property as an integer data type.
*/
static getInt(property: string, defaultValue?: number): number;
/**
* Returns the value of a property as an array data type.
*/
static getList(property: string, defaultValue?: ReadonlyArray): any[];
/**
* Returns the value of a property as an object.
*/
static getObject(property: string, defaultValue?: any): any;
/**
* Returns the value of a property as a string data type.
*/
static getString(property: string, defaultValue?: string): string;
/**
* Indicates whether a property exists.
*/
static hasProperty(property: string): boolean;
/**
* Returns an array of property names.
*/
static listProperties(): any[];
/**
* Removes all properties that have been set by the user on runtime, or does nothing otherwise.
*/
static removeAllProperties(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(
name: K,
callback: (this: Titanium.App.Properties, event: PropertiesEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Removes a property if it exists, or does nothing otherwise.
*/
static removeProperty(property: string): void;
/**
* Sets the value of a property as a boolean data type. The property will be created if it
* does not exist.
*/
static setBool(property: string, value: boolean): void;
/**
* Sets the value of a property as a double (double-precision, floating point) data type. The
* property will be created if it does not exist.
*/
static setDouble(property: string, value: number): void;
/**
* Sets the value of a property as an integer data type. The property will be created if it
* does not exist.
*/
static setInt(property: string, value: number): void;
/**
* Sets the value of a property as an array data type. The property will be created if it
* does not exist.
*/
static setList(property: string, value: ReadonlyArray): void;
/**
* Sets the value of a property as an object data type. The property will be created if it
* does not exist.
*/
static setObject(property: string, value: any): void;
/**
* Sets the value of a property as a string data type. The property will be created if it
* does not exist.
*/
static setString(property: string, value: string): void;
}
/**
* Base event for class Titanium.App.iOS
*/
interface iOSBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.App.iOS;
}
/**
* Fired when a local notification is received by the application.
*/
interface iOS_notification_Event extends iOSBaseEvent {
/**
* Alert button text ('View', by default) or slider text ('slide to unlock...', by default).
*/
alertAction: string;
/**
* Alert message.
*/
alertBody: string;
/**
* Image displayed instead of `Default.png` when launching the application.
*/
alertLaunchImage: string;
/**
* Application badge value.
*/
badge: number;
/**
* The identifier of the app-defined [category object](Titanium.App.iOS.UserNotificationCategory). Available in Titanium SDK 7.5.0+ and iOS 10+.
*/
category: string;
/**
* Date and time when the notification was configured to fire.
*/
date: Date;
/**
* Boolean indicating if notification was received while app was in background. Available in Titanium SDK 6.2.0.
* On iOS 10+ this is no longer available since this event will only fire if the app is in foreground.
*/
inBackground: boolean;
/**
* Name of the sound file configured to play when the notification was fired.
*/
sound: string;
/**
* The unique identifier for the thread or conversation related to this notification request.
* It will be used to visually group notifications together. Available in Titanium SDK 7.5.0+ and iOS 10+.
*/
threadIdentifier: string;
/**
* Timezone of the date when the notification was configured to fire. Available in Titanium SDK 7.4.0+.
*/
timezone: string;
/**
* Custom data object.
*/
userInfo: any;
}
/**
* Fired when a user selects an action for an interactive local notification.
*/
interface iOS_localnotificationaction_Event extends iOSBaseEvent {
/**
* Alert button text ('Open', by default) or slider text ('slide to unlock...', by default).
*/
alertAction: string;
/**
* Alert message.
*/
alertBody: string;
/**
* Image displayed instead of `Default.png` when launching the application.
*/
alertLaunchImage: string;
/**
* Application badge value.
*/
badge: number;
/**
* The identifier of the app-defined [category object](Titanium.App.iOS.UserNotificationCategory). Available in Titanium SDK 7.5.0+ and iOS 10+.
*/
category: string;
/**
* Date and time when the notification was configured to fire.
*/
date: Date;
/**
* Identifier of the action that was selected of the interactive notification.
*/
identifier: string;
/**
* Boolean indicating if notification was received while app was in background (since Titanium SDK 6.2.0).
* On iOS 10+ this is no longer available since the event will only fire when opening the app after interacting
* with a notification from the iOS notification center (which means the app was in background when the
* notification was received).
*/
inBackground: boolean;
/**
* Path to the sound file configured to play when the notification was fired.
*/
sound: string;
/**
* The unique identifier for the thread or conversation related to this notification request.
* It will be used to visually group notifications together. Available in Titanium SDK 7.5.0+ and iOS 10+.
*/
threadIdentifier: string;
/**
* Timezone of the date when the notification was configured to fire.
*/
timezone: string;
/**
* User input if the notification used the `USER_NOTIFICATION_BEHAVIOR_TEXTINPUT` behavior.
*/
typedText: string;
/**
* Custom data object.
*/
userInfo: any;
}
/**
* Fired when a user selects an action for an interactive remote notification.
*/
interface iOS_remotenotificationaction_Event extends iOSBaseEvent {
/**
* Identifier of the category of the interactive notification.
*/
category: string;
/**
* The payload passed to the Apple Push Notification Service.
*/
data: any;
/**
* Identifier of the action that was selected of the interactive notification.
*/
identifier: string;
}
/**
* Fired when the application is woken up for a fetch operation. Available only on iOS 7 and later.
*/
interface iOS_backgroundfetch_Event extends iOSBaseEvent {
/**
* Unique string identifier for the `backgroundfetch` event. This identifier should be passed as the argument
* to the [endBackgroundHandler](Titanium.App.iOS.endBackgroundHandler) method.
*/
handlerId: string;
}
/**
* Fired when the application is woken up by a silent remote notification. Available only on iOS 7 and later.
*/
interface iOS_silentpush_Event extends iOSBaseEvent {
/**
* Unique string identifier for the `silentpush` event. This identifier should be passed as the argument
* to the [endBackgroundHandler](Titanium.App.iOS.endBackgroundHandler) method.
*/
handlerId: string;
}
/**
* Fired when the events related to a [urlSession](Modules.URLSession) are waiting to be processed.
* Available only on iOS 7 and later.
*/
interface iOS_backgroundtransfer_Event extends iOSBaseEvent {
/**
* Unique string identifier for the `backgroundtransfer` event. This identifier should be passed as the argument
* to the [endBackgroundHandler](Titanium.App.iOS.endBackgroundHandler) method.
*/
handlerId: string;
/**
* The identifier of the URL session requiring attention. If your app was just launched,
* you can use this identifier to create a new `urlSession` object that can receive the events.
*/
sessionId: string;
}
/**
* Fired periodically to inform the app about the download's progress of a [urlSession](Modules.URLSession).
* Available only on iOS 7 and later.
*/
interface iOS_downloadprogress_Event extends iOSBaseEvent {
/**
* The number of bytes transferred since the last time this event was fired.
*/
bytesWritten: number;
/**
* The `urlSession` session identifier. If it does not exist, this property is not provided.
* This property is available since Titanium Mobile 5.4.0.GA.
*/
sessionIdentifier: string;
/**
* The `urlSession` download task's identifier.
*/
taskIdentifier: number;
/**
* The expected length of the file, as provided by the Content-Length header. If this
* header was not provided, the value is zero.
*/
totalBytesExpectedToWrite: number;
/**
* The total number of bytes transferred so far.
*/
totalBytesWritten: number;
}
/**
* Fired periodically to inform the app about the upload's progress of a [urlSession](Modules.URLSession).
* Available only on iOS 7 and later.
*/
interface iOS_uploadprogress_Event extends iOSBaseEvent {
/**
* The number of bytes transferred since the last time this event was fired.
*/
bytesSent: number;
/**
* The `urlSession` session identifier. If it does not exist, this property is not provided.
* This property is available since Titanium Mobile 5.4.0.GA.
*/
sessionIdentifier: string;
/**
* The `urlSession` upload task's identifier.
*/
taskIdentifier: number;
/**
* The expected length of the file, as provided by the Content-Length header. If this
* header was not provided, the value is zero.
*/
totalBytesExpectedToSend: number;
/**
* The total number of bytes transferred so far.
*/
totalBytesSent: number;
}
/**
* Fired to indicate that a [urlSession's](Modules.URLSession) download task has finished downloading.
* Available only on iOS 7 and later.
*/
interface iOS_downloadcompleted_Event extends iOSBaseEvent {
/**
* The downloaded data as a Titanium.Blob object.
*/
data: Titanium.Blob;
/**
* The `urlSession` session identifier. If it does not exist, this property is not provided.
* This property is available since Titanium Mobile 5.4.0.GA.
*/
sessionIdentifier: string;
/**
* The `urlSession` download task's identifier.
*/
taskIdentifier: number;
}
/**
* Fired to indicate that a [urlSession](Modules.URLSession) task finished transferring data.
* Available only on iOS 7 and later.
*/
interface iOS_sessioncompleted_Event extends iOSBaseEvent {
/**
* The error code of the error, if any (potentially system-dependent).
*/
errorCode: number;
/**
* A string containing the localized description of the error.
* This property does not exist if errorCode is 0, which means there is no error.
*/
message: string;
/**
* The response text for [task](Modules.URLSession.task) and [uploadTask](Modules.URLSession.uploadTask).
* This property does not exist for download task. For download task response,
* use [downloadcompleted](Titanium.App.iOS.downloadcompleted) event.
*/
responseText: string;
/**
* The `urlSession` session identifier. If it does not exist, this property is not provided.
* This property is available since Titanium Mobile 5.4.0.GA.
*/
sessionIdentifier: string;
/**
* The response status code for tasks.
*/
statusCode: number;
/**
* Indicates if the operation succeeded. Returns true if download succeeded, false otherwise.
*/
success: boolean;
/**
* The `urlSession` download task's identifier.
*/
taskIdentifier: number;
}
/**
* Fired to indicate that all messages enqueued for a [urlSession](Modules.URLSession) have been delivered.
* Available only on iOS 7 and later.
*/
interface iOS_sessioneventscompleted_Event extends iOSBaseEvent {
/**
* The `urlSession` session identifier. If it does not exist, this property is not provided.
* This property is available since Titanium Mobile 5.4.0.GA.
*/
sessionIdentifier: string;
}
/**
* Fired when the user notification settings are registered.
*/
interface iOS_usernotificationsettings_Event extends iOSBaseEvent {
/**
* Set of categories of user notification actions the application is registered to use.
*/
categories: Titanium.App.iOS.UserNotificationCategory[];
/**
* Notification types the application is registered to use.
*/
types: number[];
}
/**
* Fired when openParentApplication:reply is called from a WatchKit extension. Available only on iOS 8.2 and later.
*/
interface iOS_watchkitextensionrequest_Event extends iOSBaseEvent {
/**
* Unique string identifier for the `watchkitextensionrequest` event. This identifier should be passed an argument
* to the [sendWatchExtensionReply](Titanium.App.iOS.sendWatchExtensionReply) method.
*/
handlerId: string;
/**
* The payload passed to the `openParentApplication:reply` method from the WatchKit extension.
*/
userInfo: any;
}
/**
* Fired when iOS continueactivity calls `continueUserActivity`.
*/
interface iOS_continueactivity_Event extends iOSBaseEvent {
/**
* Unique string identifier for the handoff user activity. The identifier must be defined in your `tiapp.xml` file.
*/
activityType: string;
/**
* With field will contain the searchable Unique Identifier if the continueactivity is fired from a Core Spotlight search result.
*/
searchableItemActivityIdentifier: string;
/**
* The optional title provided to the user activity or search item.
*/
title: string;
/**
* The optional userInfo provided to the user activity. The userInfo is a custom dictionary and can contain any information needed
* to create your handoff or Core Spotlight session.
*/
userInfo: any;
/**
* The optional webpageURL provided to the user activity.
*/
webpageURL: string;
}
/**
* Fired when a user taps the Application Shortcut.
*/
interface iOS_shortcutitemclick_Event extends iOSBaseEvent {
/**
* The unique identifier for the application shortcut.
*/
itemtype: string;
/**
* The subtitle of the application shortcut.
*/
subtitle: string;
/**
* The title of the application shortcut.
*/
title: string;
/**
* The payload passed by the application shortcut.
*/
userInfo: any;
}
/**
* Fired when a new URL is handled by the application.
*/
interface iOS_handleurl_Event extends iOSBaseEvent {
/**
* The launch options that are related to opening the URL.
*/
launchOptions: LaunchOptionsType;
}
/**
* Fired when the trait collection of the device changes, e.g. the user interface style.
*/
interface iOS_traitcollectionchange_Event extends iOSBaseEvent {
}
/**
* Fired after the user takes a screenshot, e.g. by pressing both the home and lock screen buttons.
*/
interface iOS_screenshotcaptured_Event extends iOSBaseEvent {
}
interface iOSEventMap extends ProxyEventMap {
backgroundfetch: iOS_backgroundfetch_Event;
backgroundtransfer: iOS_backgroundtransfer_Event;
continueactivity: iOS_continueactivity_Event;
downloadcompleted: iOS_downloadcompleted_Event;
downloadprogress: iOS_downloadprogress_Event;
handleurl: iOS_handleurl_Event;
localnotificationaction: iOS_localnotificationaction_Event;
notification: iOS_notification_Event;
remotenotificationaction: iOS_remotenotificationaction_Event;
screenshotcaptured: iOS_screenshotcaptured_Event;
sessioncompleted: iOS_sessioncompleted_Event;
sessioneventscompleted: iOS_sessioneventscompleted_Event;
shortcutitemclick: iOS_shortcutitemclick_Event;
silentpush: iOS_silentpush_Event;
traitcollectionchange: iOS_traitcollectionchange_Event;
uploadprogress: iOS_uploadprogress_Event;
usernotificationsettings: iOS_usernotificationsettings_Event;
watchkitextensionrequest: iOS_watchkitextensionrequest_Event;
}
/**
* The top-level App iOS module, available only to iOS devices, that includes the facilities to
* create and manage local notifications and background services.
*/
class iOS extends Titanium.Module {
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* Returns a URL to open the app's settings.
*/
static readonly applicationOpenSettingsURL: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: boolean;
/**
* Notification types and user notification categories the application is registered to use.
* @deprecated Use [Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings](Titanium.App.iOS.UserNotificationCenter.requestUserNotificationSettings) instead.
*/
static readonly currentUserNotificationSettings: UserNotificationSettings;
/**
* Provides an Array of the NSUserActivityTypes keys defined within your Titanium project.
*/
static readonly supportedUserActivityTypes: string[];
/**
* The style associated with the user interface.
* @deprecated Use instead, which is supported cross-platform.
*/
static readonly userInterfaceStyle: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(
name: K,
callback: (this: Titanium.App.iOS, event: iOSEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Applies the properties to the proxy.
*/
static applyProperties(props: any): void;
/**
* Cancels all scheduled local notifications.
* @deprecated Use [Titanium.App.iOS.UserNotificationCenter.removePendingNotifications](Titanium.App.iOS.UserNotificationCenter.removePendingNotifications) instead.
*/
static cancelAllLocalNotifications(): void;
/**
* Cancels a local notification.
* @deprecated Use [Titanium.App.iOS.UserNotificationCenter.removePendingNotifications](Titanium.App.iOS.UserNotificationCenter.removePendingNotifications) instead.
*/
static cancelLocalNotification(id: number | string): void;
/**
* Creates and returns an instance of Titanium.App.iOS.UserDefaults.
*/
static createUserDefaults(
parameters: Dictionary,
): Titanium.App.iOS.UserDefaults;
/**
* Creates and returns an instance of .
*/
static createUserNotificationAction(
parameters?: Dictionary,
): Titanium.App.iOS.UserNotificationAction;
/**
* Creates and returns an instance of .
*/
static createUserNotificationCategory(
parameters?: Dictionary,
): Titanium.App.iOS.UserNotificationCategory;
/**
* Marks the end of the app execution after initiating the download operation. Available only on iOS 7 and later.
*/
static endBackgroundHandler(handlerID: string): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: K, event?: iOSEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: string, event?: any): void;
/**
* Registers a service to run when the application is placed in the background.
*/
static registerBackgroundService(params: any): Titanium.App.iOS.BackgroundService;
/**
* Registers the application to use the requested notification types and categories.
*/
static registerUserNotificationSettings(params: UserNotificationSettings): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(
name: K,
callback: (this: Titanium.App.iOS, event: iOSEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Schedule a local notification.
*/
static scheduleLocalNotification(params: NotificationParams): Titanium.App.iOS.LocalNotification;
/**
* Marks the end of an `openParentApplication:reply` execution by a WatchKit extension.
* @deprecated Use [Titanium.WatchSession](Titanium.WatchSession) instead, which is supported on iOS 9 and later.
*/
static sendWatchExtensionReply(handlerId: string, userInfo: any): void;
/**
* Specifies the minimum amount of time that must elapse between background fetch operations.
* Available only on iOS 7 and later.
*/
static setMinimumBackgroundFetchInterval(fetchInterval: number): void;
}
}
/**
* The Calendar module provides an API for accessing the native calendar functionality.
*/
namespace Calendar {
/**
* Attendee role is chair.
*/
const ATTENDEE_ROLE_CHAIR: number;
/**
* Attendee is not a participant.
*/
const ATTENDEE_ROLE_NON_PARTICIPANT: number;
/**
* Attendee role is optional.
*/
const ATTENDEE_ROLE_OPTIONAL: number;
/**
* Attendee role is required.
*/
const ATTENDEE_ROLE_REQUIRED: number;
/**
* Attendee role is unknown.
*/
const ATTENDEE_ROLE_UNKNOWN: number;
/**
* Attendee status is accepted.
*/
const ATTENDEE_STATUS_ACCEPTED: number;
/**
* Attendee status is declined.
*/
const ATTENDEE_STATUS_DECLINED: number;
/**
* Attendee status is delegated.
*/
const ATTENDEE_STATUS_DELEGATED: number;
/**
* Attendee status is invited.
*/
const ATTENDEE_STATUS_INVITED: number;
/**
* Attendee status is in process.
*/
const ATTENDEE_STATUS_IN_PROCESS: number;
/**
* There is no Attendee status.
*/
const ATTENDEE_STATUS_NONE: number;
/**
* Attendee status is pending.
*/
const ATTENDEE_STATUS_PENDING: number;
/**
* Attendee status is tentative.
*/
const ATTENDEE_STATUS_TENTATIVE: number;
/**
* Attendee status is unknown.
*/
const ATTENDEE_STATUS_UNKNOWN: number;
/**
* Attendee type is group.
*/
const ATTENDEE_TYPE_GROUP: number;
/**
* There is not attendee type.
*/
const ATTENDEE_TYPE_NONE: number;
/**
* Attendee type is person.
*/
const ATTENDEE_TYPE_PERSON: number;
/**
* Attendee type is required.
*/
const ATTENDEE_TYPE_REQUIRED: number;
/**
* Attendee type is resource.
*/
const ATTENDEE_TYPE_RESOURCE: number;
/**
* Attendee type is room.
*/
const ATTENDEE_TYPE_ROOM: number;
/**
* Attendee type is unknown.
*/
const ATTENDEE_TYPE_UNKNOWN: number;
/**
* An [calendarAuthorization](Titanium.Calendar.calendarAuthorization) value
* indicating that the application is authorized to use events in the Calendar.
*/
const AUTHORIZATION_AUTHORIZED: number;
/**
* An [calendarAuthorization](Titanium.Calendar.calendarAuthorization) value
* indicating that the application is not authorized to use events in the Calendar.
*/
const AUTHORIZATION_DENIED: number;
/**
* An [calendarAuthorization](Titanium.Calendar.calendarAuthorization) value
* indicating that the application is not authorized to use events in the Calendar.
* the user cannot change this application's status.
*/
const AUTHORIZATION_RESTRICTED: number;
/**
* An [calendarAuthorization](Titanium.Calendar.calendarAuthorization) value
* indicating that the authorization state is unknown.
*/
const AUTHORIZATION_UNKNOWN: number;
/**
* Event has a busy availability setting.
*/
const AVAILABILITY_BUSY: number;
/**
* Event has a free availability setting.
*/
const AVAILABILITY_FREE: number;
/**
* Availability settings are not supported by the event's calendar.
*/
const AVAILABILITY_NOTSUPPORTED: number;
/**
* Event has a tentative availability setting.
*/
const AVAILABILITY_TENTATIVE: number;
/**
* Event has a tentative availability setting.
*/
const AVAILABILITY_UNAVAILABLE: number;
/**
* Reminder alert delivery method.
*/
const METHOD_ALERT: number;
/**
* Reminder default delivery method.
*/
const METHOD_DEFAULT: number;
/**
* Reminder email delivery method.
*/
const METHOD_EMAIL: number;
/**
* Reminder SMS delivery method.
*/
const METHOD_SMS: number;
/**
* Indicates a daily recurrence rule for a events recurrence frequency.
*/
const RECURRENCEFREQUENCY_DAILY: number;
/**
* Indicates a monthly recurrence rule for a events recurrence frequency.
*/
const RECURRENCEFREQUENCY_MONTHLY: number;
/**
* Indicates a weekly recurrence rule for a events recurrence frequency.
*/
const RECURRENCEFREQUENCY_WEEKLY: number;
/**
* Indicates a yearly recurrence rule for a events recurrence frequency.
*/
const RECURRENCEFREQUENCY_YEARLY: number;
/**
* Relationship is attendee.
*/
const RELATIONSHIP_ATTENDEE: number;
/**
* There is no relationship.
*/
const RELATIONSHIP_NONE: number;
/**
* Attendee is organizer.
*/
const RELATIONSHIP_ORGANIZER: number;
/**
* Attendee is performer.
*/
const RELATIONSHIP_PERFORMER: number;
/**
* Attendee is speaker.
*/
const RELATIONSHIP_SPEAKER: number;
/**
* Relationship is unknown.
*/
const RELATIONSHIP_UNKNOWN: number;
/**
* A birthday calendar source.
*/
const SOURCE_TYPE_BIRTHDAYS: number;
/**
* A calDev calendar source.
*/
const SOURCE_TYPE_CALDAV: number;
/**
* A microsoft exchange calendar source.
*/
const SOURCE_TYPE_EXCHANGE: number;
/**
* A local calendar source.
*/
const SOURCE_TYPE_LOCAL: number;
/**
* A mobileMe calendar source.
*/
const SOURCE_TYPE_MOBILEME: number;
/**
* A subscribed calendar source.
*/
const SOURCE_TYPE_SUBSCRIBED: number;
/**
* A [save](Titanium.Calendar.Event.save)/[remove](Titanium.Calendar.Event.remove) event value,
* indicating modifications to this event instance should also affect future instances of this event.
*/
const SPAN_FUTUREEVENTS: number;
/**
* A [save](Titanium.Calendar.Event.save)/[remove](Titanium.Calendar.Event.remove) event value,
* indicating modifications to this event instance should affect only this instance.
*/
const SPAN_THISEVENT: number;
/**
* Alert dismissed state.
*/
const STATE_DISMISSED: number;
/**
* Alert fired state.
*/
const STATE_FIRED: number;
/**
* Alert scheduled status.
*/
const STATE_SCHEDULED: number;
/**
* Event canceled status.
*/
const STATUS_CANCELED: number;
/**
* Event confirmed status.
*/
const STATUS_CONFIRMED: number;
/**
* Event has no status.
*/
const STATUS_NONE: number;
/**
* Event tentative status.
*/
const STATUS_TENTATIVE: number;
/**
* Event confidential visibility.
*/
const VISIBILITY_CONFIDENTIAL: number;
/**
* Event default visibility.
*/
const VISIBILITY_DEFAULT: number;
/**
* Event private visibility.
*/
const VISIBILITY_PRIVATE: number;
/**
* Event public visibility.
*/
const VISIBILITY_PUBLIC: number;
/**
* An object that represents a single alert for an event in an calendar.
*/
class Alert extends Titanium.Proxy {
/**
* The absolute date for the alarm.
*/
absoluteDate: Date;
/**
* Date/time at which this alert alarm is set to trigger.
*/
readonly alarmTime: Date;
/**
* Start date/time for the corresponding event.
*/
readonly begin: Date;
/**
* End date/time for the corresponding event.
*/
readonly end: Date;
/**
* Identifier of the event for which this alert is set.
*/
readonly eventId: number;
/**
* Identifier of this alert.
*/
readonly id: string;
/**
* Reminder notice period in minutes, that determines how long prior to the event this alert
* should trigger.
*/
readonly minutes: number;
/**
* The offset from the start of an event, at which the alarm fires.
*/
relativeOffset: number;
/**
* The current state of the alert.
*/
readonly state: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* An object that represents a single attendee of an event.
*/
interface Attendee extends Titanium.Proxy {
/**
* The attendee email.
*/
readonly email: string;
/**
* Indicates whether this attendee is the event organizer.
*/
readonly isOrganizer: boolean;
/**
* The attendee name.
*/
readonly name: string;
/**
* The role of the attendee.
*/
readonly role: number;
/**
* The status of the attendee.
*/
readonly status: number;
/**
* The type of the attendee.
*/
readonly type: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* An object that represents a single calendar.
*/
class Calendar extends Titanium.Proxy {
/**
* Indicates whether this calendar can be edited or deleted.
*/
readonly hidden: boolean;
/**
* Identifier of this calendar.
*/
readonly id: string;
/**
* Display name of this calendar.
*/
readonly name: string;
/**
* Indicates whether the calendar is selected.
*/
readonly selected: boolean;
/**
* Displays the source identifier.
*/
readonly sourceIdentifier: string;
/**
* Displays the source title.
*/
readonly sourceTitle: string;
/**
* Displays the source type.
*/
readonly sourceType: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Creates an event in this calendar.
*/
createEvent(properties: Dictionary): Titanium.Calendar.Event;
/**
* Creates multiple events at once in this calendar.
*/
createEvents(
propertiesArray: ReadonlyArray>,
): Titanium.Calendar.Event[];
/**
* Deletes multiple events with their specified identifier(s).
*/
deleteEvents(ids: number[] | string[]): number;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Gets the event with the specified identifier.
*/
getEventById(id: string): Titanium.Calendar.Event;
/**
* Gets events that occur between two dates.
*/
getEventsBetweenDates(date1: Date | string, date2: Date | string): Titanium.Calendar.Event[];
/**
* Gets multiple events with their specified identifier(s).
*/
getEventsById(ids: number[] | string[]): Titanium.Calendar.Event[];
/**
* Gets events that occur on a specified date.
* @deprecated Use [Titanium.Calendar.Calendar.getEventsBetweenDates](Titanium.Calendar.Calendar.getEventsBetweenDates) instead.
*/
getEventsInDate(year: number, month: number, day: number): Titanium.Calendar.Event[];
/**
* Gets events that occur during a specified month.
* @deprecated Use [Titanium.Calendar.Calendar.getEventsBetweenDates](Titanium.Calendar.Calendar.getEventsBetweenDates) instead.
*/
getEventsInMonth(year: number, month: number): Titanium.Calendar.Event[];
/**
* Gets all events that occur during a specified year.
* @deprecated Use [Titanium.Calendar.Calendar.getEventsBetweenDates](Titanium.Calendar.Calendar.getEventsBetweenDates) instead.
*/
getEventsInYear(year: number): Titanium.Calendar.Event[];
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* An object that represents a single event in a calendar.
*/
class Event extends Titanium.Proxy {
/**
* Alarms associated with the calendar item, as an array of objects.
*/
alerts: Titanium.Calendar.Alert[];
/**
* Indicates whether this event is all day.
*/
allDay: boolean;
/**
* The list of event attendees. This list will be empty if the event has no attendees.
*/
readonly attendees: Titanium.Calendar.Attendee[];
/**
* Availability of this event.
*/
availability: number;
/**
* Start date/time of this event.
*/
begin: Date;
/**
* Description of this event.
*/
readonly description: string;
/**
* End date/time of this event.
*/
end: Date;
/**
* Extended properties of this event.
*/
readonly extendedProperties: any;
/**
* Indicates whether an alarm is scheduled for this event.
*/
readonly hasAlarm: boolean;
/**
* Identifier of this event.
*/
readonly id: string;
/**
* Boolean value that indicates whether an event is a detached instance of a
* repeating event.
*/
readonly isDetached: boolean;
/**
* Location of this event.
*/
location: string;
/**
* Notes for this event.
*/
notes: string;
/**
* The recurrence rules for the calendar item.
*/
recurrenceRules: Titanium.Calendar.RecurrenceRule[];
/**
* Existing reminders for this event.
*/
readonly reminders: Titanium.Calendar.Reminder[];
/**
* Status of this event.
*/
readonly status: number;
/**
* Title of this event.
*/
title: string;
/**
* Visibility of this event.
*/
readonly visibility: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Adds a recurrence rule to the recurrence rule array.
*/
addRecurrenceRule(rule: Titanium.Calendar.RecurrenceRule): void;
/**
* Creates an alert for this event.
*/
createAlert(data: Dictionary): Titanium.Calendar.Alert;
/**
* Creates an recurrence pattern for a recurring event.
* All of the properties for the recurrence rule must be set during creation.
* The recurrence rule properties cannot be modified.
*/
createRecurrenceRule(data: Dictionary): Titanium.Calendar.RecurrenceRule;
/**
* Creates a reminder for this event.
*/
createReminder(data: Dictionary): Titanium.Calendar.Reminder;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Gets the value of the specified extended property.
*/
getExtendedProperty(name: string): string;
/**
* Updates the event's data with the current information in the Calendar database.
*/
refresh(): boolean;
/**
* Removes an event from the calendar.
*/
remove(span: number): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Removes a recurrence rule to the recurrence rule array.
*/
removeRecurrenceRule(rule: Titanium.Calendar.RecurrenceRule): void;
/**
* Saves changes to an event permanently.
*/
save(span: number): boolean;
/**
* Sets the value of the specified extended property.
*/
setExtendedProperty(name: string, value: string): void;
}
/**
* An object that is used to describe the recurrence pattern for a recurring event.
*/
interface RecurrenceRule extends Titanium.Proxy {
/**
* Identifier for the recurrence rule's calendar.
*/
readonly calendarID: string;
/**
* The days of the month that the event occurs, as an array of number objects.
* Values can be from 1 to 31 and from -1 to -31. This parameter is only valid for
* recurrence rules of type
* [RECURRENCEFREQUENCY_MONTHLY](Titanium.Calendar.RECURRENCEFREQUENCY_MONTHLY).
*/
readonly daysOfTheMonth: number[];
/**
* The days of the week that the event occurs, as an array of objects `daysOfWeek` and `Week`.
*/
readonly daysOfTheWeek: daysOfTheWeekDictionary[];
/**
* The days of the year that the event occurs, as an array of number objects.
* Values can be from 1 to 366 and from -1 to -366. This parameter is only valid for
* recurrence rules of type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY).
*/
readonly daysOfTheYear: number[];
/**
* End of a recurrence rule.
*/
readonly end: recurrenceEndDictionary;
/**
* Frequency of the recurrence rule.
*/
readonly frequency: number;
/**
* The interval between instances of this recurrence. For example, a weekly
* recurrence rule with an interval of 2 occurs every other week. Must be greater than 0.
*/
readonly interval: number;
/**
* The months of the year that the event occurs, as an array of Number objects.
* Values can be from 1 to 12. This parameter is only valid for recurrence rules of
* type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY).
*/
readonly monthsOfTheYear: number[];
/**
* An array of ordinal numbers that filters which recurrences to include in the
* recurrence rule's frequency. For example, a yearly recurrence rule that has a
* [daysOfTheWeek](Titanium.Calendar.RecurrenceRule.daysOfTheWeek) value that specifies
* Monday through Friday, and a `setPositions` array containing 2 and -1, occurs only
* on the second weekday and last weekday of every year.
*/
readonly setPositions: number[];
/**
* The weeks of the year that the event occurs, as an array of number objects.
* Values can be from 1 to 53 and from -1 to -53. This parameter is only valid for
* recurrence rules of type [RECURRENCEFREQUENCY_YEARLY](Titanium.Calendar.RECURRENCEFREQUENCY_YEARLY).
*/
readonly weeksOfTheYear: number[];
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* An object that represents a single reminder for an event in a calendar.
*/
interface Reminder extends Titanium.Proxy {
/**
* Identifier of this reminder.
*/
readonly id: string;
/**
* Method by which this reminder will be delivered.
*/
readonly method: number;
/**
* Reminder notice period in minutes, that determines how long prior to the event this reminder
* should trigger.
*/
readonly minutes: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
}
/**
* The top-level Contacts module, used for accessing and modifying the system contacts address book.
*/
namespace Contacts {
/**
* A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value
* indicating that the application is authorized to use the address book.
*/
const AUTHORIZATION_AUTHORIZED: number;
/**
* A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value
* indicating that the application is not authorized to use the address book.
*/
const AUTHORIZATION_DENIED: number;
/**
* A [contactsAuthorization](Titanium.Contacts.contactsAuthorization) value
* indicating that the authorization state is unknown.
*/
const AUTHORIZATION_UNKNOWN: number;
/**
* Specifies that a contact is an organization.
*/
const CONTACTS_KIND_ORGANIZATION: number;
/**
* Specifies that a contact is a person.
*/
const CONTACTS_KIND_PERSON: number;
/**
* Specifies that group members will be sorted by first name.
*/
const CONTACTS_SORT_FIRST_NAME: number;
/**
* Specifies that group members will be sorted by last name.
*/
const CONTACTS_SORT_LAST_NAME: number;
/**
* An object which represents a group in the system contacts address book.
*/
class Group extends Titanium.Proxy {
/**
* Identifier of the group.
*/
readonly identifier: string;
/**
* Name of this group.
*/
name: string;
/**
* Adds a person to this group.
*/
add(person: Titanium.Contacts.Person): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Gets people that are members of this group.
*/
members(): Titanium.Contacts.Person[];
/**
* Removes a person from this group. For >= iOS 9, it is not
* required to call after calling this method.
*/
remove(person: Titanium.Contacts.Person): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Gets people that are members of this group, sorted in the specified order.
*/
sortedMembers(sortBy: number): Titanium.Contacts.Person[];
}
/**
* An object that represents a contact record for a person or organization in the system contacts
* address book.
*/
class Person extends Titanium.Proxy {
/**
* Addresses for the person. Multi-value. Read-only on Android.
*/
address: any;
/**
* Alternate birthday of the person. Single Dictionary.
*/
alternateBirthday: any;
/**
* Date of birth of the person. Single value.
*/
birthday: string;
/**
* Dates associated with the person. Multi-value.
*/
date: any;
/**
* Department of the person. Single value.
*/
department: string;
/**
* Email addresses for the person. Multi-value. Read-only on Android.
*/
email: any;
/**
* First name of the person. Single value.
*/
firstName: string;
/**
* Phonetic first name of the person. Single value.
*/
firstPhonetic: string;
/**
* Localized full name of the person. Single value. Read-only on Android.
*/
readonly fullName: string;
/**
* Record identifier of the person. Single value.
*/
readonly id: number;
/**
* Identifier of the person.
*/
readonly identifier: string;
/**
* Image for the person. Single value. Read-only for >= iOS 9
*/
image: Titanium.Blob;
/**
* Instant messenger information of the person. Multi-value.
*/
instantMessage: any;
/**
* Job title of the person. Single value.
*/
jobTitle: string;
/**
* Determines the type of information the person record contains; either person or organization.
* Read-only on Android.
*/
kind: number;
/**
* Last name of the person. Single value.
*/
lastName: string;
/**
* Phonetic last name of the person. Single value.
*/
lastPhonetic: string;
/**
* Middle name of the person. Single value.
*/
middleName: string;
/**
* Phonetic middle name of the person. Single value.
*/
middlePhonetic: string;
/**
* Nickname of the person. Single value.
*/
nickname: string;
/**
* Notes for the person. Single value.
*/
note: string;
/**
* Organization to which the person belongs. Single value.
*/
organization: string;
/**
* Phone numbers for the person. Multi-value. Read-only on Android.
*/
phone: any;
/**
* Prefix for the person. Single value.
*/
readonly prefix: string;
/**
* Record identifier of the person. Single value. Deprecated since iOS 9.
*/
recordId: number;
/**
* Names of people to which the person is related. Multi-value.
*/
relatedNames: any;
/**
* Social profile information of the person. Multi-value.
*/
socialProfile: any;
/**
* Suffix for the person. Single value.
*/
readonly suffix: string;
/**
* URLs of webpages associated with the person. Multi-value.
*/
url: any;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
}
/**
* The top-level `Database` module, used for creating and accessing the
* in-application SQLite database.
*/
namespace Database {
/**
* Constant for requesting a column's value returned in double form.
*/
const FIELD_TYPE_DOUBLE: number;
/**
* Constant for requesting a column's value returned in float form.
*/
const FIELD_TYPE_FLOAT: number;
/**
* Constant for requesting a column's value returned in integer form.
*/
const FIELD_TYPE_INT: number;
/**
* Constant for requesting a column's value returned in string form.
*/
const FIELD_TYPE_STRING: number;
/**
* The `Database` instance returned by or .
*/
class DB extends Titanium.Proxy {
/**
* A `File` object representing the file where this database is stored. Must only be used for
* setting file properties.
*/
readonly file: Titanium.Filesystem.File;
/**
* The identifier of the last populated row.
*/
readonly lastInsertRowId: number;
/**
* The name of the database.
*/
readonly name: string;
/**
* The number of rows affected by the last query.
*/
readonly rowsAffected: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Closes the database and releases resources from memory. Once closed, this instance is no
* longer valid and should not be used. On iOS, also closes all
* instances that exist.
*/
close(): void;
/**
* Executes an SQL statement against the database and returns a `ResultSet`.
*/
execute(sql: string, ...vararg: string[]): Titanium.Database.ResultSet;
/**
* Executes an SQL statement against the database and returns a `ResultSet`.
*/
execute(sql: string, vararg?: ReadonlyArray): Titanium.Database.ResultSet;
/**
* Executes an SQL statement against the database and returns a `ResultSet`.
*/
execute(sql: string, ...vararg: any[]): Titanium.Database.ResultSet;
/**
* Executes an SQL statement against the database and returns a `ResultSet`.
*/
execute(sql: string, vararg?: ReadonlyArray): Titanium.Database.ResultSet;
/**
* Synchronously executes an array of SQL statements against the database and returns an array of `ResultSet`.
* On failure, this will throw an [Error](BatchQueryError) that reports the failed index and partial results
*/
executeAll(queries: ReadonlyArray): Titanium.Database.ResultSet[];
/**
* Asynchronously executes an array of SQL statements against the database and fires a callback with a possible Error, and an array of `ResultSet`.
* On failure, this will call the callback with an [Error](PossibleBatchQueryError) that reports the failed `index`, and a second argument with the partial `results`.
*/
executeAllAsync(
queries: ReadonlyArray,
callback?: (param0: PossibleBatchQueryError, param1: Titanium.Database.ResultSet[]) => void,
): Promise;
/**
* Asynchronously executes an SQL statement against the database and fires a callback with a possible `Error` argument, and a second argument holding a possible `ResultSet`.
*/
executeAsync(
query: string,
vararg?: any,
callback?: (param0: any, param1: Titanium.Database.ResultSet) => void,
): Promise;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the database files for this instance from disk. WARNING: this is a destructive
* operation and cannot be reversed. All data in the database will be lost; use with caution.
*/
remove(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* The ResultSet instance returned by .
*/
class ResultSet extends Titanium.Proxy {
/**
* The number of columns in this result set.
*/
readonly fieldCount: number;
/**
* The number of rows in this result set.
*/
readonly rowCount: number;
/**
* Indicates whether the current row is valid.
*/
readonly validRow: boolean;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Closes this result set and release resources. Once closed, the result set must no longer
* be used.
*/
close(): void;
/**
* Retrieves the value for the specified field in the current row,
* and casts it to the specified type (String, Integer, Float or Double.)
*/
field(index: number, type?: number): string | number | Titanium.Blob;
/**
* Retrieves the value for the specified field in the current row,
* and casts it to the specified type (String, Integer, Float or Double.)
*/
fieldByName(name: string, type?: number): string | number | Titanium.Blob;
/**
* Returns the field name for the specified field index.
*/
fieldName(index: number): string;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Returns the field name for the specified field index.
*/
getFieldName(index: number): string;
/**
* Returns whether the current row is valid.
*/
isValidRow(): boolean;
/**
* Advances to the next row in the result set and returns `true` if one exists,
* or `false` otherwise.
*/
next(): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
}
/**
* The top level filesystem module, used to access files and directories on the device.
*/
namespace Filesystem {
/**
* Constant used to set protection key to NSFileProtectionComplete in file attributes.
*/
const IOS_FILE_PROTECTION_COMPLETE: string;
/**
* Constant used to set protection key to NSFileProtectionCompleteUnlessOpen in file attributes.
*/
const IOS_FILE_PROTECTION_COMPLETE_UNLESS_OPEN: string;
/**
* Constant used to set protection key to NSFileProtectionCompleteUntilFirstUserAuthentication in file attributes.
*/
const IOS_FILE_PROTECTION_COMPLETE_UNTIL_FIRST_USER_AUTHENTICATION: string;
/**
* Constant used to set protection key to NSFileProtectionNone in file attributes.
*/
const IOS_FILE_PROTECTION_NONE: string;
/**
* Constant for append mode for file operations.
*/
const MODE_APPEND: number;
/**
* Constant for read mode for file operations.
*/
const MODE_READ: number;
/**
* Constant for write mode for file operations.
*/
const MODE_WRITE: number;
/**
* Object representing a path to a file or directory in the device's persistent storage.
*/
class File extends Titanium.Proxy {
/**
* `true` if the file is executable.
*/
readonly executable: boolean;
/**
* Set to `true` if the file is hidden.
*/
hidden: boolean;
/**
* Name of the file.
*/
readonly name: string;
/**
* Native path associated with this file object, as a file URL.
*/
readonly nativePath: string;
/**
* A `File` object representing the parent directory of the file identified by this object.
*/
readonly parent: Titanium.Filesystem.File;
/**
* `true` if the file identified by this object is read-only.
*/
readonly readonly: boolean;
/**
* Value indicating whether or not to back up to a cloud service.
*/
remoteBackup: boolean;
/**
* Size, in bytes, of the file identified by this object.
*/
readonly size: number;
/**
* `true` if the file identified by this object is a symbolic link.
*/
readonly symbolicLink: boolean;
/**
* `true` if the file identified by this object is writable.
*/
readonly writable: boolean;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Appends data to the file identified by this file object.
*/
append(data: string | Titanium.Blob | Titanium.Filesystem.File): boolean;
/**
* Copies the file identified by this file object to a new path.
*/
copy(destinationPath: string): boolean;
/**
* Creates a directory at the path identified by this file object.
*/
createDirectory(recursive?: boolean): boolean;
/**
* Creates a file at the path identified by this file object.
*/
createFile(): boolean;
/**
* Returns the creation timestamp for the file identified by this file object.
* @deprecated Use [createdAt](Titanium.Filesystem.File.createdAt) instead.
*/
createTimestamp(): number;
/**
* Returns the creation Date for the file identified by this file object.
*/
createdAt(): Date;
/**
* Deletes the directory identified by this file object.
*/
deleteDirectory(recursive?: boolean): boolean;
/**
* Deletes the file identified by this file object.
*/
deleteFile(): boolean;
/**
* Returns `true` if the file or directory identified by this file object exists on the device.
*/
exists(): boolean;
/**
* Returns the extension for the file identified by this file object.
*/
extension(): string;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Returns a listing of the directory identified by this file object, or `null`
* if this object doesn't identify a directory.
*/
getDirectoryListing(): string[];
/**
* Returns the path of the parent directory holding the file identified by this
* file object, as a String (deprecated) **or** as a `File` object.
* @deprecated Use the [Titanium.Filesystem.File.parent](Titanium.Filesystem.File.parent) property to receive a `File`
* reference instead. If you wish to receive the path, use the `nativePath`
* property of that reference instead.
*/
getParent(): string | Titanium.Filesystem.File;
/**
* Returns the protection key value of this file object.
* Returns `null` if there's an error.
*/
getProtectionKey(): string;
/**
* Returns `true` if this file object represents a directory.
*/
isDirectory(): boolean;
/**
* Returns `true` if this file object represents an ordinary file.
*/
isFile(): boolean;
/**
* Returns the last modification time for this file.
* @deprecated Use [Titanium.Filesystem.File.modifiedAt](Titanium.Filesystem.File.modifiedAt) instead.
*/
modificationTimestamp(): number;
/**
* Returns the last modification Date for the file identified by this file object.
*/
modifiedAt(): Date;
/**
* Moves the file identified by this file object to another path.
*/
move(newpath: string): boolean;
/**
* Opens the file identified by this file object for random access.
*/
open(mode: number): Titanium.Filesystem.FileStream;
/**
* Returns the contents of the file identified by this file object as a `Blob`.
*/
read(): Titanium.Blob;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Renames the file identified by this file object.
*/
rename(newname: string): boolean;
/**
* Returns the fully-resolved native path associated with this file object.
*/
resolve(): string;
/**
* Sets the protection key as an attribute to the file identified by this file object.
*/
setProtectionKey(fileProtectionType: string): boolean;
/**
* Returns the amount of free space available on the device where the file identified by this file object is stored.
*/
spaceAvailable(): number;
/**
* Writes the specified data to the file identified by this file object.
*/
write(data: string | Titanium.Filesystem.File | Titanium.Blob, append?: boolean): boolean;
}
/**
* Wrapper around `Titanium.Filesystem.File` that implements the `Titanium.IOStream` interface
*/
class FileStream extends Titanium.IOStream {
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* closes file stream, exception is thrown on error
*/
close(): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
}
/**
* The top level Geolocation module. The Geolocation module is used for accessing device location based information.
*/
namespace Geolocation {
/**
* The user authorized the app to access location data with full accuracy.
*/
const ACCURACY_AUTHORIZATION_FULL: number;
/**
* The user authorized the app to access location data with reduced accuracy.
*/
const ACCURACY_AUTHORIZATION_REDUCED: number;
/**
* Use with [accuracy](Titanium.Geolocation.accuracy) to request the best
* accuracy available.
*/
const ACCURACY_BEST: number;
/**
* Use with [accuracy](Titanium.Geolocation.accuracy) to request highest possible
* accuracy and combine it with additional sensor data.
*/
const ACCURACY_BEST_FOR_NAVIGATION: number;
/**
* Use with [accuracy](Titanium.Geolocation.accuracy) to request more
* accurate location updates with higher battery usage.
*/
const ACCURACY_HIGH: number;
/**
* Use with [accuracy](Titanium.Geolocation.accuracy) to request location
* updates accurate to the nearest 100 meters.
*/
const ACCURACY_HUNDRED_METERS: number;
/**
* Use with [accuracy](Titanium.Geolocation.accuracy) to request location
* updates accurate to the nearest kilometer.
*/
const ACCURACY_KILOMETER: number;
/**
* Use with [accuracy](Titanium.Geolocation.accuracy) to request less
* accurate location updates with lower battery usage.
*/
const ACCURACY_LOW: number;
/**
* Use with [accuracy](Titanium.Geolocation.accuracy) to request location
* updates accurate to the nearest 10 meters.
*/
const ACCURACY_NEAREST_TEN_METERS: number;
/**
* The level of accuracy used when an app isn’t authorized for full accuracy location data.
*/
const ACCURACY_REDUCED: number;
/**
* Use with [accuracy](Titanium.Geolocation.accuracy) to request location
* updates accurate to the nearest three kilometers.
*/
const ACCURACY_THREE_KILOMETERS: number;
/**
* The location data is used for tracking location changes to the automobile specifically during vehicular navigation.
*/
const ACTIVITYTYPE_AUTOMOTIVE_NAVIGATION: string;
/**
* The location data is used for tracking any pedestrian-related activity.
*/
const ACTIVITYTYPE_FITNESS: string;
/**
* The location data is being used for an unknown activity.
*/
const ACTIVITYTYPE_OTHER: string;
/**
* The location data is used for tracking movements of other types of vehicular
* navigation that are not automobile related.
*/
const ACTIVITYTYPE_OTHER_NAVIGATION: string;
/**
* A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value
* indicating that the application is authorized to start location services at any time. This authorization
* includes the use of all location services, including monitoring regions and significant location changes.
*/
const AUTHORIZATION_ALWAYS: number;
/**
* A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value
* indicating that the application is authorized to use location services.
* @deprecated Use [Titanium.Geolocation.AUTHORIZATION_ALWAYS](Titanium.Geolocation.AUTHORIZATION_ALWAYS) as advised by Apple.
*/
const AUTHORIZATION_AUTHORIZED: number;
/**
* A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value
* indicating that the application is not authorized to use location services, *or*
* location services are disabled.
*/
const AUTHORIZATION_DENIED: number;
/**
* A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value
* indicating that the application is not authorized to use location services *and*
* the user cannot change this application's status.
*/
const AUTHORIZATION_RESTRICTED: number;
/**
* A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value
* indicating that the authorization state is unknown.
*/
const AUTHORIZATION_UNKNOWN: number;
/**
* A [locationServicesAuthorization](Titanium.Geolocation.locationServicesAuthorization) value
* indicating that the application is authorized to start most location services only while running in the foreground.
*/
const AUTHORIZATION_WHEN_IN_USE: number;
/**
* Error code indicating that the user denied access to the location service.
*/
const ERROR_DENIED: number;
/**
* Error code indicating that the heading could not be determined.
*/
const ERROR_HEADING_FAILURE: number;
/**
* Error code indicating that the user's location could not be determined.
*/
const ERROR_LOCATION_UNKNOWN: number;
/**
* Error code indicating that the network was unavailable.
*/
const ERROR_NETWORK: number;
/**
* Error code indicating that region monitoring is delayed.
*/
const ERROR_REGION_MONITORING_DELAYED: number;
/**
* Error code indicating that region monitoring is denied.
*/
const ERROR_REGION_MONITORING_DENIED: number;
/**
* Error code indicating a region monitoring failure.
*/
const ERROR_REGION_MONITORING_FAILURE: number;
/**
* Module for Android-specific geolocation functionality.
*/
namespace Android {
/**
* Specifies the GPS location provider.
*/
const PROVIDER_GPS: string;
/**
* Specifies the network location provider.
*/
const PROVIDER_NETWORK: string;
/**
* Specifies the passive location provider.
*/
const PROVIDER_PASSIVE: string;
/**
* Represents a source of location information, such as GPS.
*/
class LocationProvider extends Titanium.Proxy {
/**
* Don't send a location update unless the location has changed at least `minUpdateDistance`
* meters since the previous update.
*/
minUpdateDistance: number;
/**
* Limits the frequency of location updates to no more than one per `minUpdateTime` seconds.
*/
minUpdateTime: number;
/**
* Type of location provider: [PROVIDER_GPS](Titanium.Geolocation.Android.PROVIDER_GPS),
* [PROVIDER_NETWORK](Titanium.Geolocation.Android.PROVIDER_NETWORK), or
* [PROVIDER_PASSIVE](Titanium.Geolocation.Android.PROVIDER_PASSIVE).
*/
name: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* A location rule to filter the results returned by location providers.
*/
class LocationRule extends Titanium.Proxy {
/**
* Minimum accuracy required for a location update.
*/
accuracy: number;
/**
* Controls the freshness of location updates. Do not forward an update
* unless it is newer than `maxAge` milliseconds.
*/
maxAge: number;
/**
* Controls the frequency of location updates.
*/
minAge: number;
/**
* If specified, this rule only applies to updates generated
* by the specified provider. If `null`, this rule applies to all updates.
*/
name: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
}
/**
* Module for Android-specific geolocation functionality.
*/
class Android extends Titanium.Module {
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: boolean;
/**
* The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
*/
static lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup;
/**
* Set to `true` to enable manual configuration of location updates through this module.
*/
static manualMode: boolean;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Adds and enables the specified location provider, possibly replacing an existing one.
*/
static addLocationProvider(provider: Titanium.Geolocation.Android.LocationProvider): void;
/**
* Adds and enables the specified location rule.
*/
static addLocationRule(rule: Titanium.Geolocation.Android.LocationRule): void;
/**
* Applies the properties to the proxy.
*/
static applyProperties(props: any): void;
/**
* Creates and returns an instance of .
*/
static createLocationProvider(
parameters?: Dictionary,
): Titanium.Geolocation.Android.LocationProvider;
/**
* Creates and returns an instance of .
*/
static createLocationRule(
parameters?: Dictionary,
): Titanium.Geolocation.Android.LocationRule;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Disables and removes the specified location provider.
*/
static removeLocationProvider(provider: Titanium.Geolocation.Android.LocationProvider): void;
/**
* Disables and removes the specified location rule.
*/
static removeLocationRule(rule: Titanium.Geolocation.Android.LocationRule): void;
}
}
/**
* The top-level Media module.
*/
namespace Media {
/**
* Aspect ratio 16:9
*/
const ASPECT_RATIO_16_9: number;
/**
* Aspect ratio 4:3
*/
const ASPECT_RATIO_4_3: number;
/**
* Audio file format 3GPP2.
*/
const AUDIO_FILEFORMAT_3GP2: number;
/**
* Audio file format 3GPP.
*/
const AUDIO_FILEFORMAT_3GPP: number;
/**
* Audio file format Audio Interchange File Format (AIFF).
*/
const AUDIO_FILEFORMAT_AIFF: number;
/**
* Audio file format Adaptive Multi-Rate (AMR).
*/
const AUDIO_FILEFORMAT_AMR: number;
/**
* Audio file format Apple Compressed Audio Format (CAF).
*/
const AUDIO_FILEFORMAT_CAF: number;
/**
* Audio file format MP3.
*/
const AUDIO_FILEFORMAT_MP3: number;
/**
* Audio file format MP4.
*/
const AUDIO_FILEFORMAT_MP4: number;
/**
* Audio file format MP4A.
*/
const AUDIO_FILEFORMAT_MP4A: number;
/**
* Audio file format WAVE.
*/
const AUDIO_FILEFORMAT_WAVE: number;
/**
* Audio format MPEG4 AAC encoding.
*/
const AUDIO_FORMAT_AAC: number;
/**
* Audio format 8-bit [aLaw encoding](https://en.wikipedia.org/wiki/A-law_algorithm).
*/
const AUDIO_FORMAT_ALAW: number;
/**
* Audio format Apple lossless encoding.
*/
const AUDIO_FORMAT_APPLE_LOSSLESS: number;
/**
* Audio format [iLBC encoding](https://en.wikipedia.org/wiki/Internet_Low_Bitrate_Codec).
*/
const AUDIO_FORMAT_ILBC: number;
/**
* Audio format Apple IMA4 encoding.
*/
const AUDIO_FORMAT_IMA4: number;
/**
* Audio format 16-bit, [linear PCM encoding](https://en.wikipedia.org/wiki/Pulse-code_modulation).
*/
const AUDIO_FORMAT_LINEAR_PCM: number;
/**
* Audio format 8-bit [muLaw encoding](https://en.wikipedia.org/wiki/M-law_algorithm).
*/
const AUDIO_FORMAT_ULAW: number;
/**
* For long-duration sounds such as rain, car engine noise, and so on.
*/
const AUDIO_SESSION_CATEGORY_AMBIENT: string;
/**
* Session mode for playing recorded music or other sounds that are central to the successful use of your application.
*/
const AUDIO_SESSION_CATEGORY_PLAYBACK: string;
/**
* Session mode for recording (input) and playback (output) of audio, such as for a VOIP (voice over IP) application.
*/
const AUDIO_SESSION_CATEGORY_PLAY_AND_RECORD: string;
/**
* Session mode for recording audio; it silences playback audio.
*/
const AUDIO_SESSION_CATEGORY_RECORD: string;
/**
* Session mode for long-duration sounds such as rain, car engine noise, and so on.
*/
const AUDIO_SESSION_CATEGORY_SOLO_AMBIENT: string;
/**
* Constant that specifies audio should output to the default audio route. See for more information.
*/
const AUDIO_SESSION_OVERRIDE_ROUTE_NONE: number;
/**
* Constant that specifies audio should output to the speaker. See for more information.
*/
const AUDIO_SESSION_OVERRIDE_ROUTE_SPEAKER: number;
/**
* Constant for output on a remote Air Play device. This is an output port.
*/
const AUDIO_SESSION_PORT_AIRPLAY: string;
/**
* Constant for output on a Bluetooth A2DP device. This is an output port.
*/
const AUDIO_SESSION_PORT_BLUETOOTHA2DP: string;
/**
* Constant for input or output on a Bluetooth Hands-Free Profile device. This can be both an input and output port.
*/
const AUDIO_SESSION_PORT_BLUETOOTHHFP: string;
/**
* Constant for output on a Bluetooth Low Energy device. This is an output port. This is available on iOS 7 and later.
*/
const AUDIO_SESSION_PORT_BLUETOOTHLE: string;
/**
* Constant for built-in microphone on an iOS device. This is an input port.
*/
const AUDIO_SESSION_PORT_BUILTINMIC: string;
/**
* Constant for the speaker you hold to your ear when on a phone call. This is an output port.
*/
const AUDIO_SESSION_PORT_BUILTINRECEIVER: string;
/**
* Constant for built-in speaker on an iOS device. This is an output port.
*/
const AUDIO_SESSION_PORT_BUILTINSPEAKER: string;
/**
* Constant for Input or output via Car Audio. This can be both an input and output port. This is available on iOS 7 and later.
*/
const AUDIO_SESSION_PORT_CARAUDIO: string;
/**
* Constant for output via High-Definition Multimedia Interface. This is an output port
*/
const AUDIO_SESSION_PORT_HDMI: string;
/**
* Constant for headphone or headset output. This is an output port.
*/
const AUDIO_SESSION_PORT_HEADPHONES: string;
/**
* Constant for microphone on a wired headset. This is an input port.
*/
const AUDIO_SESSION_PORT_HEADSETMIC: string;
/**
* Constant for line level input on a dock connector. This is an input port.
*/
const AUDIO_SESSION_PORT_LINEIN: string;
/**
* Constant for line level output on a dock connector. This is an output port.
*/
const AUDIO_SESSION_PORT_LINEOUT: string;
/**
* Constant for input or output on a Universal Serial Bus device. This can be both an input and output port.
*/
const AUDIO_SESSION_PORT_USBAUDIO: string;
/**
* Audio data is being buffered from the network.
*/
const AUDIO_STATE_BUFFERING: number;
/**
* Audio playback is being initialized.
*/
const AUDIO_STATE_INITIALIZED: number;
/**
* Playback is paused.
*/
const AUDIO_STATE_PAUSED: number;
/**
* Audio playback is active.
*/
const AUDIO_STATE_PLAYING: number;
/**
* Audio playback is starting.
*/
const AUDIO_STATE_STARTING: number;
/**
* Audio playback is stopped.
*/
const AUDIO_STATE_STOPPED: number;
/**
* Audio playback is stopping.
*/
const AUDIO_STATE_STOPPING: number;
/**
* Player is waiting for audio data from the network.
*/
const AUDIO_STATE_WAITING_FOR_DATA: number;
/**
* Constant specifying that app is authorized to use camera. This is available on iOS 7 and later.
*/
const CAMERA_AUTHORIZATION_AUTHORIZED: number;
/**
* Constant specifying that app is denied usage of camera. This is available on iOS 7 and later.
*/
const CAMERA_AUTHORIZATION_DENIED: number;
/**
* Constant specifying that app is restricted from using camera. This is available on iOS 7 and later.
*/
const CAMERA_AUTHORIZATION_RESTRICTED: number;
/**
* Constant specifying that app is not yet authorized to use camera. This is available on iOS 7 and later.
*/
const CAMERA_AUTHORIZATION_UNKNOWN: number;
/**
* Constant specifying to have the device determine to use the flash or not.
*/
const CAMERA_FLASH_AUTO: number;
/**
* Constant specifying to never fire the flash.
*/
const CAMERA_FLASH_OFF: number;
/**
* Constant specifying to always fire the flash.
*/
const CAMERA_FLASH_ON: number;
/**
* Constant specifying the front camera.
*/
const CAMERA_FRONT: number;
/**
* Constant indicating the rear camera.
*/
const CAMERA_REAR: number;
/**
* Constant for media device busy error.
*/
const DEVICE_BUSY: number;
/**
* Crops the image proportionally causing its content to be clipped either horizontally or vertically.
*/
const IMAGE_SCALING_ASPECT_FILL: number;
/**
* Letterbox or pillarbox scales the image proportionally to fit the container.
*/
const IMAGE_SCALING_ASPECT_FIT: number;
/**
* Scales the image depending on how the view container is sized.
*/
const IMAGE_SCALING_AUTO: number;
/**
* Stretches the image disproportionally to completely fill the container's bounds.
*/
const IMAGE_SCALING_FILL: number;
/**
* Disables scaling and displays the image as-is.
*/
const IMAGE_SCALING_NONE: number;
/**
* Media type constant for live photo media.
*/
const MEDIA_TYPE_LIVEPHOTO: string;
/**
* Media type constant for photo media.
*/
const MEDIA_TYPE_PHOTO: string;
/**
* Media type constant for video media.
*/
const MEDIA_TYPE_VIDEO: string;
/**
* Constant for grouping query results by album.
*/
const MUSIC_MEDIA_GROUP_ALBUM: number;
/**
* Constant for grouping query results by album and artist.
*/
const MUSIC_MEDIA_GROUP_ALBUM_ARTIST: number;
/**
* Constant for grouping query results by artist.
*/
const MUSIC_MEDIA_GROUP_ARTIST: number;
/**
* Constant for grouping query results by composer.
*/
const MUSIC_MEDIA_GROUP_COMPOSER: number;
/**
* Constant for grouping query results by genre.
*/
const MUSIC_MEDIA_GROUP_GENRE: number;
/**
* Constant for grouping query results by playlist.
*/
const MUSIC_MEDIA_GROUP_PLAYLIST: number;
/**
* Constant for grouping query results by podcast title.
*/
const MUSIC_MEDIA_GROUP_PODCAST_TITLE: number;
/**
* Constant for grouping query results by title.
*/
const MUSIC_MEDIA_GROUP_TITLE: number;
/**
* Music library media containing any type of content.
*/
const MUSIC_MEDIA_TYPE_ALL: number;
/**
* Music library media containing any type of audio content.
*/
const MUSIC_MEDIA_TYPE_ANY_AUDIO: number;
/**
* Music library media containing audiobook content.
*/
const MUSIC_MEDIA_TYPE_AUDIOBOOK: number;
/**
* Music library media containing music content.
*/
const MUSIC_MEDIA_TYPE_MUSIC: number;
/**
* Music library media containing podcast content.
*/
const MUSIC_MEDIA_TYPE_PODCAST: number;
/**
* Constant for "Repeat All" setting.
*/
const MUSIC_PLAYER_REPEAT_ALL: number;
/**
* Constant for user's default repeat setting.
*/
const MUSIC_PLAYER_REPEAT_DEFAULT: number;
/**
* Constant for "No Repeat" setting.
*/
const MUSIC_PLAYER_REPEAT_NONE: number;
/**
* Constant for "Repeat one item" setting.
*/
const MUSIC_PLAYER_REPEAT_ONE: number;
/**
* Constant for shuffling complete albums setting.
*/
const MUSIC_PLAYER_SHUFFLE_ALBUMS: number;
/**
* Constant for user's default shuffle setting.
*/
const MUSIC_PLAYER_SHUFFLE_DEFAULT: number;
/**
* Constant for "no shuffle" setting.
*/
const MUSIC_PLAYER_SHUFFLE_NONE: number;
/**
* Constant for shuffling songs setting.
*/
const MUSIC_PLAYER_SHUFFLE_SONGS: number;
/**
* Constant for interrupted state.
*/
const MUSIC_PLAYER_STATE_INTERRUPTED: number;
/**
* Constant for paused state.
*/
const MUSIC_PLAYER_STATE_PAUSED: number;
/**
* Constant for playing state.
*/
const MUSIC_PLAYER_STATE_PLAYING: number;
/**
* Constant for backward seek state.
*/
const MUSIC_PLAYER_STATE_SEEK_BACKWARD: number;
/**
* Constant for forward seek state.
*/
const MUSIC_PLAYER_STATE_SEEK_FORWARD: number;
/**
* Constant for stopped state.
*/
const MUSIC_PLAYER_STATE_STOPPED: number;
/**
* Constant for media no camera error.
*/
const NO_CAMERA: number;
/**
* Constant for camera didn't focus when taking a trying to take a picture.
*/
const NO_FOCUS: number;
/**
* Constant for media no video error.
*/
const NO_VIDEO: number;
/**
* Media type constant for FHD video recording.
*/
const QUALITY_FHD: number;
/**
* Media type constant for HD video recording.
*/
const QUALITY_HD: number;
/**
* Media type constant for high-quality video recording.
*/
const QUALITY_HIGH: number;
/**
* Media type constant for low-quality video recording.
*/
const QUALITY_LOW: number;
/**
* Media type constant for medium-quality video recording.
*/
const QUALITY_MEDIUM: number;
/**
* Media type constant for SD video recording.
*/
const QUALITY_SD: number;
/**
* Media type constant for UHD video recording.
*/
const QUALITY_UHD: number;
/**
* Constant for unknown media error.
*/
const UNKNOWN_ERROR: number;
/**
* Vertical align center
*/
const VERTICAL_ALIGN_BOTTOM: number;
/**
* Vertical align center
*/
const VERTICAL_ALIGN_CENTER: number;
/**
* Vertical align center
*/
const VERTICAL_ALIGN_TOP: number;
/**
* Constant for default video controls.
* @deprecated This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_CONTROL_DEFAULT: number;
/**
* Constant for video controls for an embedded view.
* @deprecated This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_CONTROL_EMBEDDED: number;
/**
* Constant for fullscreen video controls.
* @deprecated This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_CONTROL_FULLSCREEN: number;
/**
* Constant for video controls hidden.
* @deprecated This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_CONTROL_HIDDEN: number;
/**
* Constant for no video controls.
* @deprecated This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_CONTROL_NONE: number;
/**
* Video playback ended normally.
*/
const VIDEO_FINISH_REASON_PLAYBACK_ENDED: number;
/**
* Video playback ended abnormally.
*/
const VIDEO_FINISH_REASON_PLAYBACK_ERROR: number;
/**
* Video playback ended by user action (such as clicking the `Done` button).
*/
const VIDEO_FINISH_REASON_USER_EXITED: number;
/**
* Indicates that the player can no longer play media items because of an error.
*/
const VIDEO_LOAD_STATE_FAILED: number;
/**
* Current media is playable.
*/
const VIDEO_LOAD_STATE_PLAYABLE: number;
/**
* Current load state is not known.
*/
const VIDEO_LOAD_STATE_UNKNOWN: number;
/**
* The media contains audio media.
*/
const VIDEO_MEDIA_TYPE_AUDIO: string;
/**
* The media contains closed-caption content.
*/
const VIDEO_MEDIA_TYPE_CLOSED_CAPTION: string;
/**
* The media contains depth data.
*/
const VIDEO_MEDIA_TYPE_DEPTH_DATA: string;
/**
* The media contains metadata.
*/
const VIDEO_MEDIA_TYPE_METADATA: string;
/**
* The media contains metadata objects.
*/
const VIDEO_MEDIA_TYPE_METADATA_OBJECT: string;
/**
* The media contains muxed media.
*/
const VIDEO_MEDIA_TYPE_MUXED: string;
/**
* The media contains subtitles.
*/
const VIDEO_MEDIA_TYPE_SUBTITLE: string;
/**
* The media contains text.
*/
const VIDEO_MEDIA_TYPE_TEXT: string;
/**
* The media contains a time code.
*/
const VIDEO_MEDIA_TYPE_TIMECODE: string;
/**
* The media contains video.
*/
const VIDEO_MEDIA_TYPE_VIDEO: string;
/**
* Video playback has been interrupted.
*/
const VIDEO_PLAYBACK_STATE_INTERRUPTED: number;
/**
* Video playback is paused.
*/
const VIDEO_PLAYBACK_STATE_PAUSED: number;
/**
* Video is being played.
*/
const VIDEO_PLAYBACK_STATE_PLAYING: number;
/**
* Video playback is rewinding.
*/
const VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD: number;
/**
* Video playback is seeking forward.
*/
const VIDEO_PLAYBACK_STATE_SEEKING_FORWARD: number;
/**
* Video playback is stopped.
*/
const VIDEO_PLAYBACK_STATE_STOPPED: number;
/**
* Constant for disabling repeat on video playback.
*/
const VIDEO_REPEAT_MODE_NONE: number;
/**
* Constant for repeating one video (e.g., the one video will repeat constantly) during playback.
*/
const VIDEO_REPEAT_MODE_ONE: number;
/**
* Scale video to fill the screen, clipping edges if necessary.
* @deprecated Use instead.
* This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_SCALING_ASPECT_FILL: number;
/**
* Scale video to fit the screen, letterboxing if necessary.
* @deprecated Use instead.
* This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_SCALING_ASPECT_FIT: number;
/**
* Video is scaled until both dimensions fit the screen exactly, stretching if necessary.
* @deprecated Use instead.
* This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_SCALING_MODE_FILL: number;
/**
* Video scaling is disabled.
* @deprecated This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
const VIDEO_SCALING_NONE: number;
/**
* Specifies that the video should be stretched to fill the bounds of layer.
*/
const VIDEO_SCALING_RESIZE: string | number;
/**
* Specifies that the player should preserve the aspect ratio of video and fit the video within the bounds of layer.
*/
const VIDEO_SCALING_RESIZE_ASPECT: string | number;
/**
* Specifies that the player should preserve the aspect ratio of video and fill the bounds of layer.
*/
const VIDEO_SCALING_RESIZE_ASPECT_FILL: string | number;
/**
* Use the closest sync (or key) frame at given the time.
*/
const VIDEO_TIME_OPTION_CLOSEST_SYNC: number;
/**
* Use the exact time.
*/
const VIDEO_TIME_OPTION_EXACT: number;
/**
* Use the closest keyframe in the time.
*/
const VIDEO_TIME_OPTION_NEAREST_KEYFRAME: number;
/**
* Use the sync (or key) frame located right after or at given the time.
*/
const VIDEO_TIME_OPTION_NEXT_SYNC: number;
/**
* Use the sync (or key) frame located right before or at given the time.
*/
const VIDEO_TIME_OPTION_PREVIOUS_SYNC: number;
/**
* Android-specific media-related functionality.
*/
class Android extends Titanium.Module {
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: boolean;
/**
* The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
*/
static lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Applies the properties to the proxy.
*/
static applyProperties(props: any): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Scans newly created or downloaded media files to make them available to other
* Android media providers, such as the Gallery.
*/
static scanMediaFiles(
paths: ReadonlyArray,
mimeTypes: ReadonlyArray,
callback: (param0: MediaScannerResponse) => void,
): void;
/**
* Set the system homescreen wallpaper.
*/
static setSystemWallpaper(image: Titanium.Blob, scale: boolean): void;
}
/**
* Base event for class Titanium.Media.AudioPlayer
*/
interface AudioPlayerBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Media.AudioPlayer;
}
/**
* Fired when the state of the playback changes.
*/
interface AudioPlayer_change_Event extends AudioPlayerBaseEvent {
/**
* Text description of the state of playback.
*/
description: number;
/**
* Current state of playback.
*/
state: number;
}
/**
* Fired when the audio has finished playing.
*/
interface AudioPlayer_complete_Event extends AudioPlayerBaseEvent {
/**
* Error code.
* Error code will be 0 if `success` is `true`, nonzero otherwise. If the error
* was generated by the operating system, that system's error value is used.
* Otherwise, this value will be -1.
*/
code: number;
/**
* Error message, if any returned. Will be undefined if `success` is `true`.
*/
error: string;
/**
* Indicates if the sound was played successfully.
* Returns `true` if request succeeded, `false` otherwise.
*/
success: boolean;
}
/**
* Fired when the timed metadata was encountered most recently within the media as it plays.
*/
interface AudioPlayer_metadata_Event extends AudioPlayerBaseEvent {
/**
* An array of metadata items containing relevant information about the current media item.
*/
items: TiMetadataItemType[];
}
/**
* Fired when there's an error.
*/
interface AudioPlayer_error_Event extends AudioPlayerBaseEvent {
/**
* Error code. Different between Android and iOS.
*/
code: number;
/**
* Error message.
*/
error: string;
}
/**
* Fired once per second with the current progress during playback.
*/
interface AudioPlayer_progress_Event extends AudioPlayerBaseEvent {
/**
* Current progress, in milliseconds.
*/
progress: number;
}
/**
* Fired once the [seekToTime](Titanium.Media.AudioPlayer.seek) method completes.
*/
interface AudioPlayer_seek_Event extends AudioPlayerBaseEvent {
/**
* The event for any prior seek request that is still in process will be invoked
* immediately with the `finished` parameter set to `false`.
* If the new request completes without being interrupted by another seek
* request or by any other operation this event will be invoked with
* the `finished` parameter set to `true`.
*/
finished: boolean;
}
interface AudioPlayerEventMap extends ProxyEventMap {
change: AudioPlayer_change_Event;
complete: AudioPlayer_complete_Event;
error: AudioPlayer_error_Event;
metadata: AudioPlayer_metadata_Event;
progress: AudioPlayer_progress_Event;
seek: AudioPlayer_seek_Event;
}
/**
* An audio player object used for streaming audio to the device, and low-level control of the audio playback.
*/
class AudioPlayer extends Titanium.Proxy {
/**
* Used to identify the volume of audio streams for alarms.
*/
readonly AUDIO_TYPE_ALARM: number;
/**
* Used to identify the volume of audio streams for media playback.
*/
readonly AUDIO_TYPE_MEDIA: number;
/**
* Used to identify the volume of audio streams for notifications.
*/
readonly AUDIO_TYPE_NOTIFICATION: number;
/**
* Used to identify the volume of audio streams for the phone ring.
*/
readonly AUDIO_TYPE_RING: number;
/**
* Used to identify the volume of audio streams for DTMF tones or beeps.
*/
readonly AUDIO_TYPE_SIGNALLING: number;
/**
* Used to identify the volume of audio streams for voice calls.
*/
readonly AUDIO_TYPE_VOICE: number;
/**
* Audio data is being buffered from the network.
* @deprecated Use [Titanium.Media.AUDIO_STATE_BUFFERING](Titanium.Media.AUDIO_STATE_BUFFERING) instead.
*/
readonly STATE_BUFFERING: number;
/**
* Audio playback is being initialized.
* @deprecated Use [Titanium.Media.AUDIO_STATE_INITIALIZED](Titanium.Media.AUDIO_STATE_INITIALIZED) instead.
*/
readonly STATE_INITIALIZED: number;
/**
* Playback is paused.
* @deprecated Use [Titanium.Media.AUDIO_STATE_PAUSED](Titanium.Media.AUDIO_STATE_PAUSED) instead.
*/
readonly STATE_PAUSED: number;
/**
* Audio playback is active.
* @deprecated Use [Titanium.Media.AUDIO_STATE_PLAYING](Titanium.Media.AUDIO_STATE_PLAYING) instead.
*/
readonly STATE_PLAYING: number;
/**
* Audio playback is starting.
* @deprecated Use [Titanium.Media.AUDIO_STATE_STARTING](Titanium.Media.AUDIO_STATE_STARTING) instead.
*/
readonly STATE_STARTING: number;
/**
* Audio playback is stopped.
* @deprecated Use [Titanium.Media.AUDIO_STATE_STOPPED](Titanium.Media.AUDIO_STATE_STOPPED) instead.
*/
readonly STATE_STOPPED: number;
/**
* Audio playback is stopping.
* @deprecated Use [Titanium.Media.AUDIO_STATE_STOPPING](Titanium.Media.AUDIO_STATE_STOPPING) instead.
*/
readonly STATE_STOPPING: number;
/**
* Player is waiting for audio data from the network.
* @deprecated Use [Titanium.Media.AUDIO_STATE_WAITING_FOR_DATA](Titanium.Media.AUDIO_STATE_WAITING_FOR_DATA) instead.
*/
readonly STATE_WAITING_FOR_DATA: number;
/**
* Player is waiting for audio data to fill the queue.
* @deprecated Use [Titanium.Media.AUDIO_STATE_WAITING_FOR_QUEUE](Titanium.Media.AUDIO_STATE_WAITING_FOR_QUEUE) instead.
*/
readonly STATE_WAITING_FOR_QUEUE: number;
/**
* Boolean to indicate if audio should continue playing even if the associated
* Android [Activity](Titanium.Android.Activity) is paused.
*/
allowBackground: boolean;
/**
* Indicates whether the player allows switching to "external playback" mode.
*/
allowsExternalPlayback: boolean;
/**
* Focuses on the current audio player and stops other audio playing.
*/
audioFocus: boolean;
/**
* Returns the audio session id.
*/
readonly audioSessionId: number;
/**
* Changes the audio-stream-type.
*/
audioType: number;
/**
* Bit rate of the current playback stream.
*/
bitRate: number;
/**
* Size of the buffer used for streaming, in milliseconds.
*/
bufferSize: number;
/**
* Estimated duration in milliseconds of the file being played.
*/
readonly duration: number;
/**
* Indicates whether the player is currently playing video in "external playback" mode.
*/
readonly externalPlaybackActive: boolean;
/**
* Boolean indicating if the player is idle.
*/
readonly idle: boolean;
/**
* Indicates whether or not audio output of the player is muted.
*/
muted: boolean;
/**
* Boolean indicating if audio playback is paused.
*/
paused: boolean;
/**
* Boolean indicating if audio is currently playing.
*/
readonly playing: boolean;
/**
* Current playback progress, in milliseconds.
*/
readonly progress: number;
/**
* Indicates the desired rate of playback; 0.0 means "paused", 1.0 indicates a
* desire to play at the natural rate of the current item. In addition, 2.0
* would mean that the audio plays twice as fast.
*/
rate: number;
/**
* Current state of playback, specified using one of the `STATE` constants defined on this object.
*/
readonly state: number;
/**
* Current playback position of the audio.
*/
time: number;
/**
* URL for the audio stream.
*/
url: string;
/**
* Volume of the audio, from 0.0 (muted) to 1.0 (loudest).
*/
volume: number;
/**
* Boolean indicating if the playback is waiting for audio data from the network.
*/
readonly waiting: boolean;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Media.AudioPlayer, event: AudioPlayerEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: AudioPlayerEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Returns the audio session id.
* @deprecated Use the [audioSessionId](Titanium.Media.AudioPlayer.audioSessionId) property instead
*/
getAudioSessionId(): number;
/**
* Returns the value of the [paused](Titanium.Media.AudioPlayer.paused) property.
* @deprecated Use the cross-platform API property instead.
*/
getPaused: never;
/**
* Returns the value of the [playing](Titanium.Media.AudioPlayer.playing) property.
* @deprecated Use the cross-platform API property instead.
*/
getPlaying: never;
/**
* Returns the value of the [paused](Titanium.Media.AudioPlayer.paused) property.
* @deprecated Use the cross-platform API property instead.
*/
isPaused: never;
/**
* Returns the value of the [playing](Titanium.Media.AudioPlayer.playing) property.
* @deprecated Use the cross-platform API property instead.
*/
isPlaying: never;
/**
* Pauses audio playback.
*/
pause(): void;
/**
* Starts or resumes audio playback.
* @deprecated Use the cross-platform API [Titanium.Media.AudioPlayer.start](Titanium.Media.AudioPlayer.start) instead.
*/
play(): void;
/**
* Stops buffering audio data and releases audio resources.
*/
release(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Media.AudioPlayer, event: AudioPlayerEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Restarts (stops and stars) audio playback.
*/
restart(): void;
/**
* Moves the playback cursor and invokes the specified block when the seek
* operation has either been completed or been interrupted.
*/
seekToTime(time: number): void;
/**
* Sets the value of the [paused](Titanium.Media.AudioPlayer.paused) property.
* @deprecated Use the cross-platform API [Titanium.Media.AudioPlayer.pause](Titanium.Media.AudioPlayer.pause) instead.
*/
setPaused: never;
/**
* Starts or resumes audio playback.
*/
start(): void;
/**
* Converts a [state](Titanium.Media.AudioPlayer.state) value into a text description
* suitable for display.
*/
stateDescription(state: number): string;
/**
* Stops audio playback.
*/
stop(): void;
}
/**
* An audio recorder object used for recording audio from the device microphone.
*/
class AudioRecorder extends Titanium.Proxy {
/**
* Audio compression to be used for the recording.
*/
compression: number;
/**
* Audio format to be used for the recording.
*/
format: number;
/**
* Indicates if the audio recorder is paused.
*/
readonly paused: boolean;
/**
* Indicates if the audio recorder is recording.
*/
readonly recording: boolean;
/**
* Indicates if the audio recorder is stopped.
*/
readonly stopped: boolean;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Pauses the current audio recording.
*/
pause(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Resumes a paused recording.
*/
resume(): void;
/**
* Starts an audio recording.
*/
start(): void;
/**
* Stops the current audio recording and returns the recorded audio file.
*/
stop(): Titanium.Filesystem.File;
}
/**
* A representation of a media item returned by [openMusicLibrary](Titanium.Media.openMusicLibrary) or [queryMusicLibrary](Titanium.Media.queryMusicLibrary).
*/
interface Item extends Titanium.Proxy {
/**
* Artist credited for the album containing this item.
*/
readonly albumArtist: string;
/**
* The persistent identifier for an album artist.
*/
readonly albumArtistPersistentID: number;
/**
* The key for the persistent identifier for an album.
*/
readonly albumPersistentID: number;
/**
* Title of the album containing this item.
*/
readonly albumTitle: string;
/**
* Number of tracks for the album containing this item.
*/
readonly albumTrackCount: number;
/**
* Track number for this item.
*/
readonly albumTrackNumber: number;
/**
* Artist credited for this item.
*/
readonly artist: string;
/**
* Image for the item's artwork as a `Blob` object, or `null` if no artwork is
* available.
*/
readonly artwork: Titanium.Blob;
/**
* A URL pointing to the media item.
*/
readonly assetURL: string;
/**
* The number of musical beats per minute for the media item.
*/
readonly beatsPerMinute: number;
/**
* The user's place in the media item the most recent time it was played.
*/
readonly bookmarkTime: string;
/**
* Textual information about the media item.
*/
readonly comments: string;
/**
* Composer of this item.
*/
readonly composer: string;
/**
* Date when the item was added to the music library.
*/
readonly dateAdded: Date;
/**
* Total number of discs for the album containing this item.
*/
readonly discCount: number;
/**
* Disc number for this item in the album.
*/
readonly discNumber: number;
/**
* Genre of this item.
*/
readonly genre: string;
/**
* The persistent identifier for a genre.
*/
readonly genrePersistentID: number;
/**
* True if the item represents a protected asset.
*/
readonly hasProtectedAsset: boolean;
/**
* True if the media item is an iCloud item.
*/
readonly isCloudItem: boolean;
/**
* True if this item is part of a compilation album.
*/
readonly isCompilation: boolean;
/**
* True if this item is marked as "Explicit".
*/
readonly isExplicit: boolean;
/**
* The most recent calendar date on which the user played the media item.
*/
readonly lastPlayedDate: Date;
/**
* Lyrics for this item.
*/
readonly lyrics: string;
/**
* The type of the media.
*/
readonly mediaType: number;
/**
* The key for the persistent identifier for the media item.
*/
readonly persistentID: string;
/**
* Number of times the item has been played.
*/
readonly playCount: number;
/**
* Length (in seconds) of this item.
*/
readonly playbackDuration: number;
/**
* Used to enqueue store tracks by their ID.
*/
readonly playbackStoreID: number;
/**
* The persistent identifier for an audio podcast.
*/
readonly podcastPersistentID: number;
/**
* Title of a podcast item.
*/
readonly podcastTitle: string;
/**
* Rating for this item.
*/
readonly rating: number;
/**
* Date when this this item was released.
*/
readonly releaseDate: Date;
/**
* Number of times this item has been skipped.
*/
readonly skipCount: number;
/**
* Title of this item.
*/
readonly title: string;
/**
* Grouping information for the media item.
*/
readonly userGrouping: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Base event for class Titanium.Media.MusicPlayer
*/
interface MusicPlayerBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Media.MusicPlayer;
}
/**
* Fired when the currently playing media item changes.
*/
interface MusicPlayer_playingchange_Event extends MusicPlayerBaseEvent {
}
/**
* Fired when the music player's playback state changes.
*/
interface MusicPlayer_statechange_Event extends MusicPlayerBaseEvent {
}
interface MusicPlayerEventMap extends ProxyEventMap {
playingchange: MusicPlayer_playingchange_Event;
statechange: MusicPlayer_statechange_Event;
}
/**
* This object represents a music controller.
*/
class MusicPlayer extends Titanium.Proxy {
/**
* Current point in song playback, in seconds.
*/
currentPlaybackTime: number;
/**
* An `Item` object representing the currently playing media item.
*/
readonly nowPlaying: Titanium.Media.Item;
/**
* Playback state.
*/
readonly playbackState: number;
/**
* Repeat setting.
*/
repeatMode: number;
/**
* Shuffle setting.
*/
shuffleMode: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Media.MusicPlayer, event: MusicPlayerEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: MusicPlayerEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Pauses playback of the current media item.
*/
pause(): void;
/**
* Begins playback of the current media item.
*/
play(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Media.MusicPlayer, event: MusicPlayerEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Begins seeking backward in the currently playing media.
*/
seekBackward(): void;
/**
* Begins seeking forward in the currently playing media item.
*/
seekForward(): void;
/**
* Sets the media queue.
*/
setQueue(queue: Titanium.Media.Item | Titanium.Media.Item[] | string): void;
/**
* Skips to the beginning of the currently playing media item.
*/
skipToBeginning(): void;
/**
* Skips to the next media item in the queue.
*/
skipToNext(): void;
/**
* Skips to the previous media item in the queue.
*/
skipToPrevious(): void;
/**
* Stops playback of the current media queue.
*/
stop(): void;
/**
* Ends a seek operation and returns to the previous playback state.
* See also: [seekForward](Titanium.Media.MusicPlayer.seekForward) and
* [seekBackward](Titanium.Media.MusicPlayer.seekBackward).
*/
stopSeeking(): void;
}
/**
* Base event for class Titanium.Media.Sound
*/
interface SoundBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Media.Sound;
}
/**
* Fired when the state of the playback changes.
*/
interface Sound_change_Event extends SoundBaseEvent {
/**
* Text description of the state of playback.
*/
description: string;
/**
* Current state of playback.
*/
state: number;
}
/**
* Fired when the audio has finished playing.
*/
interface Sound_complete_Event extends SoundBaseEvent {
/**
* Error code.
* Error code will be `0` if `success` is `true`, nonzero otherwise. If the error
* was generated by the operating system, that system's error value is used.
* Otherwise, this value will be `-1`.
*/
code: number;
/**
* Error message, if any returned. Will be undefined if `success` is `true`.
*/
error: string;
/**
* Indicates if the sound was played successfully.
* Returns `true` if request succeeded, `false` otherwise.
*/
success: boolean;
}
/**
* Fired when an error occurs while playing the audio.
*/
interface Sound_error_Event extends SoundBaseEvent {
/**
* Error code.
* If the error was generated by the operating system, that system's error value
* is used. Otherwise, this value will be `-1`.
*/
code: number;
/**
* Error message, if any returned. May be `undefined`.
*/
error: string;
/**
* Error message.
* @deprecated Use the `error` property instead
*/
message: never;
/**
* Indicates a successful operation. Returns `false`.
*/
success: boolean;
}
/**
* Fired when audio playback is interrupted by the device.
*/
interface Sound_interrupted_Event extends SoundBaseEvent {
}
/**
* Fired when audio playback is resumed after an interruption.
*/
interface Sound_resume_Event extends SoundBaseEvent {
/**
* Indicates if the resume was from an interruption.
*/
interruption: boolean;
}
interface SoundEventMap extends ProxyEventMap {
change: Sound_change_Event;
complete: Sound_complete_Event;
error: Sound_error_Event;
interrupted: Sound_interrupted_Event;
resume: Sound_resume_Event;
}
/**
* An object for playing basic audio resources.
*/
class Sound extends Titanium.Proxy {
/**
* Used to identify the volume of audio streams for alarms.
*/
readonly AUDIO_TYPE_ALARM: number;
/**
* Used to identify the volume of audio streams for media playback.
*/
readonly AUDIO_TYPE_MEDIA: number;
/**
* Used to identify the volume of audio streams for notifications.
*/
readonly AUDIO_TYPE_NOTIFICATION: number;
/**
* Used to identify the volume of audio streams for the phone ring.
*/
readonly AUDIO_TYPE_RING: number;
/**
* Used to identify the volume of audio streams for DTMF tones or beeps.
*/
readonly AUDIO_TYPE_SIGNALLING: number;
/**
* Used to identify the volume of audio streams for voice calls.
*/
readonly AUDIO_TYPE_VOICE: number;
/**
* Audio data is being buffered from the network.
*/
readonly STATE_BUFFERING: number;
/**
* Audio playback is being initialized.
*/
readonly STATE_INITIALIZED: number;
/**
* Playback is paused.
*/
readonly STATE_PAUSED: number;
/**
* Audio playback is active.
*/
readonly STATE_PLAYING: number;
/**
* Audio playback is starting.
*/
readonly STATE_STARTING: number;
/**
* Audio playback is stopped.
*/
readonly STATE_STOPPED: number;
/**
* Audio playback is stopping.
*/
readonly STATE_STOPPING: number;
/**
* Player is waiting for audio data from the network.
*/
readonly STATE_WAITING_FOR_DATA: number;
/**
* Player is waiting for audio data to fill the queue.
*/
readonly STATE_WAITING_FOR_QUEUE: number;
/**
* Determines whether the audio should continue playing even when its activity is paused.
*/
allowBackground: boolean;
/**
* Changes the audio-stream-type.
*/
audioType: number;
/**
* Duration of the audio resource.
*/
readonly duration: number;
/**
* Determines whether the audio should loop upon completion.
*/
looping: boolean;
/**
* Indicates if the audio is paused.
*/
paused: boolean;
/**
* Indicates if the audio is playing.
*/
readonly playing: boolean;
/**
* Current playback position of the audio.
*/
time: number;
/**
* URL identifying the audio resource.
*/
url: string;
/**
* Volume of the audio from 0.0 (muted) to 1.0 (loudest).
*/
volume: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Media.Sound, event: SoundEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: SoundEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Returns the value of the [looping](Titanium.Media.Sound.looping) property.
* @deprecated Use the property instead.
*/
isLooping(): boolean;
/**
* Returns the value of the [paused](Titanium.Media.Sound.paused) property.
* @deprecated Use the property instead.
*/
isPaused(): boolean;
/**
* Returns the value of the [playing](Titanium.Media.Sound.playing) property.
* @deprecated Use the property instead.
*/
isPlaying(): boolean;
/**
* Pauses the audio.
*/
pause(): void;
/**
* Starting playing the sound, or resume playing a paused sound.
*/
play(): void;
/**
* Releases all internal resources.
*/
release(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Media.Sound, event: SoundEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Resets the audio playback position to the beginning.
*/
reset(): void;
/**
* Sets the value of the [looping](Titanium.Media.Sound.looping) property.
* @deprecated Set the value of the [looping](Titanium.Media.Sound.looping) property directly.
*/
setLooping(looping: boolean): void;
/**
* Sets the value of the [paused](Titanium.Media.Sound.paused) property.
* @deprecated It is preferable to use the [pause](Titanium.Media.Sound.pause) and
* [play](Titanium.Media.Sound.play) methods instead.
*/
setPaused(paused: boolean): void;
/**
* Stops playing the audio and resets the playback position to the beginning of the clip.
*/
stop(): void;
}
/**
* An object for playing system sounds.
* @deprecated This iOS-only API has been deprecated and moved to the [Ti.SystemAlert](https://github.com/appcelerator-modules/ti.systemalert) module in 8.0.0.
*/
class SystemAlert extends Titanium.Proxy {
/**
* URL identifying the audio resource.
*/
url: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Start playing the system alert.
*/
play(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* Base event for class Titanium.Media.VideoPlayer
*/
interface VideoPlayerBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Media.VideoPlayer;
}
/**
* Fired when the device detects a click against the view.
*/
interface VideoPlayer_click_Event extends VideoPlayerBaseEvent {
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when the device detects a double click against the view.
*/
interface VideoPlayer_dblclick_Event extends VideoPlayerBaseEvent {
/**
* Returns `true` if the double click passed through an overlapping window belonging to another app.
* This is a security feature to protect an app from "tapjacking", where a malicious app can use a
* system overlay to intercept touch events in your app or to trick the end-user to tap on UI
* in your app intended for the overlay.
*/
obscured: boolean;
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when the device detects a double tap against the view.
*/
interface VideoPlayer_doubletap_Event extends VideoPlayerBaseEvent {
/**
* Returns `true` if the double tap passed through an overlapping window belonging to another app.
* This is a security feature to protect an app from "tapjacking", where a malicious app can use a
* system overlay to intercept touch events in your app or to trick the end-user to tap on UI
* in your app intended for the overlay.
*/
obscured: boolean;
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when the view element gains focus.
*/
interface VideoPlayer_focus_Event extends VideoPlayerBaseEvent {
}
/**
* Fired when a hardware key is pressed in the view.
*/
interface VideoPlayer_keypressed_Event extends VideoPlayerBaseEvent {
/**
* The code for the physical key that was pressed. For more details, see [KeyEvent](https://developer.android.com/reference/android/view/KeyEvent.html). This API is experimental and subject to change.
*/
keyCode: number;
}
/**
* Fired when the device detects a long click.
*/
interface VideoPlayer_longclick_Event extends VideoPlayerBaseEvent {
}
/**
* Fired when the device detects a long press.
*/
interface VideoPlayer_longpress_Event extends VideoPlayerBaseEvent {
/**
* Returns `true` if the long press passed through an overlapping window belonging to another app.
* This is a security feature to protect an app from "tapjacking", where a malicious app can use a
* system overlay to intercept touch events in your app or to trick the end-user to tap on UI
* in your app intended for the overlay.
*/
obscured: boolean;
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when the device detects a pinch gesture.
*/
interface VideoPlayer_pinch_Event extends VideoPlayerBaseEvent {
/**
* The average distance between each of the pointers forming the gesture in progress through
* the focal point.
*/
currentSpan: number;
/**
* The average X distance between each of the pointers forming the gesture in progress through
* the focal point.
*/
currentSpanX: number;
/**
* The average Y distance between each of the pointers forming the gesture in progress through
* the focal point.
*/
currentSpanY: number;
/**
* The X coordinate of the current gesture's focal point.
*/
focusX: number;
/**
* The Y coordinate of the current gesture's focal point.
*/
focusY: number;
/**
* Returns `true` if a scale gesture is in progress, `false` otherwise.
*/
inProgress: boolean;
/**
* The previous average distance between each of the pointers forming the gesture in progress through
* the focal point.
*/
previousSpan: number;
/**
* The previous average X distance between each of the pointers forming the gesture in progress through
* the focal point.
*/
previousSpanX: number;
/**
* The previous average Y distance between each of the pointers forming the gesture in progress through
* the focal point.
*/
previousSpanY: number;
/**
* The scale factor relative to the points of the two touches in screen coordinates.
*/
scale: number;
/**
* The event time of the current event being processed.
*/
time: number;
/**
* The time difference in milliseconds between the previous accepted scaling event and the
* current scaling event.
*/
timeDelta: number;
/**
* The velocity of the pinch in scale factor per second.
*/
velocity: number;
}
/**
* Fired when a layout cycle is finished.
*/
interface VideoPlayer_postlayout_Event extends VideoPlayerBaseEvent {
}
/**
* Fired when the device detects a two finger rotation.
*/
interface VideoPlayer_rotate_Event extends VideoPlayerBaseEvent {
/**
* Rotation in degrees.
*/
rotate: number;
}
/**
* Fired when the device detects a single tap against the view.
*/
interface VideoPlayer_singletap_Event extends VideoPlayerBaseEvent {
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when the device detects a swipe gesture against the view.
*/
interface VideoPlayer_swipe_Event extends VideoPlayerBaseEvent {
/**
* Direction of the swipe--either 'left', 'right', 'up', or 'down'.
*/
direction: string;
/**
* Returns `true` if the swipe passed through an overlapping window belonging to another app.
* This is a security feature to protect an app from "tapjacking", where a malicious app can use a
* system overlay to intercept touch events in your app or to trick the end-user to tap on UI
* in your app intended for the overlay.
*/
obscured: boolean;
/**
* X coordinate of the event's endpoint from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event's endpoint from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when a touch event is interrupted by the device.
*/
interface VideoPlayer_touchcancel_Event extends VideoPlayerBaseEvent {
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when a touch event is completed.
*/
interface VideoPlayer_touchend_Event extends VideoPlayerBaseEvent {
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired as soon as the device detects movement of a touch.
*/
interface VideoPlayer_touchmove_Event extends VideoPlayerBaseEvent {
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired as soon as the device detects a touch gesture.
*/
interface VideoPlayer_touchstart_Event extends VideoPlayerBaseEvent {
/**
* A value which indicates the stylus angle on the screen. If the stylus is perpendicular to the screen or no stylus is
* being used, the value will be Pi/2. If the stylus is parallel to the screen, the value will be 0.
* Note: This property is only available for iOS devices that support 3D-Touch and are 9.1 or later.
*/
altitudeAngle: number;
/**
* The x value of the unit vector that points in the direction of the azimuth of the stylus.
* Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
*/
azimuthUnitVectorInViewX: number;
/**
* The y value of the unit vector that points in the direction of the azimuth of the stylus.
* Note: This property is only available for iOS devices that support the Apple Pencil and are 9.1 or later.
*/
azimuthUnitVectorInViewY: number;
/**
* The current force value of the touch event.
* Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later and on some Android devices.
*/
force: number;
/**
* Maximum possible value of the force property.
* Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
*/
maximumPossibleForce: number;
/**
* Returns `true` if the touch passed through an overlapping window belonging to another app.
* This is a security feature to protect an app from "tapjacking", where a malicious app can use a
* system overlay to intercept touch events in your app or to trick the end-user to tap on UI
* in your app intended for the overlay.
*/
obscured: boolean;
/**
* The current size of the touch area. Note: This property is only available on some Android devices.
*/
size: number;
/**
* The time (in seconds) when the touch was used in correlation with the system start up.
* Note: This property is only available for iOS devices that support 3D-Touch and run 9.0 or later.
*/
timestamp: number;
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when the device detects a two-finger tap against the view.
*/
interface VideoPlayer_twofingertap_Event extends VideoPlayerBaseEvent {
/**
* Returns `true` if the tap passed through an overlapping window belonging to another app.
* This is a security feature to protect an app from "tapjacking", where a malicious app can use a
* system overlay to intercept touch events in your app or to trick the end-user to tap on UI
* in your app intended for the overlay.
*/
obscured: boolean;
/**
* X coordinate of the event from the `source` view's coordinate system.
*/
x: number;
/**
* Y coordinate of the event from the `source` view's coordinate system.
*/
y: number;
}
/**
* Fired when movie playback ends or a user exits playback.
*/
interface VideoPlayer_complete_Event extends VideoPlayerBaseEvent {
/**
* Error code.
* Error code will be 0 if `success` is `true`, nonzero otherwise. If the error
* was generated by the operating system, that system's error value is used.
* Otherwise, this value will be -1.
*/
code: number;
/**
* Error message, if any returned. Will be undefined if `success` is `true`.
*/
error: string;
/**
* Reason that playback ended.
*/
reason: number;
/**
* Indicates if the video was played successfully. User exit counts as a success.
* Returns `true` if `reason` is not
* [VIDEO_FINISH_REASON_PLAYBACK_ERROR](Titanium.Media.VIDEO_FINISH_REASON_PLAYBACK_ERROR),
* `false` otherwise.
*/
success: boolean;
}
/**
* Fired when the video duration is available.
*/
interface VideoPlayer_durationavailable_Event extends VideoPlayerBaseEvent {
/**
* Video duration, in milliseconds.
*/
duration: number;
}
/**
* Fired when movie playback encounters an error.
*/
interface VideoPlayer_error_Event extends VideoPlayerBaseEvent {
/**
* Error code.
* If the error was generated by the operating system, that system's error value
* is used. Otherwise, this value will be `-1`.
*/
code: number;
/**
* Error message, if any returned. May be `undefined`.
*/
error: string;
/**
* Reason for error as a string.
* @deprecated Use `error` property instead
*/
message: never;
/**
* Indicates a successful operation. Returns `false`.
*/
success: boolean;
}
/**
* Fired when the movie play loads.
*/
interface VideoPlayer_load_Event extends VideoPlayerBaseEvent {
}
/**
* Fired when the network [loadState](Titanium.Media.VideoPlayer.loadState) changes.
*/
interface VideoPlayer_loadstate_Event extends VideoPlayerBaseEvent {
/**
* Current value of the [loadState](Titanium.Media.VideoPlayer.loadState) property.
*/
loadState: number;
}
/**
* Fired when the natural size of the current movie is determined.
*/
interface VideoPlayer_naturalsizeavailable_Event extends VideoPlayerBaseEvent {
/**
* Current value of the [naturalSize](Titanium.Media.VideoPlayer.naturalSize) property.
*/
naturalSize: number;
}
/**
* Fired when the [playbackState](Titanium.Media.VideoPlayer.playbackState) changes.
*/
interface VideoPlayer_playbackstate_Event extends VideoPlayerBaseEvent {
/**
* Current value of the [playbackState](Titanium.Media.VideoPlayer.playbackState) property.
*/
playbackState: number;
}
/**
* Fired when the currently playing movie changes.
*/
interface VideoPlayer_playing_Event extends VideoPlayerBaseEvent {
/**
* URL of the media.
*/
url: string;
}
/**
* Fired when the movie has preloaded and is ready to play.
*/
interface VideoPlayer_preload_Event extends VideoPlayerBaseEvent {
}
/**
* Fired when the movie player is resized.
*/
interface VideoPlayer_resize_Event extends VideoPlayerBaseEvent {
}
interface VideoPlayerEventMap extends ProxyEventMap {
click: VideoPlayer_click_Event;
complete: VideoPlayer_complete_Event;
dblclick: VideoPlayer_dblclick_Event;
doubletap: VideoPlayer_doubletap_Event;
durationavailable: VideoPlayer_durationavailable_Event;
error: VideoPlayer_error_Event;
focus: VideoPlayer_focus_Event;
keypressed: VideoPlayer_keypressed_Event;
load: VideoPlayer_load_Event;
loadstate: VideoPlayer_loadstate_Event;
longclick: VideoPlayer_longclick_Event;
longpress: VideoPlayer_longpress_Event;
naturalsizeavailable: VideoPlayer_naturalsizeavailable_Event;
pinch: VideoPlayer_pinch_Event;
playbackstate: VideoPlayer_playbackstate_Event;
playing: VideoPlayer_playing_Event;
postlayout: VideoPlayer_postlayout_Event;
preload: VideoPlayer_preload_Event;
resize: VideoPlayer_resize_Event;
rotate: VideoPlayer_rotate_Event;
singletap: VideoPlayer_singletap_Event;
swipe: VideoPlayer_swipe_Event;
touchcancel: VideoPlayer_touchcancel_Event;
touchend: VideoPlayer_touchend_Event;
touchmove: VideoPlayer_touchmove_Event;
touchstart: VideoPlayer_touchstart_Event;
twofingertap: VideoPlayer_twofingertap_Event;
}
/**
* A native control for playing videos.
*/
class VideoPlayer extends Titanium.UI.View {
/**
* Whether or not the current movie can be played on a remote device.
*/
allowsAirPlay: boolean;
/**
* Indicates if player is hidden by default and shown when its ready.
*/
autoHide: boolean;
/**
* Indicates if a movie should automatically start playback.
*/
autoplay: boolean;
/**
* Sets the background view for customization which is always displayed behind movie content.
* @deprecated Use [Titanium.Media.VideoPlayer.overlayView](Titanium.Media.VideoPlayer.overlayView) instead.
*/
backgroundView: Titanium.UI.View;
/**
* Current playback time of the current movie in milliseconds.
*/
currentPlaybackTime: number;
/**
* The duration of the current movie in milliseconds, or 0.0 if not known.
*/
duration: number;
/**
* The end time of movie playback, in milliseconds.
*/
endPlaybackTime: number;
/**
* Handle DRM-encrypted video assets using the [Apple FairPlay Streaming API](https://developer.apple.com/streaming/fps/).
*/
fairPlayConfiguration: FairPlayConfiguration;
/**
* Determines if the movie is presented in the entire screen (obscuring all other application content).
* @deprecated This property has been removed for iOS in Titanium SDK 7.0.0 as of the official deprecation by Apple.
*/
fullscreen: boolean;
/**
* The start time of movie playback, in milliseconds.
*/
initialPlaybackTime: number;
/**
* Returns the network load state of the movie player.
* @deprecated On iOS, use [Titanium.Media.VideoPlayer.moviePlayerStatus](Titanium.Media.VideoPlayer.moviePlayerStatus) instead.
*/
readonly loadState: number;
/**
* Media object to play, as either a `Ti.Filesystem.File`, a `Ti.Blob`, or an URL `String`.
*/
media: Titanium.Blob | Titanium.Filesystem.File | string;
/**
* The style of the playback controls.
* @deprecated On iOS, use [Titanium.Media.VideoPlayer.showsControls](Titanium.Media.VideoPlayer.showsControls) instead.
*/
mediaControlStyle: number;
/**
* The type of media in the player's current item first track.
*/
readonly mediaTypes: string;
/**
* Returns the status of the movie player.
*/
readonly moviePlayerStatus: number;
/**
* Returns the natural size of the movie.
*/
naturalSize: MovieSize;
/**
* Use the overlay view to add additional custom views between the video content and the controls.
*/
overlayView: Titanium.UI.View;
/**
* Whether or not the receiver allows Picture in Picture playback.
*/
pictureInPictureEnabled: boolean;
/**
* Currently playable duration of the movie, in milliseconds, for progressively
* downloaded network content, or 0.0 if not known.
*/
readonly playableDuration: number;
/**
* Current playback state of the video player.
*/
readonly playbackState: number;
/**
* Boolean to indicate if the player has started playing.
*/
readonly playing: boolean;
/**
* Determines how the movie player repeats when reaching the end of playback.
*/
repeatMode: number;
/**
* Determines how the content scales to fit the view.
*/
scalingMode: number;
/**
* Whether or not the receiver shows playback controls. Default is true.
*/
showsControls: boolean;
/**
* Playback speed of the video.
*/
speed: number;
/**
* URL of the media to play.
*/
url: string;
/**
* Volume of the audio portion of the video.
*/
volume: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Media.VideoPlayer, event: VideoPlayerEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Cancels all pending asynchronous thumbnail requests.
*/
cancelAllThumbnailImageRequests(): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: VideoPlayerEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Pauses playing the video.
*/
pause(): void;
/**
* Starts playing the video.
*/
play(): void;
/**
* Releases the internal video resources immediately.
*/
release(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Media.VideoPlayer, event: VideoPlayerEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Asynchronously request thumbnail images for one or more points in time in the video.
*/
requestThumbnailImagesAtTimes(
times: ReadonlyArray,
option: number,
callback: (param0: ThumbnailResponse) => void,
): void;
/**
* Stops playing the video.
*/
stop(): void;
}
}
/**
* The top level network module.
*/
namespace Network {
/**
* A [networkType](Titanium.Network.networkType) value indicating that the device is
* communicating over a local-area network.
*/
const NETWORK_LAN: number;
/**
* A [networkType](Titanium.Network.networkType) value indicating that the device is
* communicating over a mobile network.
*/
const NETWORK_MOBILE: number;
/**
* A [networkType](Titanium.Network.networkType) value indicating that no
* network is available.
*/
const NETWORK_NONE: number;
/**
* A [networkType](Titanium.Network.networkType) value indicating that the
* current network type is unknown.
*/
const NETWORK_UNKNOWN: number;
/**
* A [networkType](Titanium.Network.networkType) value indicating that the
* device is communicating over a WiFi network.
*/
const NETWORK_WIFI: number;
/**
* Constant value for an Alert style push notification.
*/
const NOTIFICATION_TYPE_ALERT: number;
/**
* Constant value for a Badge style push notification.
*/
const NOTIFICATION_TYPE_BADGE: number;
/**
* Constant value for a Newsstand style push notification. Only available on iOS 5 and later
*/
const NOTIFICATION_TYPE_NEWSSTAND: number;
/**
* Constant value for a Sound style push notification.
*/
const NOTIFICATION_TYPE_SOUND: number;
/**
* Constant value specifying that the progress of a download can not be calculated.
*/
const PROGRESS_UNKNOWN: number;
/**
* Constant value specifying TLS version 1.0 for SSL.
*/
const TLS_VERSION_1_0: number;
/**
* Constant value specifying TLS version 1.1 for SSL.
*/
const TLS_VERSION_1_1: number;
/**
* Constant value specifying TLS version 1.2 for SSL.
*/
const TLS_VERSION_1_2: number;
/**
* Constant value specifying TLS version 1.3 for SSL.
*/
const TLS_VERSION_1_3: number;
/**
* Socket module, used for creating sockets.
*/
namespace Socket {
/**
* State value representing a closed socket.
*/
const CLOSED: number;
/**
* State value representing a connected socket.
*/
const CONNECTED: number;
/**
* State value indicating an error has occurred on the socket.
*/
const ERROR: number;
/**
* State value representing an initialized socket.
*/
const INITIALIZED: number;
/**
* State value representing a socket that is listening for connections.
*/
const LISTENING: number;
/**
* TCP socket that implements the `Titanium.IOStream` interface.
*/
class TCP extends Titanium.IOStream {
/**
* Callback to be fired when a listener accepts a connection.
*/
accepted: (param0: AcceptedCallbackArgs) => void;
/**
* Callback to be fired when the socket enters the "connected" state.
*/
connected: (param0: ConnectedCallbackArgs) => void;
/**
* Callback to be fired when the socket enters the [ERROR](Titanium.Network.Socket.ERROR) state.
*/
error: (param0: ErrorCallbackArgs) => void;
/**
* The host to connect to or listen on.
*/
host: string;
/**
* Max number of pending incoming connections to be allowed when the socket is in the [LISTENING](Titanium.Network.Socket.LISTENING) state.
*/
listenQueueSize: number;
/**
* The port to connect to or listen on.
*/
port: number;
/**
* Creates a secure socket.
*/
secure: boolean;
/**
* Current state of the socket.
*/
readonly state: number;
/**
* Timeout, in milliseconds, for `connect` and all `write` operations.
*/
timeout: number;
/**
* Tells a [LISTENING](Titanium.Network.Socket.LISTENING) socket to accept a connection request at the top of a listener's request queue when one becomes available.
*/
accept(options: AcceptDict): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Closes a socket.
*/
close(): void;
/**
* Attempts to connect the socket to its host/port.
*/
connect(): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Attempts to start listening on the socket's host/port.
*/
listen(): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
}
/**
* Base event for class Titanium.Network.BonjourBrowser
*/
interface BonjourBrowserBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Network.BonjourBrowser;
}
/**
* Fired when the discovered services list is updated
*/
interface BonjourBrowser_updatedservices_Event extends BonjourBrowserBaseEvent {
/**
* An array of BonjourService objects corresponding to currently available services. If you cache this value, including using it as table data, be aware that it could become out of date at any time due to the asynchronous nature of Bonjour service discovery.
*/
services: Titanium.Network.BonjourService[];
}
interface BonjourBrowserEventMap extends ProxyEventMap {
updatedservices: BonjourBrowser_updatedservices_Event;
}
/**
* A browser for the discovery and retrieval of Bonjour services available on the network.
*/
class BonjourBrowser extends Titanium.Proxy {
/**
* The domain the browser is searching in
*/
domain: string;
/**
* Whether or not the browser is currently searching
*/
isSearching: boolean;
/**
* The type of the service the browser searches for
*/
serviceType: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Network.BonjourBrowser, event: BonjourBrowserEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: BonjourBrowserEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Network.BonjourBrowser, event: BonjourBrowserEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Conduct a search for Bonjour services matching the type and domain specified during creation
*/
search(): void;
/**
* Halt an ongoing search
*/
stopSearch(): void;
}
/**
* Base event for class Titanium.Network.BonjourService
*/
interface BonjourServiceBaseEvent extends Ti.Event {
/**
* Source object that fired the event.
*/
source: Titanium.Network.BonjourService;
}
/**
* Fired when the service has been published (or errored).
*/
interface BonjourService_publish_Event extends BonjourServiceBaseEvent {
/**
* Error code
*/
code: number;
/**
* Error message
*/
error: string;
/**
* Reports if the publish operation was successful
*/
success: boolean;
}
/**
* Fired when the service has been resolved (or errored). If successful, the [socket](Titanium.Network.BonjourService.socket) property should now be available.
*/
interface BonjourService_resolve_Event extends BonjourServiceBaseEvent {
/**
* Error code
*/
code: number;
/**
* Error message
*/
error: string;
/**
* Reports if the resolve operation was successful
*/
success: boolean;
}
/**
* Fired when a service's publish or resolution was stopped via
*/
interface BonjourService_stop_Event extends BonjourServiceBaseEvent {
/**
* Error code
*/
code: number;
/**
* Error message
*/
error: string;
/**
* Reports if the stop operation was successful
*/
success: boolean;
}
interface BonjourServiceEventMap extends ProxyEventMap {
publish: BonjourService_publish_Event;
resolve: BonjourService_resolve_Event;
stop: BonjourService_stop_Event;
}
/**
* Describes a service on the network which is published by Bonjour.
*/
class BonjourService extends Titanium.Proxy {
/**
* the domain of the service
*/
domain: string;
/**
* whether or not the service is local to the device
*/
isLocal: boolean;
/**
* the name of the service
*/
name: string;
/**
* the TCPSocket object that is used to connect to the service
*/
socket: Titanium.Network.Socket.TCP;
/**
* the type of the service
*/
type: string;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(
name: K,
callback: (this: Titanium.Network.BonjourService, event: BonjourServiceEventMap[K]) => void,
): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: K, event?: BonjourServiceEventMap[K]): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Asynchronously publish a Bonjour service to the network. Only works if isLocal is TRUE
*/
publish(socket: Titanium.Network.Socket.TCP, callback?: (param0: Error, param1: boolean) => void): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(
name: K,
callback: (this: Titanium.Network.BonjourService, event: BonjourServiceEventMap[K]) => void,
): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Asynchronously resolve a Bonjour service from the network. Must be done before attempting to access the service's socket information, if a remote service. You cannot resolve a locally published service.
*/
resolve(timeout?: number, callback?: (param0: Error, param1: boolean) => void): void;
/**
* Asynchronously halts a currently running attempt to publish or resolve a service.
*/
stop(callback?: (param0: Error, param1: boolean) => void): void;
}
/**
* Cookie object used to manage the system cookie store and HTTP client cookie store.
*/
class Cookie extends Titanium.Proxy {
/**
* The comment describing the purpose of this cookie
*/
comment: string;
/**
* The domain attribute of the cookie.
*/
domain: string;
/**
* The expiration Date of the cookie.
*/
expiryDate: string;
/**
* The httponly attribute of the cookie.
*/
httponly: boolean;
/**
* Sets the Max-Age attribute of a Cookie, in delta-seconds.
*/
maxAge: number;
/**
* The name of the cookie.
*/
readonly name: string;
/**
* The original URL attribute of the cookie.
*/
originalUrl: string;
/**
* The path attribute of the cookie.
*/
path: string;
/**
* The secure attribute of the cookie.
*/
secure: boolean;
/**
* The value of the cookie.
*/
value: string;
/**
* The version of the cookie specification to which this cookie conforms.
*/
version: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Returns true if the cookie is valid.
*/
isValid(): boolean;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* HTTP client object that (mostly) implements the XMLHttpRequest specification.
*/
class HTTPClient extends Titanium.Proxy {
/**
* Ready state constant indicating that the request is complete.
*/
readonly DONE: number;
/**
* Ready state constant indicating that response headers have been received.
*/
readonly HEADERS_RECEIVED: number;
/**
* Ready state constant indicating that response data is being received from the remote server.
*/
readonly LOADING: number;
/**
* Ready state constant indicating that the connection has been opened, but the request has
* not yet been sent.
*/
readonly OPENED: number;
/**
* Ready state constant indicating that HTTPClient request has not been opened or sent.
*/
readonly UNSENT: number;
/**
* All of the response headers.
*/
readonly allResponseHeaders: string;
/**
* Determines whether automatic encoding is enabled for the specified URL.
*/
autoEncodeUrl: boolean;
/**
* Determines whether automatic automatic handling of HTTP redirects is enabled.
*/
autoRedirect: boolean;
/**
* Determines whether HTTP responses are cached.
*/
cache: boolean;
/**
* Indicates whether the response was successful.
*/
readonly connected: boolean;
/**
* Connection type, normally either `GET`, `POST` or `PATCH`.
*/
readonly connectionType: string;
/**
* Sets the domain parameter for authentication credentials.
*/
domain: string;
/**
* Determines whether the client should attempt to keep a persistent connection.
*/
enableKeepAlive: boolean;
/**
* Target local file or file path to receive data.
*/
file: string | Titanium.Filesystem.File;
/**
* Absolute URL of the request.
*/
readonly location: string;
/**
* Function to be called at regular intervals as the request data is being received.
*/
ondatastream: (param0: any) => void;
/**
* Function to be called upon a error response.
*/
onerror: (param0: FailureResponse) => void;
/**
* Function to be called upon a successful response.
*/
onload: (param0: SuccessResponse) => void;
/**
* Function to be called for each [readyState](Titanium.Network.HTTPClient.readyState) change.
*/
onreadystatechange: (param0: any) => void;
/**
* Function to be called at regular intervals as the request data is being transmitted.
*/
onsendstream: (param0: any) => void;
/**
* Sets the password parameter for authentication credentials.
*/
password: string;
/**
* The current ready state of this HTTP request.
*/
readonly readyState: number;
/**
* Response data as a `Blob` object.
*/
readonly responseData: Titanium.Blob;
/**
* Response as JSON object.
*/
readonly responseDictionary: string;
/**
* Returns all the response headers returned with the request.
*/
readonly responseHeaders: any;
/**
* Response as text.
*/
readonly responseText: string;
/**
* Response object as an XML DOM Document object.
*/
readonly responseXML: Titanium.XML.Document;
/**
* The Security Manager for this client.
*/
securityManager: SecurityManagerProtocol;
/**
* Response HTTP status code.
*/
readonly status: number;
/**
* Human-readable status message associated with the status code.
*/
readonly statusText: string;
/**
* Timeout in milliseconds when the connection should be aborted.
*/
timeout: number;
/**
* The maximum amount of time (in milliseconds) that a resource request should be allowed to take.
*/
timeoutForResource: number;
/**
* Sets the TLS version to use for handshakes.
*/
tlsVersion: number;
/**
* Sets the username parameter for authentication credentials.
*/
username: string;
/**
* Determines how SSL certification validation is performed on connection.
*/
validatesSecureCertificate: boolean;
/**
* A Boolean value that indicates whether the session should wait for connectivity to become available, or fail immediately.
*/
waitsForConnectivity: boolean;
/**
* Cancels a pending request.
*/
abort(): void;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Clears any cookies stored for the host.
*/
clearCookies(host: string): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* All of the response headers.
*/
getAllResponseHeaders(): string;
/**
* Returns the value of the specified response header.
*/
getResponseHeader(name: string): string;
/**
* Opens the request and prepares the connection.
*/
open(method: string, url: string, async?: boolean): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Sends the request.
*/
send(data?: any): void;
/**
* Sets the value for the specified request header. Must be called after `open` but before `send`.
*/
setRequestHeader(name: string, value: string): void;
/**
* Sets the request timeout.
* @deprecated Use the property instead.
*/
setTimeout: never;
}
/**
* Socket module, used for creating sockets.
*/
class Socket extends Titanium.Module {
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: boolean;
/**
* The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
*/
static lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Applies the properties to the proxy.
*/
static applyProperties(props: any): void;
/**
* Returns a new TCP socket object.
*/
static createTCP(params?: Dictionary): Titanium.Network.Socket.TCP;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* The TCPSocket instance returned from . This object
* represents a socket which either listens locally on the device for connections,
* or connects to a remote machine.
* @deprecated Use [Titanium.Network.Socket.TCP](Titanium.Network.Socket.TCP) where possible.
*/
const TCPSocket: never;
}
/**
* The top-level Platform module. The Platform module is used to access the device's platform-related
* functionality.
*/
namespace Platform {
/**
* Constant to indicate that the system is plugged in and currently being charged.
*/
const BATTERY_STATE_CHARGING: number;
/**
* Constant to indicate that the battery is fully charged.
*/
const BATTERY_STATE_FULL: number;
/**
* Constant to indicate that the battery state is not known or monitoring is disabled.
*/
const BATTERY_STATE_UNKNOWN: number;
/**
* Constant to indicate that the system is unplugged.
*/
const BATTERY_STATE_UNPLUGGED: number;
/**
* The Android-specific Platform module, used to access the device's platform-related functionality.
*/
class Android extends Titanium.Module {
/**
* Android API level identifier of the Operating System.
*/
static readonly API_LEVEL: number;
/**
* Constant to indicate that the physical size category of the current device/emulator is large
*/
static readonly PHYSICAL_SIZE_CATEGORY_LARGE: number;
/**
* Constant to indicate that the physical size category of the current device/emulator is normal
*/
static readonly PHYSICAL_SIZE_CATEGORY_NORMAL: number;
/**
* Constant to indicate that the physical size category of the current device/emulator is small
*/
static readonly PHYSICAL_SIZE_CATEGORY_SMALL: number;
/**
* Constant to indicate that the physical size category of the current device/emulator is undefined
*/
static readonly PHYSICAL_SIZE_CATEGORY_UNDEFINED: number;
/**
* Constant to indicate that the physical size category of the current device/emulator is extra large
*/
static readonly PHYSICAL_SIZE_CATEGORY_XLARGE: number;
/**
* The name of the API that this proxy corresponds to.
*/
static readonly apiName: string;
/**
* Indicates if the proxy will bubble an event to its parent.
*/
static bubbleParent: boolean;
/**
* The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.
*/
static lifecycleContainer: Titanium.UI.Window | Titanium.UI.TabGroup;
/**
* The physical size category of the Android device or emulator.
*/
static readonly physicalSizeCategory: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
static addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Applies the properties to the proxy.
*/
static applyProperties(props: any): void;
/**
* Fires a synthesized event to any registered listeners.
*/
static fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
static removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
/**
* The Display Caps object returned by the property.
*/
interface DisplayCaps extends Titanium.Proxy {
/**
* Logical density of the display.
*/
readonly density: string;
/**
* Display density expressed as dots-per-inch.
*/
readonly dpi: number;
/**
* Logical density of the display, as a scaling factor for the Density Independent Pixel (dip)
* unit.
*/
readonly logicalDensityFactor: number;
/**
* Absolute height of the display in relation to UI orientation. Measured in platform-specific
* units; pixels on Android and density-independent pixels (dip) on iOS.
*/
readonly platformHeight: number;
/**
* Absolute width of the display in relation to UI orientation. Measured in platform-specific
* units; pixels on Android and density-independent pixels (dip) on iOS.
*/
readonly platformWidth: number;
/**
* Physical pixels per inch of the display in the X dimension.
*/
readonly xdpi: number;
/**
* Physical pixels per inch of the display in the Y dimension.
*/
readonly ydpi: number;
/**
* Adds the specified callback as an event listener for the named event.
*/
addEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
/**
* Fires a synthesized event to any registered listeners.
*/
fireEvent(name: string, event?: any): void;
/**
* Removes the specified callback as an event listener for the named event.
*/
removeEventListener(name: string, callback: (param0: Titanium.Event) => void): void;
}
}
/**
* The main module.
*/
namespace UI {
/**
* Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts
* slowly and speeds up.
*/
const ANIMATION_CURVE_EASE_IN: number;
/**
* Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts
* slowly, and speeds up, then slows down at the end of the animation.
*/
const ANIMATION_CURVE_EASE_IN_OUT: number;
/**
* Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that starts
* quickly, then slows down at the end of the animation.
*/
const ANIMATION_CURVE_EASE_OUT: number;
/**
* Use with [Animation.curve](Titanium.UI.Animation.curve) to specify an animation that proceeds
* at a constant rate.
*/
const ANIMATION_CURVE_LINEAR: number;
/**
* Use with to specify a background color.
*/
const ATTRIBUTE_BACKGROUND_COLOR: number;
/**
* Use with to apply a different baseline to the text.
*/
const ATTRIBUTE_BASELINE_OFFSET: number;
/**
* Use with to stretch the text horizontally.
*/
const ATTRIBUTE_EXPANSION: number;
/**
* Use with to specify a font.
*/
const ATTRIBUTE_FONT: number;
/**
* Use with to specify a font color.
*/
const ATTRIBUTE_FOREGROUND_COLOR: number;
/**
* Use with to specify kerning (space between characters).
*/
const ATTRIBUTE_KERN: number;
/**
* Use with to use a letterpress text effect.
*/
const ATTRIBUTE_LETTERPRESS_STYLE: number;
/**
* Use with to enable or disable ligatures.
*/
const ATTRIBUTE_LIGATURE: number;
/**
* Use with to wrap and truncate the text.
* @deprecated Use [ParagraphAttribute.lineBreakMode](ParagraphAttribute.lineBreakMode) instead.
*/
const ATTRIBUTE_LINE_BREAK: number;
/**
* Use with to wrap words at word boundaries.
*/
const ATTRIBUTE_LINE_BREAK_BY_CHAR_WRAPPING: number;
/**
* Use with to set lines to not draw past the edge of the text container.
*/
const ATTRIBUTE_LINE_BREAK_BY_CLIPPING: number;
/**
* Use with to use ellipsis glyph at the beginning of the line for missing text.
*/
const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_HEAD: number;
/**
* Use with to use ellipsis glyph at the middle of the line for missing text.
*/
const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_MIDDLE: number;
/**
* Use with to use ellipsis glyph at the end of the line for missing text.
*/
const ATTRIBUTE_LINE_BREAK_BY_TRUNCATING_TAIL: number;
/**
* Use with to wrap words at word boundaries.
*/
const ATTRIBUTE_LINE_BREAK_BY_WORD_WRAPPING: number;
/**
* Use with to create a link.
*/
const ATTRIBUTE_LINK: number;
/**
* Use with to skew the text.
*/
const ATTRIBUTE_OBLIQUENESS: number;
/**
* Use with to manages the behaviour of string set.
*/
const ATTRIBUTE_PARAGRAPH_STYLE: number;
/**
* Use with to display a shadow behind the text.
*/
const ATTRIBUTE_SHADOW: number;
/**
* Use with to change the color of the horizontal line.
*/
const ATTRIBUTE_STRIKETHROUGH_COLOR: number;
/**
* Use with to place a horizontal line through the text.
*/
const ATTRIBUTE_STRIKETHROUGH_STYLE: number;
/**
* Use with to specify a color for the stroke text.
*/
const ATTRIBUTE_STROKE_COLOR: number;
/**
* Use with to specify the width of the stroke text.
*/
const ATTRIBUTE_STROKE_WIDTH: number;
/**
* Use with to place the text in a lower position.
*/
const ATTRIBUTE_SUBSCRIPT_STYLE: number;
/**
* Use with to place the text in an upper position.
*/
const ATTRIBUTE_SUPERSCRIPT_STYLE: number;
/**
* Use with to apply a text effect.
*/
const ATTRIBUTE_TEXT_EFFECT: number;
/**
* Use with to place a horizontal line under the text.
*/
const ATTRIBUTE_UNDERLINES_STYLE: number;
/**
* Use with to draw a line only underneath or through words.
*/
const ATTRIBUTE_UNDERLINE_BY_WORD: number;
/**
* Use with to change the color of the horizontal line.
*/
const ATTRIBUTE_UNDERLINE_COLOR: number;
/**
* Use with to draw a dashed line.
*/
const ATTRIBUTE_UNDERLINE_PATTERN_DASH: number;
/**
* Use with to draw an alternating line of dashes and dots.
*/
const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT: number;
/**
* Use with to draw an alternating line of dashes and two dots.
*/
const ATTRIBUTE_UNDERLINE_PATTERN_DASH_DOT_DOT: number;
/**
* Use with