UNPKG

@types/tizen-common-web

Version:
1,223 lines (1,222 loc) 675 kB
/** * The AccountInit dictionary represents options for creating accounts. * Attributes are not mandatory, and can be added and modified by accessing the * properties of account after the account is created. */ export interface AccountInit { iconUri?: string | undefined; userName?: string | undefined; } /** * This interface represents filter for defining period of time, which will be used as a condition in _getAppsUsageInfo_ method. * * The maximum retention period is 90 days. * * @since 4.0 */ export interface ApplicationUsageFilter { /** * The attribute to store the date, which is used as an upper bound for selecting data. * * If only _endTime_ attribute is given, data will be accumulated from 90 days ago to _endTime_ date. */ endTime?: Date | null | undefined; /** * The attribute to store the date, which is used as a lower bound for selecting data. * * If only _startTime_ attribute is given, by default _endTime_ is equal to the current date. * If _startTime_ date predates the 90 days from the current time, data will be accumulated from last 90 days. */ startTime?: Date | null | undefined; /** * The attribute to store period of time, from which data is accumulated, in days. * The period of time begins _timeSpan_ days ago and ends with current date. * * If the attribute is given, the attributes _startTime_ and _endTime_ of this interface are not taken into an account. * If _timeSpan_ is greater than 90, 90 will be used instead. */ timeSpan?: number | null | undefined; } /** * The ArchiveFileEntryOptions dictionary controls behavior when adding a file to an archive. */ export interface ArchiveFileEntryOptions { /** * Compression level. * * @remark The default compression level is NORMAL. */ compressionLevel?: ArchiveCompressionLevel | undefined; /** * Path where _ArchiveFileEntry_ should be stored in an archive file. * * @remark If destination is not set, then the root directory of archive will be used (equivalent to destination = ""). */ destination?: string | undefined; /** * Controls whether leading directory information is stripped from the source file name before storing. * * The virtual root is always removed. * To omit all the remaining directory names, set _stripSourceDirectory_ to true. * * \* Target file name when _destination_ is "mypackage" * * | Source file name |stripSourceDirectory: true|stripSourceDirectory: false| * | ----- | ----- | ----- | * |documents/tizen/archive/example/test.js |mypackage/test.js |mypackage/tizen/archive/example/test.js | * |wgt-private/test/js/main.js |mypackage/main.js |mypackage/test/js/main.js | * |downloads/test.c |mypackage/test.c |mypackage/test.c | * * @remark The default value is false. */ stripSourceDirectory?: boolean | undefined; } /** * The ArchiveFileOptions dictionary represents the option to decide if an archive file can be overwritten when an archive file is opened. */ export interface ArchiveFileOptions { /** * Indicates whether opening an archive file for writing can overwrite the contents of the existing file. * * * true - The archive file is overwritten if an archive file with a same name exists in the same location. The previous contents are lost. * * false - The archive file is not overwritten if an archive file with a same name exists in the same location. * * The default value is false * * See description of the _mode_ argument of the _open()_ method. */ overwrite?: boolean | undefined; } /** * The EventInfo dictionary identifies an event with information such as event name. If it is an user event, the broadasting application's identifier is also specified. * * System events do not require an application identifier to be specified. If one is specified, the event will be interpreted as an user event. * * @since 2.4 */ export interface EventInfo { /** * The unique identifier of the application which is broadcasting an event. * * An application can listen to events from other applications. However, it can only broadcast its own events. Therefore, when broadcasting an event, this dictionary member must be the identifier of the application which is broadcasting the event. * * System events do not require an application identifier to be specified. If one is specified, the event will be interpreted as an user event. */ appId?: ApplicationId | undefined; /** * Name which describes the event. * * Must only contain the ASCII characters "\[A-Z\]\[a-z\]\[0-9\]\_" and may not begin with a digit. * Must be at least 1 byte in length and not exceed the maximum name length of 127 bytes. */ name?: string | undefined; } /** * Dictionary for specifying _ExifInformation_ attributes upon _ExifInformation_ creation. * * This dictionary is used to input parameters when _ExifInformation_ is created. * For description of attributes please see the corresponding attributes in the _ExifInformation_ interface. */ export interface ExifInit { deviceMaker?: string | undefined; deviceModel?: string | undefined; exposureProgram?: ExposureProgram | undefined; exposureTime?: string | undefined; fNumber?: number | undefined; flash?: boolean | undefined; focalLength?: number | undefined; gpsAltitude?: number | undefined; gpsLocation?: SimpleCoordinates | undefined; gpsProcessingMethod?: string | undefined; gpsTime?: Date | undefined; height?: number | undefined; isoSpeedRatings?: number[] | undefined; orientation?: ImageContentOrientation | undefined; originalTime?: Date | undefined; uri?: string | undefined; userComment?: string | undefined; whiteBalance?: WhiteBalanceMode | undefined; width?: number | undefined; } /** * The dictionary that defines attributes to filter the items returned by the [listDirectory()](#FileSystemManager::listDirectory) method (or deprecated [listFiles()](#File::listFiles)). * When this dictionary is passed to a method, the result-set of the method will only contain file item entries that match * the attribute values of the filter. * * A file item only matches the _FileFilter_ object if all of the defined filter's attribute values match all of the file item's attributes * (only matching values other than undefined or null). This is similar to a SQL's "AND" operation. * * An attribute of the file entry matches the _FileFilter_ attribute value in accordance with the * following rules: * * * For _FileFilter_ attributes of type DOMString, an entry matches this value only if its corresponding attribute is an exact match. If the filter contains U+0025 "PERCENT SIGN" it is interpreted as a wildcard character and "%" matches any string of any length, including no length. If wildcards are used, the behavior is similar to the LIKE condition in SQL. To specify that a "PERCENT SIGN" character is to be considered literally instead of interpreting it as a wildcard, developers can escape it with the backslash character (\\\\). Please, remember that the backslash character has to be escaped itself, to not to be removed from the string - proper escaping of the "PERCENT SIGN" in JavaScript string requires preceding it with double backslash ("\\\\\\\\%"). * The matching is not case sensitive, such as "FOO" matches a "foo" or an "f%" filter. * * For File entry attributes of type Date, attributes start and end are included to allow filtering of File entries between two supplied dates. If either or both of these attributes are specified, the following rules apply: * A) If both start and end dates are specified (that is, other than null), a File entry matches the filter if its corresponding attribute is the same as either start or end or between the two supplied dates (that is, after start and before end). * B) If only the start attribute contains a value (other than null), a File entry matches the filter if its corresponding attribute is later than or equal to the start one. * C) If only the end date contains a value (other than null), a file matches the filter if its corresponding attribute is earlier than or equal to the end date. */ export interface FileFilter { /** * The File created attribute filter. * * Files with created date earlier than this attribute or equal to it match the filtering criteria. */ endCreated?: Date | undefined; /** * The File modified attribute filter. * * Files with modified date earlier than this attribute or equal to it match the filtering criteria. */ endModified?: Date | undefined; /** * If true match only directories, If false do not match directories. * May be undefined. * * @since 5.0 */ isDirectory?: boolean | undefined; /** * If true match only files. If false do not match files. * May be undefined. * * @since 5.0 */ isFile?: boolean | undefined; /** * The File name attribute filter. * * Files that have a name that corresponds with this attribute (either exactly or with the specified wildcards) match this filtering criteria. */ name?: string | undefined; /** * The File created attribute filter. * * Files with created date later than this attribute or equal to it match the filtering criteria. */ startCreated?: Date | undefined; /** * The File modified attribute filter. * * Files with modified date later than this attribute or equal to it match the filtering criteria. */ startModified?: Date | undefined; } /** * The KeyManagerAlias dictionary identifies items in the KeyManager. */ export interface KeyManagerAlias { /** * Flag indicating whether key is password-protected. This property is set only when returning object by * [getDataAliasList()](#KeyManager::getDataAliasList) method. * In other methods which use this dictionary, the value is ignored. * * Possible values: * * * true - data under the alias is password-protected, * * false - data under the alias is not password-protected. * * @since 5.5 */ isProtected?: boolean | undefined; /** * Name which describes the item. * * If this attribute contains any spaces, the spaces will be removed. Characters which are separated by spaces will be concatenated. */ name?: string | undefined; /** * Package ID of the application which saved the item into the KeyManager. */ packageId?: PackageId | undefined; } /** * The MediaControllerMetadataInit dictionary defines the properties of a MediaControllerMetadata to add in addItem method. * * See [MediaControllerMetadata](#MediaControllerMetadata) interface for more information about the members. * * @since 5.5 */ export interface MediaControllerMetadataInit { album?: string | undefined; artist?: string | undefined; author?: string | undefined; copyright?: string | undefined; date?: string | undefined; description?: string | undefined; duration?: string | undefined; episodeNumber?: number | undefined; episodeTitle?: string | undefined; genre?: string | undefined; picture?: string | undefined; resolutionHeight?: number | undefined; resolutionWidth?: number | undefined; seasonNumber?: number | undefined; seasonTitle?: string | undefined; title?: string | undefined; trackNum?: string | undefined; } /** * The dictionary that specifies the byte stream data item that is transferred. * * @since 3.0 */ export interface MessagePortByteStreamDataItem { key?: string | undefined; value?: ByteStreamDataItemValue | undefined; } /** * The dictionary that specifies the string data item that is transferred. * * @since 3.0 */ export interface MessagePortStringDataItem { key?: string | undefined; value?: StringDataItemValue | undefined; } /** * The Query dictionary provides a query. */ export interface Query { /** * The query filter consists of key and string data. */ filter?: any; /** * The resource interface specified as a filter for the resource. */ resourceInterface?: ResourceInterface | null | undefined; /** * The resource type specified as a filter for the resource. */ resourceType?: ResourceType | null | undefined; } /** * The ResourcePolicy dictionary specifies resource attributes upon resource creation. * * This dictionary is used to input parameters when resources are created. */ export interface ResourcePolicy { /** * Indicates resource initialized and activated. * * The default value is false */ isActive?: boolean | undefined; /** * Indicates resource that is allowed to be discovered. * * The default value is true */ isDiscoverable?: boolean | undefined; /** * When this value is set true, the resource is allowed to be discovered only if discovery request contains an explicit query string. * * The default value is false */ isExplicitDiscoverable?: boolean | undefined; /** * Indicates resource that is allowed to be observed. * * The default value is false */ isObservable?: boolean | undefined; /** * Indicates secure resource. * * The default value is false */ isSecure?: boolean | undefined; /** * Indicates resource which takes some delay to respond. * * The default value is false */ isSlow?: boolean | undefined; } /** * The dictionary represents RowData holding 1 row of SQL selection results from another application. */ export interface RowData { /** * An attribute to hold column names to select, update, and insert. */ columns?: string[] | undefined; /** * An attribute to hold values of columns to select, update, and insert. */ values?: string[] | undefined; } /** * An object containing the various options for fetching the properties requested. * * The highThreshold and lowThreshold values are only applicable to the following _SystemInfoPropertyId_. * * * SystemInfoBattery - level: _from 0 to 1_ * * SystemInfoCpu - load: _from 0 to 1_ * * SystemInfoDisplay - brightness: _from 0 to 1_ * * For other cases, it is ignored. */ export interface SystemInfoOptions { /** * An attribute to indicate that the _successCallback()_ method in the watch * * operation will be triggered only if the device property is a number and its value is greater than or equal to this number. * This attribute has no effect on the _get()_ method. */ highThreshold?: number | undefined; /** * An attribute to indicate that the _successCallback()_ method in the watch operation must be triggered only if the property is a number and its value is lower than or equal to this number. * * If both _highThreshold_ and _lowThreshold_ parameters are specified, the _successCallback()_ is triggered if and only if the property value is either lower than the value of _lowThreshold_ or higher than the value of _highThreshold_. * This attribute has no effect on the get method. */ lowThreshold?: number | undefined; /** * The number of milliseconds beyond which the operation must be interrupted. */ timeout?: number | undefined; } /** * The AccountChangeCallback interface defines callbacks for getting notified about account changes. */ export interface AccountChangeCallback { /** * Called when an account is added. * * @param account Added account information. */ onadded(account: Account): void; /** * Called when an account is removed. * * @param accountId ID of the removed account. */ onremoved(accountId: AccountId): void; /** * Called when an account is updated. * * @param account Updated account information. */ onupdated(account: Account): void; } /** * The ApplicationControlDataArrayReplyCallback callback specifies success callbacks that are invoked as a reply from the requested application control within the application control requester. * * This callback interface specifies two methods: * * * _onsuccess()_ - Invoked if the callee application calls _RequestedApplicationControl.replyResult()_. * * _onfailure()_ - Invoked if the callee application calls _RequestedApplicationControl.replyFailure()_. * * @since 2.0 */ export interface ApplicationControlDataArrayReplyCallback { /** * Called when the callee application calls _RequestedApplicationControl.replyFailure()_. */ onfailure(): void; /** * Called when the callee application calls _RequestedApplicationControl.replyResult()_. * * @param data An array of _ApplicationControlData_ objects. */ onsuccess(data?: ApplicationControlData[] | null): void; } /** * \* This callback interface specifies methods that are invoked when an application is installed, updated, or uninstalled. */ export interface ApplicationInformationEventCallback { /** * Called when an application is installed. * * @param info The information of the updated application. */ oninstalled(info: ApplicationInformation): void; /** * Called when an application is uninstalled. * * @param id The ID of the uninstalled application. */ onuninstalled(id: ApplicationId): void; /** * Called when an application is updated. * * @param info The information of the updated application. */ onupdated(info: ApplicationInformation): void; } /** * This interface specifies a set of methods that are invoked every time a content change occurs. * * @since 2.1 */ export interface ContentChangeCallback { /** * Called when content is added. * * @param content The content to add. */ oncontentadded(content: Content): void; /** * Called when a content directory is added. * * @since 2.4 * * @param contentDir The added content directory. */ oncontentdiradded(contentDir: ContentDirectory): void; /** * Called when a content directory is removed. * * @since 2.4 * * @param id The ID of removed content directory. */ oncontentdirremoved(id: ContentDirectoryId): void; /** * Called when a content directory is updated. * * @since 2.4 * * @param contentDir The content directory after the update operation. */ oncontentdirupdated(contentDir: ContentDirectory): void; /** * Called when content is removed. * * @param id The ID of removed content. */ oncontentremoved(id: ContentId): void; /** * Called when content is updated. * * @param content The content to update. */ oncontentupdated(content: Content): void; } /** * The DownloadCallback defines notification callbacks for a download state change or progress. */ export interface DownloadCallback { /** * Called when the download operation is canceled by the _cancel()_ method. * * @param downloadId The ID of the corresponding download operation. */ oncanceled(downloadId: number): void; /** * Called when the download operation is completed with the final full path or virtual path. * If the same file name already exists in the destination, it is changed according to the platform policy and delivered in this callback. * * @param downloadId The ID of the corresponding download operation. * @param path The final full path or virtual path for the downloaded file. */ oncompleted(downloadId: number, path: string): void; /** * Called when the download operation fails. * * @param downloadId The ID of the corresponding download operation. * @param error The reason for download failure. */ onfailed(downloadId: number, error: WebAPIError): void; /** * Called when the download operation is paused by the _pause()_ method. * * @param downloadId The ID of the corresponding download operation. */ onpaused(downloadId: number): void; /** * Called when a download is successful and it is called multiple times as the download progresses. * The interval between the _onprogress()_ callback is platform-dependent. When the download is started, the _receivedSize_ can be 0. * * @param downloadId The ID of the corresponding download operation. * @param receivedSize The size of data received in bytes. * @param totalSize The total size of data to receive in bytes. */ onprogress(downloadId: number, receivedSize: number, totalSize: number): void; } /** * Interface for handling ability events. * @since 5.5 */ export interface MediaControllerAbilityChangeCallback { /** * Event triggered when server's display mode ability is updated. * * @param server Server which triggered the event. * @param abilities Object with current state of display mode abilities on the media controller server. */ ondisplaymodeabilitychanged( server: MediaControllerServerInfo, abilities: MediaControllerDisplayModeAbilitiesInfo, ): void; /** * Event triggered when server's display rotation is updated. * * @param server Server which triggered the event. * @param abilities Object with current state of display mode abilities on the media controller server. */ ondisplayrotationabilitychanged( server: MediaControllerServerInfo, abilities: MediaControllerDisplayRotationAbilitiesInfo, ): void; /** * Event triggered when server's playback ability is updated. * * @param server Server which triggered the event. * @param abilities Object with current state of playback abilities on the media controller server. */ onplaybackabilitychanged(server: MediaControllerServerInfo, abilities: MediaControllerPlaybackAbilitiesInfo): void; /** * Event triggered when server's simple ability is updated. * * @param server Server which triggered the event. * @param type Type of simple ability. * @param support Ability value which was set on the media controller server. */ onsimpleabilitychanged( server: MediaControllerServerInfo, type: MediaControllerSimpleAbility, support: MediaControllerAbilitySupport, ): void; } /** * The MediaControllerChangeRequestPlaybackInfoCallback interface that defines the listeners * object for receiving playback info change requests from client. */ export interface MediaControllerChangeRequestPlaybackInfoCallback { /** * Called when client request change of playback item. * * @since 5.5 * * @param playlistName Name of playlist. * @param index Index of the item to be changed. * @param state Playback state. * @param position Playback position. * @param clientName Id of client application, which sent a command. */ onplaybackitemrequest( playlistName: string, index: string, state: MediaControllerPlaybackState, position: number, clientName: ApplicationId, ): void; /** * Called when client requested playback position changes. * * @param position Requested playback position. * @param clientName Id of client application, which sent a command. * * @remark Parameter _clientName_ is passed since Tizen 5.5. */ onplaybackpositionrequest(position: number, clientName: ApplicationId): void; /** * Called when client requested playback state changes. * * @param state Requested playback state. * @param clientName Id of client application, which sent a command. * * @remark Parameter _clientName_ is passed since Tizen 5.5. */ onplaybackstaterequest(state: MediaControllerPlaybackState, clientName: ApplicationId): void; /** * Called when client requested repeat mode changes. * * @note _deprecated_ 5.5 Deprecated since 5.5. Instead, use [onrepeatstaterequest](#MediaControllerChangeRequestPlaybackInfoCallback::onrepeatstaterequest). * * @remark The [onrepeatmoderequest](#MediaControllerChangeRequestPlaybackInfoCallback::onrepeatmoderequest) callback * will not be invoked, if the [repeatState](#MediaControllerPlaybackInfo::repeatState) is requested to be changed to REPEAT\_ONE. * * @param mode Requested repeat mode. * @param clientName Client application id which sent command. * * @remark Parameter _clientName_ is passed since Tizen 5.5. */ onrepeatmoderequest(mode: boolean, clientName: ApplicationId): void; /** * Called when client requested change of repeat state. * * @since 5.5 * * @param state Requested repeat state. * @param clientName Id of client application, which sent a command. * * It is guaranteed that the [onrepeatstaterequest](#MediaControllerChangeRequestPlaybackInfoCallback::onrepeatstaterequest) callback * will be invoked after the [onrepeatmoderequest](#MediaControllerChangeRequestPlaybackInfoCallback::onrepeatmoderequest). */ onrepeatstaterequest(state: MediaControllerRepeatState, clientName: ApplicationId): void; /** * Called when client requested shuffle mode changes. * * @param mode Requested shuffle mode. * @param clientName Id of client application, which sent a command. * * @remark Parameter _clientName_ is passed since Tizen 5.5. */ onshufflemoderequest(mode: boolean, clientName: ApplicationId): void; } /** * The MediaControllerPlaybackInfoChangeCallback interface that defines the listeners * object for receiving media controller playback info changes from server. */ export interface MediaControllerPlaybackInfoChangeCallback { /** * Called when playback metadata is changed. * * @param metadata Current playback metadata. */ onmetadatachanged(metadata: MediaControllerMetadata): void; /** * Called when playback state or position is changed. * * @param state Current playback state. * @param position Current playback position. */ onplaybackchanged(state: MediaControllerPlaybackState, position: number): void; /** * Called when repeat mode is changed. * * @note _deprecated_ 5.5 Deprecated since 5.5. Instead, use [onrepeatstatechanged](#MediaControllerPlaybackInfoChangeCallback::onrepeatstatechanged). * * @param mode Current repeat mode. * * @remark The [onrepeatmodechanged](#MediaControllerPlaybackInfoChangeCallback::onrepeatmodechanged) callback * will not be invoked, if the [repeatState](#MediaControllerPlaybackInfo::repeatState) is changed to REPEAT\_ONE. */ onrepeatmodechanged(mode: boolean): void; /** * Called when repeat state is changed. * * It is guaranteed that the [onrepeatstatechanged](#MediaControllerPlaybackInfoChangeCallback::onrepeatstatechanged) callback * will be invoked after the [onrepeatmodechanged](#MediaControllerPlaybackInfoChangeCallback::onrepeatmodechanged). * * @since 5.5 * * @param state Current repeat state. */ onrepeatstatechanged(state: MediaControllerRepeatState): void; /** * Called when shuffle mode is changed. * * @param mode Current shuffle mode. */ onshufflemodechanged(mode: boolean): void; } /** * Interface for specific playlist update events (including deletion). * @since 5.5 */ export interface MediaControllerPlaylistUpdatedCallback { /** * Event triggered when playlist is removed from database. * * @param serverName Name of server which triggered the event. * @param playlistName Name of playlist for which the event was triggered. */ onplaylistdeleted(serverName: string, playlistName: string): void; /** * Event triggered when playlist is updated in database. * * @param serverName Name of server which triggered the event. * @param playlist Playlist for which event was triggered. */ onplaylistupdated(serverName: string, playlist: MediaControllerPlaylist): void; } /** * This callback interface specifies methods that are invoked when a package is installed, updated, or uninstalled. */ export interface PackageInformationEventCallback { /** * Called when a package is installed. * * @param info The information of the installed package. */ oninstalled(info: PackageInformation): void; /** * Called when a package is uninstalled. * * @param id The ID of the uninstalled package. */ onuninstalled(id: PackageId): void; /** * Called when a package is updated. * * @param info The information of the updated package. */ onupdated(info: PackageInformation): void; } /** * This callback interface specifies subscriptions for any notification on the progress or completion of requests. */ export interface PackageProgressCallback { /** * Called when the request is completed. * * @param id The package ID. */ oncomplete(id: PackageId): void; /** * Called while the request is in progress. * * @param id The package ID. * @param progress The progress in percentage. */ onprogress(id: PackageId, progress: number): void; } /** * The RequestCallback interface that defines the success method to be invoked when a client request is received. * * @remark Example of using can be find at [setRequestListener](iotcon.html#Resource::setRequestListener) code example. */ export interface RequestCallback { /** * Called when DELETE request was received. * * @param request That is request from server side. */ ondelete(request: Request): void; /** * Called when GET request was received. * * @param request That is request from server side. */ onget(request: Request): void; /** * Called when OBSERVE request was received. * * @param request That is request from server side. * @param observeType The observation type of the request. * @param observeId The observation id of the request. */ onobserving(request: Request, observeType: ObserveType, observeId: number): void; /** * Called when POST request was received. * * @param request That is request from server side. */ onpost(request: Request): void; /** * Called when PUT request was received. * * @param request That is request from server side. */ onput(request: Request): void; } /** * This is a common interface used by different types of * object filters. * * Never use this base interface directly, instead use _AbstractFilter_ subtypes, * such as _AttributeFilter_, _AttributeRangeFilter_, and _CompositeFilter_. */ export class AbstractFilter { // tslint:disable-line:no-unnecessary-class constructor(); } /** * The Account interface is the interface for a single account. * The implementation should manage authentication, storing eventual user * credentials, presenting password dialogs, and so on. * * The information is hidden from web applications. */ export class Account { constructor(provider: AccountProvider, accountInitDict?: AccountInit | null); /** * Name, identifier or URI of the icon. * By default, this attribute is set to null. */ iconUri: string | null; /** * Identifier for the account. * By default, this attribute is set to null. */ readonly id: AccountId | null; /** * Reference to the provider. * There is one provider for each account. * A given provider can be referenced from many accounts. */ readonly provider: AccountProvider; /** * Account user name. * By default, this attribute is set to null. */ userName: string | null; /** * Gets the extended data for the account as an array, asynchronously. * Returns an empty array if there is no extended data. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.read * * @param successCallback Callback method that is invoked when an asynchronous call completes successfully. * @param errorCallback Callback method that is invoked when an error occurs. * @throws WebAPIException with error type TypeMismatchError, if any of the input parameter is not compatible with the expected type for that parameter. * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type NotFoundError, if account ID is null. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ getExtendedData(key: string): string; getExtendedData( successCallback: AccountExtendedDataArraySuccessCallback, errorCallback?: ErrorCallback | null, ): void; /** * Adds the specified key and value to the extended data. * * If the specified key already exists, the corresponding value is overwritten with the specified value. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.write * * @param key Key of the extended data. * @param value Value of the extended data. * * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type NotFoundError, if account ID is null. */ setExtendedData(key: string, value: string): void; } export interface AccountConstructor { prototype: Account; new(provider: AccountProvider, accountInitDict?: AccountInit | null): Account; } /** * The AccountExtendedData interface defines the extended data of an account. */ export interface AccountExtendedData { /** * Name (key) of the account extended data item. * * @since 2.3 */ readonly key: string; /** * Value of the account extended data item. */ readonly value: string; } /** * The AccountManager interface provides configuration functionality for * providers and accounts. */ export interface AccountManager { /** * Adds an account to the account database. * * If the account is added successfully, an accountId and provider are newly assigned when the function returns. * * This method can be used only by an account provider application. * If the application is registered as provider, it will be launched to authenticate the account. * You should implement the appcontrol for the account provider. * For more details, see * [Account Provider](/application/web/guides/personal/account#retrieving-providers) * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.write * * @param account Account object to be added. * @throws WebAPIException with error type TypeMismatchError, if any of the input parameter is not compatible with the expected type for that parameter. * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ add(account: Account): void; /** * Adds an account listener for watching changes to accounts. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.read * * @param callback Callback method that is invoked for the events about accounts such as adding or removing an account. * @returns Identifier to clear the watch subscription for account changes. * * @throws WebAPIException with error type TypeMismatchError, if any of the input parameter is not compatible with the expected type for that parameter. * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ addAccountListener(callback: AccountChangeCallback): number; /** * Gets the Account object with the given identifier. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.read * * @param accountId Account identifier. * @returns Object with the given identifier or null. * * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ getAccount(accountId: AccountId): Account | null; /** * Gets the accounts associated with the provider that has a specified applicationId, asynchronously. * If you want to get all accounts, omit the applicationId argument. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.read * * @param successCallback Callback method that is invoked when an asynchronous call completes successfully. * @param errorCallback Callback method that is invoked when an error occurs. * @param applicationId ApplicationId of the provider application. * * @throws WebAPIException with error type TypeMismatchError, if any of the input parameter is not compatible with the expected type for that parameter. * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ getAccounts( successCallback: AccountArraySuccessCallback, errorCallback?: ErrorCallback | null, applicationId?: string | null, ): void; /** * Gets the account provider with the given application identifier. * * You can register your application as an account provider by writing account related information in config.xml. * For more details, see * [Account Provider](/application/web/guides/personal/account#retrieving-providers) * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.read * * @param applicationId Identifier of the account provider application. * @returns Object with the given applicationId or null. * * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ getProvider(applicationId: ApplicationId): AccountProvider | null; /** * Gets the providers with the given capabilities, asynchronously. * If you want to get all the providers, omit the capability argument. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.read * * @param successCallback Callback method that is invoked when an asynchronous call completes successfully. * @param errorCallback Callback method that is invoked when an error occurs. * @param capability Predefined capability or the vendor-specific capability in IRI format. * * @throws WebAPIException with error type TypeMismatchError, if any of the input parameter is not compatible with the expected type for that parameter. * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ getProviders( successCallback: AccountProviderArraySuccessCallback, errorCallback?: ErrorCallback | null, capability?: string | null, ): void; /** * Removes an account from the account database. * * Removes the account in the database that corresponds to the specified identifier. * The function will throw an exception if it failed to remove the specified account. * * This method can be used by an account provider application. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.write * * @param accountId Identifier of the account to remove. * * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ remove(accountId: AccountId): void; /** * Removes the previously registered listener. * * Calling this function has no effect if there is no listener with given id. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.read * * @param accountListenerId Identifier of the listener for the account changes. * * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ removeAccountListener(accountListenerId: number): void; /** * Updates an account. * * This method can be used only an account provider application. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/account.write * * @param account Account object to update. * @throws WebAPIException with error type TypeMismatchError, if any of the input parameter is not compatible with the expected type for that parameter. * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ update(account: Account): void; } /** * The AccountProvider interface represents a service provider, such as Google, Yahoo or Vodafone. */ export interface AccountProvider { /** * Identifier of the account provider application. */ readonly applicationId: ApplicationId; /** * Capabilities of the account provider defined in IRI format. * * The following predefined capabilities can be used. * * * http://tizen.org/account/capability/contact - Used when the account is related to contacts * * http://tizen.org/account/capability/calendar - Used when the account is related to calendar */ readonly capabilities: readonly string[]; /** * Logical (translatable) display name. */ readonly displayName: string; /** * Path to the icon representing the account provider. */ readonly iconUri: string; /** * Boolean value that indicates whether multiple accounts are supported. */ readonly isMultipleAccountSupported: boolean; /** * Path to the small icon representing the account provider. */ readonly smallIconUri: string; } /** * The Alarm interface is an abstract interface for alarm types. */ export class Alarm { constructor(); /** * The alarm identifier. */ readonly id: AlarmId | null; } export interface AlarmConstructor { prototype: Alarm; new(): Alarm; } /** * The AlarmAbsolute interface provides an absolute alarm, which triggers at a specified absolute date. * * If a _period_ is provided, the alarm keeps triggering for the given interval. If the _daysOfTheWeek_ array is not empty, the alarm triggers every week, for the given days, at the time defined by the _date_ attribute. */ export class AlarmAbsolute extends Alarm { constructor(date: Date); // tslint:disable-line:unified-signatures constructor(date: Date, daysOfTheWeek: ByDayValue[]); // tslint:disable-line:unified-signatures constructor(date: Date, period: number); // tslint:disable-line:unified-signatures /** * An attribute to store the absolute date/time when the alarm is initially triggered. * * This attribute is precise to the second. Milliseconds will be ignored. */ readonly date: Date; /** * An attribute to store the days of the week associated with the recurrence rule. * * By default, this attribute is set to an empty array. * The _period_ and _daysOfTheWeek_ attributes are mutually exclusive. */ readonly daysOfTheWeek: readonly ByDayValue[]; /** * An attribute to store the duration in seconds between each trigger of the alarm. * * By default, this attribute is set to null, indicating that this alarm does not repeat. * The _period_ and _daysOfTheWeek_ attributes are mutually exclusive. * @note _deprecated_ 4.0 Since Tizen 4.0 constructor AlarmAbsolute(Date date, long period) is deprecated, thus this attribute should not be used. */ readonly period: number | null; /** * Returns the date / time of the next alarm trigger. * * If the alarm has expired, this method returns null. The returned date is precise to the second. * * @returns The date/time of the next alarm trigger. * * @throws WebAPIException with error type UnknownError, if the method cannot be completed because of an unknown error. */ getNextScheduledDate(): Date | null; } export interface AlarmAbsoluteConstructor { prototype: AlarmAbsolute; new(date: Date): AlarmAbsolute; // tslint:disable-line:unified-signatures new(date: Date, daysOfTheWeek: ByDayValue[]): AlarmAbsolute; // tslint:disable-line:unified-signatures new(date: Date, period: number): AlarmAbsolute; // tslint:disable-line:unified-signatures } /** * The AlarmManager interface provides methods to manage alarms. */ export interface AlarmManager { /** * Adds an alarm to the storage. * * Sets an alarm with the application ID to be run. You should definitely provide the application ID to run * and the [application control](/application/web/guides/app-management/app-controls#application-control-request) information if it is necessary. * For more information about the application control, see [The Application API](application.html). * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/alarm * * @param alarm An alarm to add. It can be either _AlarmRelative_ or _AlarmAbsolute_. * @param applicationId The application ID to run when the alarm is triggered. * @param appControl The data structure describing application control details. * * @throws WebAPIException with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter. * @throws WebAPIException with error type InvalidValuesError, if any input parameter does not contain a valid value. * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if any other error occurs. */ add(alarm: Alarm, applicationId: ApplicationId, appControl?: ApplicationControl | null): void; /** * Returns an alarm as per the specified identifier. * * @param id The alarm ID to retrieve. * * @returns An alarm object with the specified ID. * * @throws WebAPIException with error type NotFoundError, if this alarm identifier cannot be found in the storage. * @throws WebAPIException with error type InvalidValuesError, if any input parameter does not contain a valid value. * @throws WebAPIException with error type UnknownError, if the method cannot be completed because of an unknown error. */ get(id: AlarmId): Alarm; /** * Retrieves all alarms in an application storage. * * Alarms that have already been triggered are removed automatically from the storage. * * @returns All Alarm objects. * * @throws WebAPIException with error type UnknownError, if the method cannot be completed because of an unknown error. */ getAll(): readonly Alarm[]; /** * Removes an alarm from the storage. * * If an alarm goes off, it will be removed from the storage automatically. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/alarm * * @param id The ID of the alarm to remove. * * @throws WebAPIException with error type NotFoundError, if this alarm identifier cannot be found in the storage. * @throws WebAPIException with error type InvalidValuesError, if any input parameter does not contain a valid value. * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. * @throws WebAPIException with error type UnknownError, if the method cannot be completed because of an unknown error. */ remove(id: AlarmId): void; /** * Removes all alarms added by an application. * * Because each application has its own alarm storage, this method removes alarms only added by the calling application. * * @privilegeLevel public * @privilegeName http://tizen.org/privilege/alarm * * @throws WebAPIException with error type SecurityError, if the application does not have the privilege to call this method.