From d9cb54e3c93d8a73c1af616a9737e2cb0ba9c6c4 Mon Sep 17 00:00:00 2001 From: sejoong_de_jang Date: Wed, 16 Sep 2020 02:58:04 +0900 Subject: [PATCH] Add the 'tizen-tv-webapis' module (#45812) * Add the tizen-tv-webapis * Remove the comment in package.json * Add the files * Resolve the file names * Refine indendation with the prettier * Set tslint exception rule in each files * Convert the @deprecated tag to @note * Resolve the 'no-redundant-jsdoc-2' * Modify the package name and version * Modify the version * Remove the orinazation * Modify the npm package name * Register the npm-name: false rule * Remove the tab * Remove the useless package * Move files to the project root * Remove delcare in each files, replace to export * Change the npm path * Remove the 'npm-naming' rule --- types/tizen-tv-webapis/adinfo.d.ts | 50 + types/tizen-tv-webapis/appcommon.d.ts | 56 + types/tizen-tv-webapis/avinfo.d.ts | 57 + types/tizen-tv-webapis/avplay.d.ts | 839 ++++++ types/tizen-tv-webapis/avplaystore.d.ts | 14 + types/tizen-tv-webapis/billing.d.ts | 378 +++ types/tizen-tv-webapis/index.d.ts | 61 + types/tizen-tv-webapis/network.d.ts | 611 +++++ types/tizen-tv-webapis/productinfo.d.ts | 368 +++ types/tizen-tv-webapis/sso.d.ts | 125 + .../test/tizen-tv-webapis-tests.cjs.ts | 12 + .../test/tizen-tv-webapis-tests.global.ts | 11 + types/tizen-tv-webapis/tsconfig.json | 22 + types/tizen-tv-webapis/tslint.json | 7 + types/tizen-tv-webapis/tvinfo.d.ts | 2305 +++++++++++++++++ types/tizen-tv-webapis/webapis.d.ts | 248 ++ types/tizen-tv-webapis/widgetdata.d.ts | 68 + 17 files changed, 5232 insertions(+) create mode 100644 types/tizen-tv-webapis/adinfo.d.ts create mode 100644 types/tizen-tv-webapis/appcommon.d.ts create mode 100644 types/tizen-tv-webapis/avinfo.d.ts create mode 100644 types/tizen-tv-webapis/avplay.d.ts create mode 100644 types/tizen-tv-webapis/avplaystore.d.ts create mode 100644 types/tizen-tv-webapis/billing.d.ts create mode 100644 types/tizen-tv-webapis/index.d.ts create mode 100644 types/tizen-tv-webapis/network.d.ts create mode 100644 types/tizen-tv-webapis/productinfo.d.ts create mode 100644 types/tizen-tv-webapis/sso.d.ts create mode 100644 types/tizen-tv-webapis/test/tizen-tv-webapis-tests.cjs.ts create mode 100644 types/tizen-tv-webapis/test/tizen-tv-webapis-tests.global.ts create mode 100644 types/tizen-tv-webapis/tsconfig.json create mode 100644 types/tizen-tv-webapis/tslint.json create mode 100644 types/tizen-tv-webapis/tvinfo.d.ts create mode 100644 types/tizen-tv-webapis/webapis.d.ts create mode 100644 types/tizen-tv-webapis/widgetdata.d.ts diff --git a/types/tizen-tv-webapis/adinfo.d.ts b/types/tizen-tv-webapis/adinfo.d.ts new file mode 100644 index 0000000000..0bb7fff7ce --- /dev/null +++ b/types/tizen-tv-webapis/adinfo.d.ts @@ -0,0 +1,50 @@ +/** + * This module defines the identification information for advertising functionalities provided by the Tizen Samsung TV Product API. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/adinfo + * @since 2.4 + */ + +export interface AdInfoManager { + /** + * Retrieves the plugin version number. + * @returns Plugin version + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/adinfo + * @throw WebAPIException SecurityError + * @since 2.4 + */ + getVersion: () => string; + + /** + * TIFA is a randomized, non-persistent, and resettable Samsung Smart TV device identifier. + * The personal information collected for the purpose of providing advertisement is linked to TIFA (collectively "TIFA Information"). + * TIFA shall be collected and used only for the following purposes. Any other purpose is prohibited. + * - In-app advertisements + * - Installation of other applications through your in-app advertisement + * - Running another application (including apps already installed on the Samsung Smart TV), web browser or video player through your in-app advertisement. + * - Collecting the app usage data related to the in-app advertisement (e.g. in-app subscription, in-app contents purchasement, or etc.) for the purpose of analyzing in-app advertisement attribution. + * TIFA will be newly generated whenever user resets the TIFA, and you shall agree not to map any previous TIFA with the newly generated TIFA ("mapping" means tracking and identifying any previous TIFA with the newly generated TIFA). + * The encrypted protocol (e.g: https) shall be used when the TIFA is sent outside of the device. + * TIFA shall not be connected to personally-identifiable information or associated with any persistent device identifier (e.g. DUID, MAC address, etc). + * The collection and use of the TIFA Information shall be in compliance with all applicable privacy and data protection laws and regulations including getting prior consent from the user. + * @returns ID For Advertising + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/adinfo + * @throw WebAPIException SecurityError, InvalidStateError + * @since 2.4 + */ + getTIFA: () => string; + + /** + * Checks whether the device has limited ad tracking. + * @returns boolean value value to indicate whether limited ad tracking is set. + * true: Limit Ad Tracking + * false: Not Limit Ad Tracking + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/adinfo + * @throw WebAPIException SecurityError, InvalidStateError + * @since 2.4 + */ + isLATEnabled: () => boolean; +} diff --git a/types/tizen-tv-webapis/appcommon.d.ts b/types/tizen-tv-webapis/appcommon.d.ts new file mode 100644 index 0000000000..08076661b9 --- /dev/null +++ b/types/tizen-tv-webapis/appcommon.d.ts @@ -0,0 +1,56 @@ +/** + * This module defines the application information retrieval functionalities provided by the Tizen Samsung TV Product API. + * @since 2.3 + */ + +import { SuccessCallback, ErrorCallback } from './webapis'; +export interface AppCommonManager { + AppCommonScreenSaverState: { + /** + * Screensaver off + * @since 2.3 + */ + SCREEN_SAVER_OFF: 0; + /** + * Screensaver on + * @since 2.3 + */ + SCREEN_SAVER_ON: 1; + }; + /** + * Retrieves the plugin version number. + * @returns string Plugin version + * @since 2.3 + */ + getVersion(): string; + + /** + * Sets the screensaver. + * @param state Screensaver state + * @param onsuccess Callback method to invoke when the screensaver is set successfully + * @param onerror Callback method to invoke if an error occurs + * @throw WebAPIException `TypeMismatchError`, `InvalidValuesError` + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + setScreenSaver(state: AppCommonScreenSaverState, onsuccess?: SuccessCallback, onerror?: ErrorCallback): void; +} + +/** + * Defines constants for screensaver states. + * @since 2.3 + */ + +export enum AppCommonScreenSaverState { + /** + * Screensaver off + * @since 2.3 + */ + SCREEN_SAVER_OFF = 0, + + /** + * Screensaver on + * @since 2.3 + */ + SCREEN_SAVER_ON = 1, +} diff --git a/types/tizen-tv-webapis/avinfo.d.ts b/types/tizen-tv-webapis/avinfo.d.ts new file mode 100644 index 0000000000..ee6ffa638c --- /dev/null +++ b/types/tizen-tv-webapis/avinfo.d.ts @@ -0,0 +1,57 @@ +/** + * This interface defines the digital mode + * @since 2.3 + */ + +export enum AvInfoDigitalCompMode { + /** + * line mode + * @since 2.3 + */ + DOLBY_DIGITAL_COMP_MODE_LINE = 0, + /** + * rf mode + * @since 2.3 + */ + DOLBY_DIGITAL_COMP_MODE_RF = 1, +} + +export interface AVInfoManager { + AvInfoDigitalCompMode: { + /** + * line mode + * @since 2.3 + */ + DOLBY_DIGITAL_COMP_MODE_LINE: 0; + /** + * rf mode + * @since 2.3 + */ + DOLBY_DIGITAL_COMP_MODE_RF: 1; + }; + + /** + * This method get the plugin's version number. + * @returns string value of plugin's version + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getVersion: () => string; + + /** + * This method get dolby digital component mode. + * @returns AvInfoDigitalCompMode dolby digital component mode + * @throw WebAPIException NotSupportedError + * @since 2.3 + * @note `deprecated` 4.0 + */ + getDolbyDigitalCompMode: () => AvInfoDigitalCompMode; + + /** + * This method is to check whether the HDR is supported or not. + * @returns boolean. true is support, false is not support. + * @throw WebAPIException SecurityError + * @since 2.3 + */ + isHdrTvSupport: () => boolean; +} diff --git a/types/tizen-tv-webapis/avplay.d.ts b/types/tizen-tv-webapis/avplay.d.ts new file mode 100644 index 0000000000..c3a0176987 --- /dev/null +++ b/types/tizen-tv-webapis/avplay.d.ts @@ -0,0 +1,839 @@ +import { SuccessCallback, ErrorCallback } from './webapis'; +/** + * Specifies the player state. + * - `NONE`- Player is not created + * - `IDLE`- Player is created but not prepared + * - `READY`- Player is ready to play media + * - `PLAYING`- Player is playing media + * - `PAUSED`- Player is paused + * @since 2.3 + */ +export enum AVPlayPlayerState { + NONE = 'NONE', + IDLE = 'IDLE', + READY = 'READY', + PLAYING = 'PLAYING', + PAUSED = 'PAUSED', +} + +/** + * Specifies display modes. + * - `PLAYER_DISPLAY_MODE_LETTER_BOX`- Letterbox mode + * - `PLAYER_DISPLAY_MODE_FULL_SCREEN`- Full-screen mode + * - `PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO`- Screen mode based on video dar/par info + * @since 2.3 + */ +export enum AVPlayDisplayMode { + PLAYER_DISPLAY_MODE_LETTER_BOX = 'PLAYER_DISPLAY_MODE_LETTER_BOX', + PLAYER_DISPLAY_MODE_FULL_SCREEN = 'PLAYER_DISPLAY_MODE_FULL_SCREEN', + PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO = 'PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO', +} + +/** + * Specifies buffering scenarios. + * - `PLAYER_BUFFER_FOR_PLAY`- Initial buffering scenario + * - `PLAYER_BUFFER_FOR_RESUME`- Re-buffering which might be occured after initial buffering during the playback. + * The onbufferingcomplete event would be triggered when the PLAYER_BUFFER_FOR_PLAY amount of data is buffered. + * The actual buffering completion time may vary depending on the contents format, bitrate, network speed and so on. + * @since 2.3 + */ +export enum AVPlayBufferOption { + PLAYER_BUFFER_FOR_PLAY = 'PLAYER_BUFFER_FOR_PLAY', + PLAYER_BUFFER_FOR_RESUME = 'PLAYER_BUFFER_FOR_RESUME', +} + +/** + * Specifies buffer size units. + * - `PLAYER_BUFFER_SIZE_IN_SECOND`- Buffer size in seconds + * @since 2.3 + * @note "PLAYER_BUFFER_SIZE_IN_BYTE" property has been deprecated from Tizen version 5.0 + */ +export enum AVPlayBufferSizeUnit { + PLAYER_BUFFER_SIZE_IN_BYTE = 'PLAYER_BUFFER_SIZE_IN_BYTE', + PLAYER_BUFFER_SIZE_IN_SECOND = 'PLAYER_BUFFER_SIZE_IN_SECOND', +} + +/** + * Specifies parameters for various streaming protocols, such as HTTP, MMS, and adaptive streaming (Smooth Streaming, HLS, and MPEG-DASH). + * - `COOKIE`- : HTTP request cookie used to establish the session with the HTTP server. (for setStreamingProperty) + * - `USER_AGENT`- : HTTP user agent, used in the HTTP request header. (for setStreamingProperty) + * - `PREBUFFER_MODE`- : Property to initiate prebuffering mode. The second parameter indicates start-time for prebuffered content, in milliseconds. (for setStreamingProperty) + * - `ADAPTIVE_INFO`- : Sets a custom streaming URL with various streaming parameters, such as "BITRATES", "STARTBITRATE", or "SKIPBITRATE" (for setStreamingProperty) + * String containing custom attributes for adaptive streaming playback. + * "STARTBITRATE=" Valid values are "LOWEST", "HIGHEST", and "AVERAGE". You can also define a specific bandwidth for the start of playback. + * "BITRATES=" Use '~' to define a bandwidth range (5000 ~ 20000). You can also define a specific bandwidth for playback. + * "SKIPBITRATE=" Defines the bandwidth to use after a skip operation. + * "STARTFRAGMENT=" For live content playback, defines the start fragment number. + * "FIXED_MAX_RESOLUTION=max_widthXmax_height". Only if the given media URI such as mpd in MPEG-DASH or m3u8 in HLS through open() method doesn't describe entire required video resolutions, + * application should use this attribute to complete the resolution information for the player. + * - `LISTEN_SPARSE_TRACK`- : For the Smooth Streaming case, configures the player to listen for a "Sparse name" configured through "propertyParam" . The sparse track name is a string. (for setStreamingProperty) + * - `IS_LIVE`- : Whether the stream is LIVE or VOD. Applicable to all streaming types. (for getStreamingProperty) + * - `AVAILABLE_BITRATE`- : String listing the available bit-rates for the currently-playing stream. (for getStreamingProperty) + * - `GET_LIVE_DURATION`- : String describing the duration of live content. (for getStreamingProperty) + * - `CURRENT_BANDWIDTH`- : String describing the current streaming bandwidth. (for getStreamingProperty) + * - `USE_VIDEOMIXER`- : Property used for enabling/initializing video mixer feature on B2B product only( for setStreamingProperty). It should be set before setting SET_MIXEDFRAME property on the player. + * - `SET_MIXEDFRAME`- : Property to set the position of mixed frame( for setStreamingProperty). setDisplayRect with required position on corresponding player instance to be called before setting this property. + * - `PORTRAIT_MODE`- : Property to force the playback the video in potrait mode on B2B proudct only( for setStreamingProperty). + * @since 2.3 + * @note "GET_LIVE_DURATION" is available since Tizen version 2.4 + * @note "WIDEVINE" property has been deprecated from Tizen version 4.0 + * @note "PROPERTY_HD_AUDIO" property has been deprecated from Tizen version 2.4 + * @note "SET_VR360_MODE" property has been deprecated from Tizen version 5.0 + * @note "SET_MODE_4K" property has been deprecated from Tizen version 5.0. Property "ADAPTIVE_INFO" with attribute "FIXED_MAX_RESOLUTION=max_widthXmax_height" has been available since 5.0 as an alternative. + * @note "ADAPTIVE_INFO" with attribute "FIXED_MAX_RESOLUTION=max_widthXmax_height" is available since Tizen version 5.0 and API version 4.1 + */ +export enum AVPlayStreamingPropertyType { + COOKIE = 'COOKIE', + USER_AGENT = 'USER_AGENT', + PREBUFFER_MODE = 'PREBUFFER_MODE', + ADAPTIVE_INFO = 'ADAPTIVE_INFO', + SET_MODE_4K = 'SET_MODE_4K', + PROPERTY_HD_AUDIO = 'PROPERTY_HD_AUDIO', + LISTEN_SPARSE_TRACK = 'LISTEN_SPARSE_TRACK', + IS_LIVE = 'IS_LIVE', + AVAILABLE_BITRATE = 'AVAILABLE_BITRATE', + GET_LIVE_DURATION = 'GET_LIVE_DURATION', + CURRENT_BANDWIDTH = 'CURRENT_BANDWIDTH', + WIDEVINE = 'WIDEVINE', + SET_VR360_MODE = 'SET_VR360_MODE', + USE_VIDEOMIXER = 'USE_VIDEOMIXER', + SET_MIXEDFRAME = 'SET_MIXEDFRAME', + PORTRAIT_MODE = 'PORTRAIT_MODE', +} + +/** + * Specifies DRM systems supported by the player. + * - `PLAYREADY`- PlayReady + * - `EME_PLAYREADY`- PlayReady CDM (supported since Tizen 5.0) + * - `VERIMATRIX`- Verimatrix + * - `WIDEVINE_CDM`- Widevine Modular + * - `EME_WIDEVINE_CDM`- Widevine Modular (supported since Tizen 5.0) + * @since 2.3 + */ +export enum AVPlayDrmType { + PLAYREADY = 'PLAYREADY', + EME_PLAYREADY = 'EME_PLAYREADY', + VERIMATRIX = 'VERIMATRIX', + WIDEVINE_CDM = 'WIDEVINE_CDM', + EME_WIDEVINE_CDM = 'EME_WIDEVINE_CDM', +} + +/** + * Specifies various DRM operations. + * - `SetProperties`- : Sets DRM instance properties and initialize the DRM instance for PlayReady, Verimatrix, and Widevine CDM. + * - `InstallLicense`- : Base64-encoded license data for PlayReady. An application shall retrieve license data using challenge data received in ondrmevent() callback. + * - `ProcessInitiator`- : initialize the PlayReady DRM instance + * - `widevine_license_data`- : Base64-encoded license data with given session id for Widevine CDM. An application shall retrieve license data using challenge data received in ondrmevent() callback. + * @since 2.3 + * @note 'GetUID' operation has been deprecated from Tizen version 5.0, rather application should use getUID() API. + * @note 'Initialize' and 'Finalize' operations have been deprecated from Tizen version 5.0. Because these are being executed by avplay itself. + * @note 'widevine_app_session' and 'widevine_data_type' operations have been deprecated from Tizen version 5.0. Because these are merged into "SetProperties". Please refer to setDrm() example. + */ +export enum AVPlayDrmOperation { + 'SetProperties' = 'SetProperties', + 'InstallLicense' = 'InstallLicense', + 'ProcessInitiator' = 'ProcessInitiator', + 'GetUID' = 'GetUID', + 'Initialize' = 'Initialize', + 'Finalize' = 'Finalize', + 'widevine_license_data' = 'widevine_license_data', + 'widevine_app_session' = 'widevine_app_session', + 'widevine_data_type' = 'widevine_data_type', +} + +/** + * Specifies stream types supported by the player. + * - `VIDEO`- Video track + * - `AUDIO`- Audio track + * - `TEXT`- Subtitle track + * @since 2.3 + */ +export enum AVPlayStreamType { + VIDEO = 'VIDEO', + AUDIO = 'AUDIO', + TEXT = 'TEXT', +} + +/** + * Specifies the player error messages. + * - `PLAYER_ERROR_NONE`- Operation has successfully completed; no error. + * - `PLAYER_ERROR_INVALID_PARAMETER`- Unable to find the parameter + * - `PLAYER_ERROR_NO_SUCH_FILE`- Unable to find the specified media content + * - `PLAYER_ERROR_INVALID_OPERATION`- Invalid API Call at the moment + * - `PLAYER_ERROR_SEEK_FAILED`- Failed to perform seek operation, or seek operation called during an invalid state + * - `PLAYER_ERROR_INVALID_STATE`- AVPlay API method was called during an invalid state + * - `PLAYER_ERROR_NOT_SUPPORTED_FILE`- Multimedia file type not supported + * - `PLAYER_ERROR_NOT_SUPPORTED_FORMAT`- Multimedia file format not supported + * - `PLAYER_ERROR_INVALID_URI`- Input URI is in an invalid format + * - `PLAYER_ERROR_CONNECTION_FAILED`- Failed multiple attempts to connect to the specified content server + * - `PLAYER_ERROR_GENEREIC`- Failed to create the display window + * @since 2.3 + */ +export enum AVPlayError { + PLAYER_ERROR_NONE = 'PLAYER_ERROR_NONE', + PLAYER_ERROR_INVALID_PARAMETER = 'PLAYER_ERROR_INVALID_PARAMETER', + PLAYER_ERROR_NO_SUCH_FILE = 'PLAYER_ERROR_NO_SUCH_FILE', + PLAYER_ERROR_INVALID_OPERATION = 'PLAYER_ERROR_INVALID_OPERATION', + PLAYER_ERROR_SEEK_FAILED = 'PLAYER_ERROR_SEEK_FAILED', + PLAYER_ERROR_INVALID_STATE = 'PLAYER_ERROR_INVALID_STATE', + PLAYER_ERROR_NOT_SUPPORTED_FILE = 'PLAYER_ERROR_NOT_SUPPORTED_FILE', + PLAYER_ERROR_NOT_SUPPORTED_FORMAT = 'PLAYER_ERROR_NOT_SUPPORTED_FORMAT', + PLAYER_ERROR_INVALID_URI = 'PLAYER_ERROR_INVALID_URI', + PLAYER_ERROR_CONNECTION_FAILED = 'PLAYER_ERROR_CONNECTION_FAILED', + PLAYER_ERROR_GENEREIC = 'PLAYER_ERROR_GENEREIC', +} + +/** + * Specifies player events. + * - `PLAYER_MSG_NONE`- Notifies that a multimedia component message was not recognized by the player + * - `PLAYER_MSG_RESOLUTION_CHANGED`- During adaptive streaming playback, notifies that the video resolution has changed + * - `PLAYER_MSG_BITRATE_CHANGE`- During adaptive streaming playback, notifies of a change, based on network heuristics, in the bandwidth-specific URL. The current bandwidth value is also sent. + * - `PLAYER_SPARSE_TRACK_DETECT`- During adaptive streaming playback, notifies that a sparse track was encountered + * - `PLAYER_STREAMING_EVENT`- Posts required streaming data + * - `PLAYER_MSG_HTTP_ERROR_CODE`- Describes the detailed HTTP network situation information + * - `PLAYER_MSG_DRM_CHALLENGE_DATA`- For encrypted content playback, posts the DRM challenge data + * @since 2.3 + * @note 'PLAYER_MSG_FRAGMENT_INFO' event has been deprecated from Tizen version 2.4, because it affects the application performance. + */ +export enum AVPlayEvent { + PLAYER_MSG_NONE = 'PLAYER_MSG_NONE', + PLAYER_MSG_RESOLUTION_CHANGED = 'PLAYER_MSG_RESOLUTION_CHANGED', + PLAYER_MSG_BITRATE_CHANGE = 'PLAYER_MSG_BITRATE_CHANGE', + PLAYER_MSG_FRAGMENT_INFO = 'PLAYER_MSG_FRAGMENT_INFO', + PLAYER_SPARSE_TRACK_DETECT = 'PLAYER_SPARSE_TRACK_DETECT', + PLAYER_STREAMING_EVENT = 'PLAYER_STREAMING_EVENT', + PLAYER_MSG_HTTP_ERROR_CODE = 'PLAYER_MSG_HTTP_ERROR_CODE', + PLAYER_MSG_DRM_CHALLENGE_DATA = 'PLAYER_MSG_DRM_CHALLENGE_DATA', +} + +/** + * Defines a dictionary for streaming video, audio and subtitle information for various streaming scenarios. + * @param index unsigned long Index + * @param type Track type (audio, video, or text) + * @param extra_info string JSON string containing all media-related info (such as height, width, and fourCC for a video stream, and bitrate, fourCC, language, and codec type for an audio stream) + * @since 2.3 + */ +export type AVPlayStreamInfo = { + index: number; + type: AVPlayStreamType | 'VIDEO' | 'AUDIO' | 'TEXT'; + extra_info: string; +}; + +/** + * Defines a dictionary for subtitle attributes. + * @param attr_type Attribute type string (json) + * @param start_pos Start position + * @param stop_pos Stop position + * @since 2.3 + */ +export type AVPlaySubtitleAttribute = { + attr_type: string; + start_pos: number; + stop_pos: number; +}; + +/** + * Defines callbacks for buffering and playback notifications. + * @since 2.3 + */ +export interface AVPlayPlaybackCallback { + /** + * Callback method for asynchronous buffering started notifications. + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + onbufferingstart?(): void; + + /** + * Callback method for asynchronous buffering progress notifications. + * @param percent unsigned long + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + onbufferingprogress?(percent: number): void; + + /** + * Callback method for asynchronous buffering complete notifications. + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + onbufferingcomplete?(): void; + + /** + * Callback method for the current playback time. + * @param currentTime unsigned long + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + oncurrentplaytime?(currentTime: number): void; + + /** + * Callback method for asynchronous playback finished notifications. + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + onstreamcompleted?(): void; + + /** + * Callback method for asynchronous event notifications. + * @param eventid AVPlayEvent object + * @param data DOMString + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + onevent?( + eventid: + | AVPlayEvent + | 'PLAYER_MSG_NONE' + | 'PLAYER_MSG_RESOLUTION_CHANGED' + | 'PLAYER_MSG_BITRATE_CHANGE' + | 'PLAYER_MSG_FRAGMENT_INFO' + | 'PLAYER_SPARSE_TRACK_DETECT' + | 'PLAYER_STREAMING_EVENT' + | 'PLAYER_MSG_HTTP_ERROR_CODE' + | 'PLAYER_MSG_DRM_CHALLENGE_DATA', + data: string, + ): void; + + /** + * Callback method for AVPlay error notifications. + * @param eventid AVPlayError object + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + onerror?( + eventid: + | AVPlayError + | 'PLAYER_ERROR_NONE' + | 'PLAYER_ERROR_INVALID_PARAMETER' + | 'PLAYER_ERROR_NO_SUCH_FILE' + | 'PLAYER_ERROR_INVALID_OPERATION' + | 'PLAYER_ERROR_SEEK_FAILED' + | 'PLAYER_ERROR_INVALID_STATE' + | 'PLAYER_ERROR_NOT_SUPPORTED_FILE' + | 'PLAYER_ERROR_NOT_SUPPORTED_FORMAT' + | 'PLAYER_ERROR_INVALID_URI' + | 'PLAYER_ERROR_CONNECTION_FAILED' + | 'PLAYER_ERROR_GENEREIC', + ): void; + + /** + * Callback method for DRM information notifications. + * @param type AVPlayDrmType object + * @param data drmData + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + ondrmevent?( + type: AVPlayDrmType | 'PLAYREADY' | 'EME_PLAYREADY' | 'VERIMATRIX' | 'WIDEVINE_CDM' | 'EME_WIDEVINE_CDM', + data: object, + ): void; + + /** + * Callback method for asynchronous subtitle change notifications. + * @param duration unsigned long + * @param subtitles DOMString + * @param type unsigned long + * @param attributes AVPlaySubtitleAttribute "attr_type": "AttributeType:value"; "start_pos": start position as long; "stop_pos": stop position as long + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + */ + onsubtitlechange?(duration: number, subtitles: string, type: number, attributes: AVPlaySubtitleAttribute): void; +} + +/** + * AVPlay Sound Analysis Callback + * @since 2.3 + * @note `deprecated` 2.4 + */ +export interface AVPlaySoundAnalysisCallback { + /** + * AVPlay Sound Analysis data array + * @since 2.3 + * @note `deprecated` 2.4 + */ + (data: number[]): void; +} + +/** + * This module defines the multimedia player functionalities provided by the Tizen Samsung TV Product API. + * @since 2.3 + */ +export interface AVPlayManager { + /** + * Instantiates the player object with a content URL as the input parameter. + * @param url Content URL for playback. It can be an absolute local path or a remote URL from a network-based stream server. + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "IDLE" + */ + open: (url: string) => void; + + /** + * Destroys the player object. + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "IDLE", "READY", "PLAYING", "PAUSED" + */ + close: () => void; + + /** + * Prepares the media player for playback synchronously. The player must already be created with a valid URI. + * @throw WebAPIException NotSupportedError, InvalidValuesError, InvalidAccessError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "IDLE", "READY" + */ + prepare: () => void; + + /** + * Prepares the media player for playback asynchronously. This method is preferred over prepare because it returns immediately and does not block the application thread during preparation. + * When preparation is successful, the success callback is returned and the player is in READY state. If preparation fails, the error callback returns the error value. + * When prepareAsync is used with "PREBUFFER_MODE", successCallback is invoked when prebuffering is complete, instead of when preparation is complete. + * @param successCallback Callback method to invoke when the call is successful + * @param errorCallback WebAPIError error type NotSupportedError, InvalidStateError, UnknownError + * with error type InvalidValuesError, if given URL through open() is invalid. e.g., webapis.avplay.open("InvalidURL"). + * with error type InvalidAccessError, if given URL through open() is valid, but not exist or Network Issue. e.g., webapis.avplay.open("http://abc"). + * @throw WebAPIException TypeMismatchError + * @since 2.3 + * @constraint Can be called in the following states: "IDLE", "READY" + */ + prepareAsync: (onsuccess?: SuccessCallback, onerror?: ErrorCallback) => void; + + /** + * Sets the display area for video content playback. + * The 4 parameters specify the left side, top, window width, and window height based on a 1920 x 1080 resolution screen, regardless of the actual application resolution. + * @param x Display area top-left X-coordinate. Must be less than the TV screen width. + * @param y Display area top-left Y-coordinate. Must be less than the TV screen height. + * @param width Display area width. Must be less than the TV screen width. + * @param height Display area height from source image. Must be less than the source image height. + * @throw WebAPIException with error type TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states:"IDLE", "READY", "PLAYING", "PAUSED" (when APP is using normal calling sequence , OPEN+setDisplay+PREPARE etc). + */ + setDisplayRect: (x: number, y: number, width: number, height: number) => void; + + /** + * Starts stream playback, or resumes stream playback after pause. + * @throw WebAPIException NotSupportedError, InvalidStateError, UnknownError + * @since 2.3 + * @note Adaptive streaming using TS container (for e.g. HLS) with audio sample rate changing across variants may cause audio loss. + * @constraint Can be called in the following states: "READY", "PLAYING", "PAUSED" + */ + play: () => void; + + /** + * Skips playback to a specific timestamp. + * For HTTP streaming, this method is successful even when the specified timestamp is invalid. The internal player automatically resets an out-of-range value to an in-range one. + * @param milliseconds Timestamp to skip to + * @param successCallback Callback method to invoke when the call is successful + * @param errorCallback Callback method to invoke when an error occurs + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "IDLE","READY", "PLAYING" (buffered data is flushed and buffering starts over), "PAUSED" + * During this async operation, the other API would not be allowed. So, the application needs to wait for one of both callbacks( SuccessCallback, errorCallback) before any other API call. + * For LIVE stream case, seek position must be within DVR range. DVR range could be retrieved using GET_LIVE_DURATION property in getStreamingProperty API. + */ + seekTo: (milliseconds: number, onsuccess?: SuccessCallback, onerror?: ErrorCallback) => void; + + /** + * Stops the player. Call this function after the video finishes playing. + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "IDLE", "READY", "PLAYING", "PAUSED" + */ + stop: () => void; + + /** + * Retrieves the current player state. + * @returns AVPlayPlayerState "NONE", "IDLE", "READY", "PLAYING", "PAUSED". + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "IDLE", "READY", "PLAYING", "PAUSED" + */ + getState: () => AVPlayPlayerState | 'NONE' | 'IDLE' | 'READY' | 'PLAYING' | 'PAUSED'; + + /** + * Pauses playback. If this method is called successfully, current time updates are stopped. + * @throw WebAPIException with error type NotSupportedError, InvalidStateError, InvalidAccessError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "PLAYING", "PAUSED" + */ + pause: () => void; + + /** + * Skips playback forward by a specific amount of time. The player state is unchanged. + * Passing the optional callbacks is recommended. For best performance, ensure that the previous call to this API was successful. + * For HTTP streaming, this method is successful even when the resulting timestamp is invalid. The internal player automatically resets an out-of-range value to an in-range one. + * @param milliseconds Time to skip forward, in milliseconds + * @param successCallback Callback method to invoke when the call is successful + * @param errorCallback Callback method to invoke when an error occurs + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "READY" (when using the synchronous prepare method), "PLAYING", "PAUSED" + * During this async operation, the other API would not be allowed. So, the application needs to wait for one of both callbacks( SuccessCallback, errorCallback) before any other API call. + */ + jumpForward: (milliseconds: number, onsuccess?: SuccessCallback, onerror?: ErrorCallback) => void; + + /** + * Skips playback backward by a specific amount of time. The player state is unchanged. + * For HTTP streaming, this method is successful even when the resulting timestamp is invalid. The internal player automatically resets an out-of-range value to an in-range one. + * @param milliseconds Time to skip backward, in milliseconds + * @param successCallback Callback method to invoke when the call is successful + * @param errorCallback Callback method to invoke when an error occurs + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "READY" (when using the synchronous prepare method), "PLAYING", "PAUSED" + * During this async operation, the other API would not be allowed. So, the application needs to wait for one of both callbacks( SuccessCallback, errorCallback) before any other API call. + */ + jumpBackward: (milliseconds: number, onsuccess?: SuccessCallback, onerror?: ErrorCallback) => void; + + /** + * Retrieves the total media duration. + * @returns unsigned long number Duration, in milliseconds + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states:"NONE", "IDLE", "READY", "PLAYING", "PAUSED" + */ + getDuration: () => number; + + /** + * Retrieves the current playback time. + * @returns unsigned long number Current playback time, in milliseconds. + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "IDLE", "READY", "PLAYING", "PAUSED" + */ + getCurrentTime: () => number; + + /** + * Sets the stream buffering timeout. When the specified amount of time has passed, the onbufferingcomplete callback is invoked, irrespective of buffering progress. + * If not set using this method, the default buffer size is 32MB or 10 seconds of playable data, and 20 seconds time-out. + * @param seconds Buffering timeout duration, in seconds. Depending on network conditions, 3 to 10 seconds is recommended. + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "IDLE", "READY", "PLAYING", "PAUSED" + */ + setTimeoutForBuffering: (seconds: number) => void; + + /** + * Sets the buffer size for the play and resume scenarios. The time buffer size must be at least 4 seconds. + * For example, if a 10 second buffer size is set, playback can only start or resume after 10 seconds of media has accumulated in the buffer. + * Play scenarios include user-initiated streaming playback and whenever media playback is starting for the first time. + * Resume scenarios include resuming playback after pause or seek operations, or when lack of data causes playback rebuffering. + * @param option "PLAYER_BUFFER_FOR_PLAY" or "PLAYER_BUFFER_FOR_RESUME" + * @param unit "PLAYER_BUFFER_SIZE_IN_SECOND" + * @param amount Data amount to be buffered, in seconds as specified by the unit parameter + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @note unit "PLAYER_BUFFER_SIZE_IN_BYTE" has been deprecated from Tizen version 5.0 + * @constraint Can be called in the following states: "IDLE" + */ + setBufferingParam: ( + option: AVPlayBufferOption | 'PLAYER_BUFFER_FOR_PLAY' | 'PLAYER_BUFFER_FOR_RESUME', + unit: AVPlayBufferSizeUnit | 'PLAYER_BUFFER_SIZE_IN_BYTE' | 'PLAYER_BUFFER_SIZE_IN_SECOND', + amount: number, + ) => void; + + /** + * Sets the current playback rate. Positive parameter values play the media forwards, while negative values cause the media to play in reverse. + * + * The range of valid playback rates depends on the streaming protocol. If the input parameter is out of range, the player returns the PLAYER_ERROR_INVALID_PARAMETER flag. + * @param playbackSpeed -16x, -8x, -4x, -2x, 1x, 2x, 4x, 8x, 16x + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "READY, "PLAYING", "PAUSED" + * For the general HTTP and HTTPS, the supported playback rate is -8x ~ 8x. (Repeated seek) + * Please refer to the specification (https://developer.samsung.com/tv/develop/specifications/general-specifications/#streaming-feature-support) for the supported range of other streaming types. + */ + setSpeed: (playbackSpeed: number) => void; + + /** + * Sets asynchronous callback methods for player information notifications, such as buffering progress, player information, playback mode, and DRM mode information. + * @param playbackCallback AVPlayPlaybackCallback + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "IDLE" (recommended), "READY", "PLAYING", "PAUSED" + * To avoid missing necessary information, the onbufferingstart, onbufferingprogress, onbufferingcomplete, onerror, onevent, and ondrmevent listeners must be set during the "IDLE" state. + */ + setListener: (playbackCallback: AVPlayPlaybackCallback) => void; + + /** + * Updates the DRM information, such as SetProperties. You can change the DRM mode and run the control feature. The AVPlayDrmOperation and jsonParam parameters depend on the DRM type. + * Please refer to the specification (https://developer.samsung.com/tv/develop/specifications/general-specifications) for the supported DRM. + * @param drmType AVPlayDrmType {"PLAYREADY", "EME_PLAYREADY", "VERIMATRIX", "WIDEVINE_CDM", "EME_WIDEVINE_CDM"} + * @param drmOperation AVPlayDrmOperation : String specifying the DRM operation to be performed. The valid values are depending on the DRM Types. + * This is mainly used for setting DRM information, such as the license server, application-specific custom data, SOAP or HTTP header, the genChallenge mode, and license usage. + * @param jsonParam string DRM parameter represented by JSON string. You can use the JSON.stringify method to generate the JSON string. + * @returns string + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/drmplay + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, SecurityError, InvalidStateError, UnknownError + * @since 2.3 + * @note 'GetUID' operation has been deprecated from Tizen version 5.0, rather application should use getUID() API. + * 'Initialize' and 'Finalize' operations have been deprecated from Tizen version 5.0. Because these are being executed by avplay itself. + * 'widevine_app_session' and 'widevine_data_type' operations have been deprecated from Tizen version 5.0. Because these are merged into "SetProperties". Please refer to setDrm() example. + * @constraint Can be called in the following states: "IDLE" + */ + setDrm: ( + drmType: AVPlayDrmType | 'PLAYREADY' | 'EME_PLAYREADY' | 'VERIMATRIX' | 'WIDEVINE_CDM' | 'EME_WIDEVINE_CDM', + drmOperation: + | AVPlayDrmOperation + | 'SetProperties' + | 'InstallLicense' + | 'ProcessInitiator' + | 'GetUID' + | 'Initialize' + | 'Finalize' + | 'widevine_license_data' + | 'widevine_app_session' + | 'widevine_data_type', + jsonParam: string, + ) => string; + + /** + * Gets the device UID. The input would be the drm type. + * @param drmType AVPlayDrmType {"VERIMATRIX"} // only VERIMATRIX is supported AVPlayDrmType for getUID interface. + * @returns string + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/drmplay + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, SecurityError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "IDLE", "READY", "PLAYING", "PAUSED". + */ + getUID: ( + drmType: AVPlayDrmType | 'PLAYREADY' | 'EME_PLAYREADY' | 'VERIMATRIX' | 'WIDEVINE_CDM' | 'EME_WIDEVINE_CDM', + ) => string; + + /** + * Retrieves the audio spectrum analysis result every 30 ms. You can use it for an equalizer effect video or in a PartyTV application. The spectrum is analyzed across an array of 31 bands, of which Bands[14] ~ Bands[18] generally have the largest values. + * @param soundAnalysisCallback AVPlaySoundAnalysisCallback + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @note `deprecated` 2.4 + * @constraint Can be called in the following states: "IDLE" + */ + setSoundAnalysisListener: (soundAnalysisCallback: AVPlaySoundAnalysisCallback) => void; + + /** + * Unregisters the sound analysis listener. + * @throw WebAPIException NotSupportedError, InvalidStateError, UnknownError + * @since 2.3 + * @note `deprecated` 2.4 + * @constraint Can be called in the following states: "IDLE", "READY", "PLAYING", "PAUSED" + */ + unsetSoundAnalysisListener: () => void; + + /** + * Enables or disables external subtitles. + * @param onoff Boolean value: + * true: Subtitles are hidden + * false: Subtitles are shown. The application does not receive any subtitle-related events. + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "IDLE", "READY" (when using the synchronous prepare method), "PLAYING", "PAUSED" + */ + setSilentSubtitle: (onoff: boolean) => void; + + /** + * Sets the local path for the external subtitle file. Only absolute local paths are supported. If the subtitle file is stored remotely, you must first download the file to local storage, and pass the absolute local path. + * @param filePath Absolute local path + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "IDLE", "READY", "PLAYING", "PAUSED" + */ + setExternalSubtitlePath: (filePath: string) => void; + + /** + * Adjusts external subtitle synchronization with the audio and video. + * @param position Time delay in milliseconds. The duration can be a positive or negative number; a positive delay displays the subtitles later, while a negative delay displays the subtitles sooner. + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "PLAYING", "PAUSED" + */ + setSubtitlePosition: (position: number) => void; + + /** + * Sets the video screen mode in the specified display area. + * @param displayMode "PLAYER_DISPLAY_MODE_LETTER_BOX", "PLAYER_DISPLAY_MODE_FULL_SCREEN", or "PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO" + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "IDLE", "READY", "PLAYING", "PAUSED" + */ + setDisplayMethod: ( + displayMode: + | AVPlayDisplayMode + | 'PLAYER_DISPLAY_MODE_LETTER_BOX' + | 'PLAYER_DISPLAY_MODE_FULL_SCREEN' + | 'PLAYER_DISPLAY_MODE_AUTO_ASPECT_RATIO', + ) => void; + + /** + * Switches audio or subtitle tracks during playback. + * @param trackType "AUDIO" or "TEXT" + * @param trackIndex AVPlayStreamInfo index + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @note Since tizen version 5.0, the trackType "AUDIO" is supported for DASH streaming. + * @constraint Can be called in the following states: "READY" (for Smooth Streaming only), "PLAYING", "PAUSED" (for TEXT tracks only) + * If buffering is not complete, calling this method for an AUDIO track returns an error. + * The trackType "TEXT" is not supported for DASH streaming. + */ + setSelectTrack: (trackType: AVPlayStreamType | 'VIDEO' | 'AUDIO' | 'TEXT', trackIndex: number) => void; + + /** + * Retrieves the currently-playing video, audio, or subtitle stream information, and notifies that a stream is playing. + * @returns AVPlayStreamInfo structure containing tracktype, extraInfo and index for the current stream + * @throw WebAPIException NotSupportedError, InvalidStateError, UnknownError + * @since 2.3 + * @note For the adaptive streaming such as HLS, DASH and SmoothStreaming, the 'language' is same as what represented on given manifest file. + * @constraint Can be called in the following states: "READY", "PLAYING", "PAUSED" + */ + getCurrentStreamInfo: () => AVPlayStreamInfo; + + /** + * Retrieves the currently-playing stream information. + * @returns AVPlayStreamInfo[] structure containing tracktype, extraInfo and Index of current stream + * Returns information for the all available tracks in the stream. The information is returned in the following structure: + * For video tracks: + * "{"fourCC":"%s","Width":"%u","Height":"%u","Bit_rate":"%u"}" + * For audio track: + * "{"language":"%s","channels":"%d","sample_rate":"%d","bit_rate":"%d","fourCC":"%s"}" + * For subtitle tracks: + * "{"track_num":"%d","track_lang":"%s","subtitle_type":"%d","fourCC":"%s"}" + * Some of them are not constant value(E.g. Video:Width, Height, and Bit_rate, Audio:channels, sample_rate, and bit_rate) for adaptive streaming such as HLS, DASH and SmoothStreaming. + * @throw WebAPIException NotSupportedError, InvalidStateError, UnknownError + * @since 2.3 + * @note For the adaptive streaming such as HLS, DASH and SmoothStreaming, the 'language' is same as what represented on given manifest file. + * @constraint Can be called in the following states: "READY" (when using the synchronous prepare method), "PLAYING", "PAUSED" + */ + getTotalTrackInfo: () => AVPlayStreamInfo[]; + + /** + * Sets specific feature values for HTTP, MMS, or specific streaming engine (Smooth Streaming, HLS, DASH, DivX Plus Streaming, or Widevine). The available streaming properties depend on the streaming protocol or engine. + * Use the CUSTOM_MESSAGE property for streaming engine or CP-specific settings. + * @param propertyType "COOKIE", "USER_AGENT", "PREBUFFER_MODE" , "ADAPTIVE_INFO", "SET_MODE_4K", "PROPERTY_HD_AUDIO", "LISTEN_SPARSE_TRACK", "WIDEVINE", "USE_VIDEOMIXER", "SET_MIXEDFRAME", "PORTRAIT_MODE" + * @param propertyParam Value according to the propertyType. e.g. "ADAPTIVE_INFO" PropetyTypes are "BITRATES", "STARTBITRATE", "SKIPBITRATE". + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @note "USE_VIDEOMIXER", "SET_MIXEDFRAME" are only for product B2B and available from Tizen 2.4 onwards. + * "PORTRAIT_MODE" is only for product B2B and available from Tizen 3.0 onwards. + * "WIDEVINE" unit has been deprecated from Tizen version 4.0 + * "PROPERTY_HD_AUDIO" unit has been deprecated from Tizen version 2.4 + * @constraint Can be called in the following states: "IDLE" + * "READY", "PLAYING", "PAUSED" is valid only for SET_MIXEDFRAME. + */ + setStreamingProperty: ( + propertyType: + | AVPlayStreamingPropertyType + | 'COOKIE' + | 'USER_AGENT' + | 'PREBUFFER_MODE' + | 'ADAPTIVE_INFO' + | 'SET_MODE_4K' + | 'PROPERTY_HD_AUDIO' + | 'LISTEN_SPARSE_TRACK' + | 'IS_LIVE' + | 'AVAILABLE_BITRATE' + | 'GET_LIVE_DURATION' + | 'CURRENT_BANDWIDTH' + | 'WIDEVINE' + | 'SET_VR360_MODE' + | 'USE_VIDEOMIXER' + | 'SET_MIXEDFRAME' + | 'PORTRAIT_MODE', + propertyParam: string, + ) => void; + + /** + * Retrieves a specific property value obtained by the streaming engine (Smooth Streaming, HLS, DASH, or Widevine). + * @returns string Property value + * @param propertyType AVPlayStreamingPropertyType { "IS_LIVE", "AVAILABLE_BITRATE", "GET_LIVE_DURATION","CURRENT_BANDWIDTH"}; + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @note GET_SERVER_TIME_SCALE and GET_ABSOLUTE_SERVER_TIME: Supported for Smooth Streaming only. + * @constraint Can be called in the following states: "READY", "PLAYING", "PAUSED" + */ + getStreamingProperty: ( + propertyType: + | AVPlayStreamingPropertyType + | 'COOKIE' + | 'USER_AGENT' + | 'PREBUFFER_MODE' + | 'ADAPTIVE_INFO' + | 'SET_MODE_4K' + | 'PROPERTY_HD_AUDIO' + | 'LISTEN_SPARSE_TRACK' + | 'IS_LIVE' + | 'AVAILABLE_BITRATE' + | 'GET_LIVE_DURATION' + | 'CURRENT_BANDWIDTH' + | 'WIDEVINE' + | 'SET_VR360_MODE' + | 'USE_VIDEOMIXER' + | 'SET_MIXEDFRAME' + | 'PORTRAIT_MODE', + ) => string; + + /** + * Retrieves the AVPlay version. + * @returns string string current version + * @throw WebAPIException NotSupportedError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "IDLE", "READY", "PLAYING", "PAUSED" + */ + getVersion: () => string; + + /** + * Pauses the player state when the application is sent to the background. Saves the current statistics for the ongoing playback session. + * @throw WebAPIException NotSupportedError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "READY, "PLAYING", "PAUSED" + */ + suspend: () => void; + + /** + * During multitasking, restores the player state when the application is resumed. For live streaming or DRM-encrypted content playback, you must check whether the streaming URL has changed or the DRM session or license has expired, and specify the new URL and DRM information as needed. + * @param URL updated URL after suspend. If null, the stored URL is used. + * For live streaming or DRM-encrypted content playback, in case the URL has changed or the DRM license or session has expired, checking for and passing the newest URL is recommended. + * @param resumeTime (milliseconds) Optional. Position from which to resume playback. If 0, the stored position is used. + * For live streaming, this parameter is not meaningful. Do not pass 0 for this parameter. + * For DRM-encrypted content playback, if the DRM session has expired, to recreate the playback pipeline, pass 0 for this parameter. + * @param bPrepare Optional boolean. false (default): Player sets the resume behavior automatically. true: Player does not resume automatically. The application must invoke the prepare and play methods. + * For live streaming, this parameter is not meaningful. Do not pass true for this parameter. + * For DRM-encrypted content playback: if the DRM session has expired, pass true for this parameter. + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "PLAYING", "PAUSED" + */ + restore: (URL: string, resumeTime?: number, bPrepare?: boolean) => void; + + /** + * During multitasking, restores the player state when the application is resumed. restoreAsync is an asynchronous interface. + * Other API, restore is a synchronous interface which blocks the application thread. + * This method is preferred over restore because it returns immediately and does not block the application thread during its restoration. + * When player is restored successful, the success callback is returned and player resumed the playback from the restored playback position, state, properties etc. + * If restoration fails, the error callback returns the error value. + * Application is required to make further calls to avplay on its success or failure callback happens. + * For live streaming or DRM-encrypted content playback, you must check whether the streaming URL has changed or the DRM session or license has expired, and specify the new URL and DRM information as needed. + * @param URL updated URL after suspend. If null, the stored URL is used. + * For live streaming or DRM-encrypted content playback, in case the URL has changed or the DRM license or session has expired, checking for and passing the newest URL is recommended. + * @param resumeTime (milliseconds) Optional. Position from which to resume playback. If 0, the stored position is used. + * For live streaming, this parameter is not meaningful. Do not pass 0 for this parameter. + * For DRM-encrypted content playback, if the DRM session has expired, to recreate the playback pipeline, pass 0 for this parameter. + * @param bPrepare Optional boolean. false (default): Player sets the resume behavior automatically. true: Player does not resume automatically. The application must invoke the prepare and play methods. + * For live streaming, this parameter is not meaningful. Do not pass true for this parameter. + * For DRM-encrypted content playback: if the DRM session has expired, pass true for this parameter. + * @param successCallback Callback method to invoke when the call is successful + * @param errorCallback Callback method to invoke when an error occurs + * @throw WebAPIException TypeMismatchError, NotSupportedError, InvalidValuesError, InvalidStateError, UnknownError + * @since 2.3 + * @constraint Can be called in the following states: "NONE", "PLAYING", "PAUSED" + */ + restoreAsync: ( + URL: string, + resumeTime?: number, + bPrepare?: boolean, + onsuccess?: SuccessCallback, + onerror?: ErrorCallback, + ) => void; +} diff --git a/types/tizen-tv-webapis/avplaystore.d.ts b/types/tizen-tv-webapis/avplaystore.d.ts new file mode 100644 index 0000000000..22c69324fa --- /dev/null +++ b/types/tizen-tv-webapis/avplaystore.d.ts @@ -0,0 +1,14 @@ +import { AVPlayManager } from './avplay'; +/** + * This module defines the multimedia player functionalities provided by the Tizen Samsung TV Product API. + * @since 2.3 + */ +export interface AVPlayStoreManager { + /** + * Creates a player instance that can be used for parallel pre-buffering. Up to 4 player instances can exist simultaneously. + * @returns AVPlayManagerObject Created AVPlayManagerObject object + * @throw WebAPIException QUOTA_EXCEEDED_ERR (Max player count reached) + * @note You can create player instances using the open method or the getPlayer method. The getPlayer method allows you to create player instances that can pre-buffer simultaneously, so you can switch between player instances smoothly. For example, while playing an advertisement video, you can pre-buffer movie content so that movie playback begins immediately after the advertisement ends. You can call the getPlayer method multiple times to create multiple player instances. The instances can buffer simultaneously, but only 1 can be playing at a time. + */ + getPlayer: () => AVPlayManager; +} diff --git a/types/tizen-tv-webapis/billing.d.ts b/types/tizen-tv-webapis/billing.d.ts new file mode 100644 index 0000000000..7dab045605 --- /dev/null +++ b/types/tizen-tv-webapis/billing.d.ts @@ -0,0 +1,378 @@ +import { ErrorCallback } from './webapis'; +/** + * Specifies billing server types. + * - `DEV` - Staging server + * - `PRD` - Operating server + */ +export enum TVServerType { + DEV = 'DEV', + PRD = 'PRD', +} + +/** + * Defines the payment result and information. + */ +export type BillingBuyData = { + /** + * Payment result + */ + payResult: string; + /** + * Payment information. It is same with paymentDetails param of buyItem. + */ + payDetail: string; +}; + +/** + * Defines a dictionary for product list data returned by the getProductsList API. + * @param apiResult getProductsList API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in ProductsListAPIResult format at the below. + */ +export type ProductsListData = { + apiResult: string; +}; + +/** + * Defines a dictionary for data returned by the applyInvoice API. + * @param apiResult applyInvoice API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in ApplyInvoiceAPIResult format at the below. + */ +export type ApplyInvoiceData = { + apiResult: string; +}; + +/** + * Defines a dictionary for data returned by the verifyInvoice API. + * @param apiResult verifyInvoice API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in VerifyInvoiceAPIResult format at the below. + */ +export type VerifyInvoiceData = { + apiResult: string; +}; + +/** + * Defines a dictionary for data returned by the getServiceCountryAvailability API. + * @param apiResult getServiceCountryAvailability API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in GetUserPurchaseListAPIResult format at the below. + */ +export type ServiceCountryAvailabilityData = { + apiResult: string; +}; + +/** + * Defines a dictionary for data returned by the getUserPurchaseList API. + * @param apiResult getUserPurchaseList API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in GetUserPurchaseListAPIResult format at the below. + */ +export type UserPurchaseData = { + apiResult: string; +}; + +/** + * Defines a dictionary for subscription cancellation data returned by the cancelSubscription API. + * @param apiResult cancelSubscription API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in CancelSubscriptionAPIResult format at the below. + */ +export type CancelSubscriptionData = { + apiResult: string; +}; + +/** + * Defines a dictionary for data returned by the IsServiceAvailable API. + * @param apiResult IsServiceAvailable API result dictionary in JSON format. This value is JSON string type data, so Please use it by JSON parsing. After you parse this value, you can use it in ServiceAvailableAPIResult format at the below. + * @note `deprecated` 5.5 + */ +export type ServiceAvailableData = { + apiResult: string; +}; + +/** + * Callback method returning the payment status. + * @param data Payment status + */ +export interface BillingBuyDataSuccessCallback { + (data: BillingBuyData): void; +} + +/** + * Callback method returning the product list request status. + * @param data It includes getProductList API result. but you can't use it as it is. you have to parse it as JSON format data. + */ +export interface BillingProductsListCallback { + (data: ProductsListData): void; +} + +/** + * Callback method returning the apply invoice request status. + * @param data It includes applyInvoice API result. but you can't use it as it is. you have to parse it as JSON format data. + */ +export interface BillingApplyInvoiceCallback { + (data: ApplyInvoiceData): void; +} + +/** + * Callback method returning the payment verification request status. + * @param data It includes verifyInvoice API result. but you can't use it as it is. you have to parse it as JSON format data. + */ +export interface BillingVerifyInvoiceCallback { + (data: VerifyInvoiceData): void; +} + +/** + * Callback method returning availability of country list status. + * @param data It includes getServiceCountryAvailability API result. but you can't use it as it is. you have to parse it as JSON format data. + */ +export interface BillingGetServiceCountryAvailabilityCallback { + (data: ServiceCountryAvailabilityData): void; +} + +/** + * Callback method returning the purchase history request status. + * @param data It includes getUserPurchaseList API result. but you can't use it as it is. you have to parse it as JSON format data. + */ +export interface BillingGetUserPurchaseListCallback { + (data: UserPurchaseData): void; +} + +/** + * Callback method returning the subscription cancel request status. + * @param data It includes cancelSubscription API result. but you can't use it as it is. you have to parse it as JSON format data. + */ +export interface BillingCancelSubscriptionCallback { + (data: CancelSubscriptionData): void; +} + +/** + * Callback method returning the service availability check status. + * @param data It includes isServiceAvailable API result. but you can't use it as it is. you have to parse it as JSON format data. + * @note `deprecated` 5.5 + */ +export interface BillingIsServiceAvailableCallback { + (data: ServiceAvailableData): void; +} + +/** + * This module defines the Billing (Samsung Checkout) functionalities provided by the Tizen Samsung TV Product API. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @since 2.4 + */ +export interface BillingManager { + /** + * Retrieves the Billing API version. + * @returns Billing API version + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException SecurityError, UnknownError + * @since 4.0 + */ + getVersion: () => string; + + /** + * Enables implementing the Samsung Checkout Client module within the application. After authenticating the purchase information through the application, the user can proceed to purchase payment. + * @param appId Application ID + * @param serverType Billing server type + * @param paymentDetails Payment parameters + * OrderItemID[MANDATORY]/OrderTitle[MANDATORY]/OrderTotal[MANDATORY]/OrderCurrencyID[MANDATORY]/OrderID[OPTIONAL]/OrderCustomID[MANDATORY] + * @param onsuccess Returns "payResult" and "payDetail" if there is no internal error occurs until client to server data communication. + * payResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it + * payDetail, can have additional data when it's returned, such as InvoiceID. Please refer to the development guide of "buyItem" for details + * @param onerror Optional callback method to invoke if an internal error occurs before the client to server data communication + * SecurityError, if the application does not have the privilege to call this method + * UnknownError, if other error occur, such as internal error or "billing client already running" error + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 2.4 + */ + buyItem: ( + appId: string, + serverType: TVServerType | 'DEV' | 'PRD', + paymentDetails: string, + onsuccess: BillingBuyDataSuccessCallback, + onerror?: ErrorCallback, + ) => void; + + /** + * Retrieves the list of products registered on the Billing (DPI) server. + * @param appId Application ID + * @param countryCode TV country code + * @param pageSize Number of products retrieved per page (maximum 100) + * @param pageNumber Requested page number (1 ~ N) + * @param checkValue Security check value. Required parameters = "AppID" + "CountryCode" + * @param serverType Billing server type + * @param onsuccess Returns the product list if there is no internal error occurs until client to server data communication + * apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it + * when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns + * @param onerror Optional callback method to invoke if an internal error occurs before the client to server data communication + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 4.0 + */ + getProductsList: ( + appId: string, + countryCode: string, + pageSize: string, + pageNumber: string, + checkValue: string, + serverType: TVServerType | 'DEV' | 'PRD', + onsuccess: BillingProductsListCallback, + onerror?: ErrorCallback, + ) => void; + + /** + * Recodes the apply status of purchase item to DPI server. + * @param appId Application ID + * @param customId Same value as "OrderCustomID" parameter for the BuyItem API (Samsung Account UID) + * @param invoiceId Invoice ID + * @param countryCode TV country code + * @param serverType Billing server type + * @param onsuccess Returns purchase apply status if there is no internal error occurs until client to server data communication + * apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it + * when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns + * @param onerror Optional callback method to invoke if an internal error occurs before the client to server data communication + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 4.0 + */ + applyInvoice: ( + appId: string, + customId: string, + invoiceId: string, + countryCode: string, + serverType: TVServerType | 'DEV' | 'PRD', + onsuccess: BillingApplyInvoiceCallback, + onerror?: ErrorCallback, + ) => void; + + /** + * Checks whether a purchase, corresponding to a specific "InvoiceID", was successful. + * @param appId Application ID + * @param customId Same value as "OrderCustomID" parameter for the BuyItem API (Samsung Account UID) + * @param invoiceId Invoice ID + * @param countryCode TV country code + * @param serverType Billing server type + * @param onsuccess Returns the payment status if there is no internal error occurs until client to server data communication. + * apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it + * when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns + * @param onerror Optional callback method to invoke if an internal error occurs before the client to server data communication + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 4.0 + */ + verifyInvoice: ( + appId: string, + customId: string, + invoiceId: string, + countryCode: string, + serverType: TVServerType | 'DEV' | 'PRD', + onsuccess: BillingVerifyInvoiceCallback, + onerror?: ErrorCallback, + ) => void; + + /** + * Get Service Country availability for Samsung Checkout + * @param appId Application ID + * @param countryCodes to check. Multiple countrycodes available. (Add as array, only Uppercase allowed) ex) countrycodes=["DE","US","KR"] + * @param checkValue Security check value. Required parameters = "AppID" + "CountryCodes" + * @param serverType Billing server type + * @param onsuccess Returns the service availability status of each country if there is no internal error occurs until client to server data communication. + * apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it + * when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns + * @param onerror Optional callback method to invoke if an internal error occurs before the client to server data communication + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 5.5 + */ + getServiceCountryAvailability: ( + appId: string, + countryCodes: string[], + checkValue: string, + serverType: TVServerType | 'DEV' | 'PRD', + onsuccess: BillingGetServiceCountryAvailabilityCallback, + onerror?: ErrorCallback, + ) => void; + + /** + * Retrieves the user's purchase list. + * @param appId Application ID + * @param customId Same value as "OrderCustomID" parameter for the BuyItem API (Samsung Account UID) + * @param countryCode TV country code + * @param pageNumber Requested page number (1 ~ N) + * @param checkValue Security check value. Required parameters = "AppID" + "CountryCode" + * @param serverType Billing server type + * @param onsuccess Returns the purchase list if there is no internal error occurs until client to server data communication + * apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it + * when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns + * @param onerror Optional callback method to invoke if an internal error occurs before the client to server data communication + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 4.0 + */ + getUserPurchaseList: ( + appId: string, + customId: string, + countryCode: string, + pageNumber: string, + checkValue: string, + serverType: TVServerType | 'DEV' | 'PRD', + onsuccess: BillingGetUserPurchaseListCallback, + onerror?: ErrorCallback, + ) => void; + + /** + * Cancels a subscription product. + * @param appId Application ID + * @param invoiceId Invoice ID + * @param customId Same value as "OrderCustomID" parameter for the BuyItem API (Samsung Account UID) + * @param countryCode TV country code + * @param serverType Billing server type + * @param onsuccess Returns the subscription cancellation status if there is no internal error occurs until client to server data communication. + * apiResult, can still contains error when billing server confirms that the given parameters does not have expected value or have problem while processing it + * when CPStatus value from apiResult is "100000", it means server communication is done properly and other values are valid in returns + * @param onerror Optional callback method to invoke if an error occurs before the client to server data communication. + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 4.0 + */ + cancelSubscription: ( + appId: string, + invoiceId: string, + customId: string, + countryCode: string, + serverType: TVServerType | 'DEV' | 'PRD', + onsuccess: BillingCancelSubscriptionCallback, + onerror?: ErrorCallback, + ) => void; + + /** + * descEng Checks whether the Billing server is available. However, this api will be replaced by getServiceCountryAvailability after deprecation + * @param serverType Billing server + * @param onsuccess Returns the server availability + * @param onerror Optional callback method to invoke if an internal error occurs before the client to server data communication + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/billing + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 4.0 + * @note `deprecated` 5.5 + */ + isServiceAvailable: ( + serverType: TVServerType | 'DEV' | 'PRD', + onsuccess: BillingIsServiceAvailableCallback, + onerror?: ErrorCallback, + ) => void; +} diff --git a/types/tizen-tv-webapis/index.d.ts b/types/tizen-tv-webapis/index.d.ts new file mode 100644 index 0000000000..f21e39f50b --- /dev/null +++ b/types/tizen-tv-webapis/index.d.ts @@ -0,0 +1,61 @@ +// Type definitions for tizen-tv-webapis 1.0 +// Project: https://developer.samsung.com/smarttv/develop/api-references/samsung-product-api-references.html +// Definitions by: SejoongDeJang +// Dongkeun Nam +// Woosik Park +// Dayoung Kim +// Hyojin Kim +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +import { AdInfoManager } from './adinfo'; +import { AppCommonManager } from './appcommon'; +import { AVPlayManager } from './avplay'; +import { AVInfoManager } from './avinfo'; +import { AVPlayStoreManager } from './avplaystore'; +import { BillingManager } from './billing'; +import { NetworkManager } from './network'; +import { ProductInfoManager } from './productinfo'; +import { SsoManager } from './sso'; +import { TvInfoManager } from './tvinfo'; +import { WidgetDataManager } from './widgetdata'; +import { WebAPIException } from './webapis'; + +declare const webapis: Webapis; + +declare global { + const webapis: Webapis; + interface Window { + webapis: Webapis; + } +} + +interface Webapis { + adinfo: AdInfoManager; + appcommon: AppCommonManager; + avplay: AVPlayManager; + avinfo: AVInfoManager; + avplaystore: AVPlayStoreManager; + billing: BillingManager; + network: NetworkManager; + productinfo: ProductInfoManager; + sso: SsoManager; + tvinfo: TvInfoManager; + widgetdata: WidgetDataManager; + WebAPIException: WebAPIException; +} + +export = webapis; +export as namespace webapis; diff --git a/types/tizen-tv-webapis/network.d.ts b/types/tizen-tv-webapis/network.d.ts new file mode 100644 index 0000000000..31cfcc394c --- /dev/null +++ b/types/tizen-tv-webapis/network.d.ts @@ -0,0 +1,611 @@ +/** + * This module defines the network information retrieval functionalities provided by the Tizen Samsung TV Product API. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @since 2.3 + */ +export interface NetworkManager { + NetworkIpMode: { + /** + * No network IP mode configured + */ + NONE: 0; + + /** + * Connected to wired or wireless IPv4 network through static IP configuration + */ + STATIC: 1; + + /** + * Connected to wired or wireless IPv6 network through dynamic IP configuration + */ + DYNAMIC: 2; + + /** + * DHCP: Connected to wired or wireless IPv4 network through automatic IP configuration + */ + AUTO: 3; + + /** + * Connected to cellular network through fixed IP configuration + */ + FIXED: 4; + + /** + * No wired or wireless connection + */ + UNKNOWN: 5; + }; + + NetworkActiveConnectionType: { + /** + * No network configured + */ + DISCONNECTED: 0; + /** + * Connected to a Wi-Fi network. + */ + WIFI: 1; + /** + * Connected to a cellular network. + */ + CELLULAR: 2; + /** + * Connected to an Ethernet network. + */ + ETHERNET: 3; + }; + + NetworkState: { + /** + * LAN cable connected + */ + LAN_CABLE_ATTACHED: 1; + + /** + * LAN cable disconnected + */ + LAN_CABLE_DETACHED: 2; + + /** + * LAN cable connection state unknown + */ + LAN_CABLE_STATE_UNKNOWN: 3; + + /** + * Gateway connected + */ + GATEWAY_CONNECTED: 4; + + /** + * Gateway disconnected + */ + GATEWAY_DISCONNECTED: 5; + + /** + * Wi-Fi module connected + */ + WIFI_MODULE_STATE_ATTACHED: 6; + + /** + * Wi-Fi module disconnected + */ + WIFI_MODULE_STATE_DETACHED: 7; + + /** + * Wi-Fi module connection state unknown + */ + WIFI_MODULE_STATE_UNKNOWN: 8; + }; + + NetworkWiFiSecurityMode: { + /** + * WEP security mode + */ + WEP: 1; + + /** + * PSK security mode + */ + WPA_PSK: 2; + + /** + * WPA2_PSK security mode + */ + WPA2_PSK: 3; + + /** + * EAP security mode + */ + EAP: 4; + + /** + * Open security mode + */ + NONE: 5; + + /** + * Security mode unknown + */ + UNKNOWN: 6; + }; + + NetworkWiFiEncryptionType: { + /** + * WEP encryption + */ + WEP: 1; + + /** + * TKIP encryption + */ + TKIP: 2; + + /** + * AES encryption + */ + AES: 3; + + /** + * TKIP_AES_MIXED encryption + */ + TKIP_AES_MIXED: 4; + + /** + * No encryption + */ + NONE: 5; + + /** + * Encryption type unknown + */ + UNKNOWN: 6; + }; + + /** + * Retrieves the TV network module version. + * @returns string Network plugin module version + * @throw WebAPIException `SecurityError` + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, the NotSupportedError exception has been removed. + */ + getVersion(): string; + + /** + * Checks whether the TV is connected to a network gateway. + * @returns Boolean value: + * true: Gateway connected + * false: Gateway is not connected + * @throw WebAPIException `SecurityError` + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + isConnectedToGateway(): boolean; + /** + * Retrieves the TV's IP configuration mode. + * @throw WebAPIException `SecurityError` + * @returns unsigned long Network IP mode + * "NONE":0 + * "STATIC": 1 + * "DYNAMIC": 2 + * "AUTO": 3 + * "FIXED": 4 + * "UNKNOWN": 5 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, the NotSupportedError exception has been removed. + */ + getIpMode(): NetworkIpMode; + + /** + * Retrieves the TV's configured subnet mask address. + * @throw WebAPIException `SecurityError`,`InvalidStateError` + * @returns string Subnet mask address for the currently-configured network. Example: 255.255.255.0 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getSubnetMask(): string; + + /** + * Retrieves the TV's configured gateway address. + * @throw WebAPIException `SecurityError`,`InvalidStateError` + * @returns string Gateway address for the currently-configured network + * Example: 192.168.0.1 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getGateway(): string; + + /** + * Retrieves the network device's MAC address. + * @throw WebAPIException `SecurityError`,`InvalidStateError` + * @returns string MAC address for the currently-configured network. Example: 50:B7:A3:C2:96:11 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getMac(): string; + + /** + * Retrieves the TV's configured DNS address. + * @throw WebAPIException `SecurityError`, `InvalidStateError` + * @returns string DNS address for the currently-configured network. Example: 192.168.0.1 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getDns(): string; + + /** + * Retrieves the TV's configured IP address. + * @throw WebAPIException `SecurityError`,`InvalidStateError` + * @returns string IP address for the currently-configured network + * Example: 192.168.0.11 + * @code + * @endcode + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getIp(): string; + + /** + * Retrieves the TV's configured name when TV is connected to a network. + * @throw WebAPIException `SecurityError`,`InvalidStateError` + * @returns string TV Name for any connected network. Example: Tizen_Device + * @since 4.0 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getTVName(): string; + + /** + * Retrieves the TV's currently-active connection type. + * @throw WebAPIException `SecurityError` + * @returns NetworkActiveConnectionType Currently-active network connection type."DISCONNECTED": 0, "WIFI": 1, "CELLULAR": 2, "ETHERNET": 3 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + */ + getActiveConnectionType(): NetworkActiveConnectionType; + + /** + * Registers an asynchronous event listener. + * @throw `SecurityError``TypeMismatchError` + * @returns number Application async listener ID + * @param listener NetworkStateChangedCallback. For example: listenerID = network.addNetworkStateChangeListener(onChange); + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if an input parameter is not compatible with its expected type, TypeMismatchError is thrown instead of NotSupportedError. + * @note Since plugin version 3.0, the NotSupportedError exception has been removed. + */ + addNetworkStateChangeListener(listener: NetworkStateChangedCallback): number; + + /** + * Unregisters an asynchronous event listener. + * @throw WebAPIException `SecurityError`,`TypeMismatchError`,`InvalidValuesError`, + * @param listenerId ListenerID to be removed + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if the listenerId value is not the same as the value generated by addNetworkStateChangeListener, InvalidValuesError is thrown instead of NotSupportedError. + */ + removeNetworkStateChangeListener(listenerId: number): void; + + /** + * Retrieves the Wi-Fi network SSID. Works only when the active connection type is Wi-Fi. + * @throw WebAPIException `SecurityError`,`InvalidStateError` + * @returns string Wi-Fi network SSID. Example: Strawbarry + * @since 2.3 + * @privilegeName http://developer.samsung.com/privilege/network.public + * @version 1.0 + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getWiFiSsid(): string; + + /** + * Retrieves the Wi-Fi signal strength. Works only when the active connection type is Wi-Fi. + * @throw WebAPIException`SecurityError`,`InvalidStateError` + * @returns number Signal strength level. Valid values are 1 to 5. Signal strength is strongest when the value is 5. + * 8dBm + * 8 ~ -77dBm + * 7 ~ -66dBm + * 6 ~ -55dBm + * 5dBm + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getWiFiSignalStrengthLevel(): number; + + /** + * Retrieves the Wi-Fi security mode. Works only when the active connection type is Wi-Fi. + * @throw WebAPIException`SecurityError`,`InvalidStateError` + * @returns unsigned long Wi-Fi security mode + * "WEP": 1 + * "WPA_PSK": 2 + * "WPA2_PSK": 3 + * "EAP": 4 + * "NONE": 5 + * "UNKNOWN": 6 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getWiFiSecurityMode(): NetworkWiFiSecurityMode; + + /** + * Retrieves the Wi-Fi encryption type. Works only when the active connection type is Wi-Fi. + * @throw WebAPIException`SecurityError`,`InvalidStateError` + * @returns unsigned long Wi-Fi encryption type + * "WEP": 1 + * "TKIP": 2 + * "AES": 3 + * "TKIP_AES_MIXED": 4 + * "NONE": 5 + * "UNKNOWN": 6 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getWiFiEncryptionType(): NetworkWiFiEncryptionType; + + /** + * Retrieves the TV's configured secondary DNS address. + * @throw WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. + * @throw WebAPIException with error type InvalidStateError, if a network connection is not available. (Since plugin version 3.0) + * @returns string Secondary DNS address + * Example: 192.168.0.100 + * @since 2.3 + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/network.public + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getSecondaryDns(): string; + + /** + * Sets the DHCP option 60 vendor string. Works only when the active connection type is wired. The vendor string is updated when Udhcpc is restarted or relaunched. + * @throw WebAPIException `SecurityError`,`InvalidStateError`,`InvalidStateError`,`TypeMismatchError` + * @param vendorName DHCP option 60 vendor name string + * @since 2.3 + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/network.dhcpoption60 + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + * @note Since plugin version 3.0, if an input parameter is not compatible with its expected type, TypeMismatchError is thrown instead of NotSupportedError. + */ + setDhcpOption60Field(vendorName: string): void; + + /** + * Sets the DHCP option 60 vendor string to the default value, "udhcpc1.21.1". Works only when the active connection type is wired. The vendor string is updated when Udhcpc is restarted or relaunched. + * @throw WebAPIException `SecurityError`,`InvalidStateError` + * @since 2.3 + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/network.dhcpoption60 + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + removeDhcpOption60Field(): void; + + /** + * Retrieves the DHCP option 60 vendor string. Works only when the active connection type is wired. + * @throw WebAPIException `SecurityError`, `InvalidStateError` + * @returns string Vendor-specific string. Default value is "default". + * Example: If setDhcpOption60Field = "cisco" then getCurrentDhcpOption60Field = "cisco". + * @since 2.3 + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/network.dhcpoption60 + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + getCurrentDhcpOption60Field(): string; + + /** + * Retrieves the DHCP option 60 vendor string currently used by Udhcp. Works only when the active connection type is wired. + * @throw WebAPIException `SecurityError`, `InvalidStateError` + * @returns string Vendor string + * Example: If Udhcpc is running with the default string "udhcpc1.21.1", after calling setDhcpOption60Field = "cisco", checkCurrentIpWith60Field= "udhcpc1.21.1" + * @since 2.3 + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/network.dhcpoption60 + * @note Since plugin version 3.0, if a network connection is not available, InvalidStateError is thrown instead of NotSupportedError. + */ + checkCurrentIpWith60Field(): string; +} + +/** + * Defines constants for network IP modes. + */ +export enum NetworkIpMode { + /** + * No network IP mode configured + */ + NONE = 0, + + /** + * Connected to wired or wireless IPv4 network through static IP configuration + */ + STATIC = 1, + + /** + * Connected to wired or wireless IPv6 network through dynamic IP configuration + */ + DYNAMIC = 2, + + /** + * DHCP: Connected to wired or wireless IPv4 network through automatic IP configuration + */ + AUTO = 3, + + /** + * Connected to cellular network through fixed IP configuration + */ + FIXED = 4, + + /** + * No wired or wireless connection + */ + UNKNOWN = 5, +} + +/** + * Defines constants for network connection types. + */ +export enum NetworkActiveConnectionType { + /** + * No network configured + */ + DISCONNECTED = 0, + /** + * Connected to a Wi-Fi network. + */ + WIFI = 1, + /** + * Connected to a cellular network. + */ + CELLULAR = 2, + /** + * Connected to an Ethernet network. + */ + ETHERNET = 3, +} + +/** + * Callback method for gateway connection state change notifications. + * @throw WebAPIException `SecurityError`, `InvalidStateError` + * @param state Connection state + * @since 3.0 + * @privilegeLevel Public + */ +export interface NetworkStateChangedCallback { + (state: NetworkState): void; +} + +/** + * Defines constants for network states. + */ +export enum NetworkState { + /** + * LAN cable connected + */ + LAN_CABLE_ATTACHED = 1, + + /** + * LAN cable disconnected + */ + LAN_CABLE_DETACHED = 2, + + /** + * LAN cable connection state unknown + */ + LAN_CABLE_STATE_UNKNOWN = 3, + + /** + * Gateway connected + */ + GATEWAY_CONNECTED = 4, + + /** + * Gateway disconnected + */ + GATEWAY_DISCONNECTED = 5, + + /** + * Wi-Fi module connected + */ + WIFI_MODULE_STATE_ATTACHED = 6, + + /** + * Wi-Fi module disconnected + */ + WIFI_MODULE_STATE_DETACHED = 7, + + /** + * Wi-Fi module connection state unknown + */ + WIFI_MODULE_STATE_UNKNOWN = 8, +} + +/** + * Defines constants for Wi-Fi network security modes. + */ +export enum NetworkWiFiSecurityMode { + /** + * WEP security mode + */ + WEP = 1, + + /** + * PSK security mode + */ + WPA_PSK = 2, + + /** + * WPA2_PSK security mode + */ + WPA2_PSK = 3, + + /** + * EAP security mode + */ + EAP = 4, + + /** + * Open security mode + */ + NONE = 5, + + /** + * Security mode unknown + */ + UNKNOWN = 6, +} + +/** + * Defines constants for Wi-fi network encryption types. + */ +export enum NetworkWiFiEncryptionType { + /** + * WEP encryption + */ + WEP = 1, + + /** + * TKIP encryption + */ + TKIP = 2, + + /** + * AES encryption + */ + AES = 3, + + /** + * TKIP_AES_MIXED encryption + */ + TKIP_AES_MIXED = 4, + + /** + * No encryption + */ + NONE = 5, + + /** + * Encryption type unknown + */ + UNKNOWN = 6, +} diff --git a/types/tizen-tv-webapis/productinfo.d.ts b/types/tizen-tv-webapis/productinfo.d.ts new file mode 100644 index 0000000000..82e45aa35f --- /dev/null +++ b/types/tizen-tv-webapis/productinfo.d.ts @@ -0,0 +1,368 @@ +import { ErrorCallback, SuccessCallback } from './webapis'; +/** + * Defines constants for product info configuration keys. + * @since 2.3 + */ +export enum ProductInfoConfigKey { + /** + * Data service configuration, it can be set as string type with numbers + * @since 2.3 + */ + CONFIG_KEY_DATA_SERVICE = 0, + + /** + * Service country, readonly + * @since 2.3 + */ + CONFIG_KEY_SERVICE_COUNTRY = 1, +} + +/** + * Defines constants for glasses-free 3D support. + * @since 2.3 + */ +export enum ProductInfoNoGlass3dSupport { + /** + * Glasses-free 3D is not supported + * @since 2.3 + */ + NO_GLASS_3D_NOT_SUPPORTED = 0, + + /** + * @descEng Glasses-free 3D is supported + * @since 2.3 + */ + NO_GLASS_3D_SUPPORTED = 1, +} + +/** + * Defines constants for infolink server types. + * @since 2.3 + */ +export enum ProductInfoSiServerType { + /** + * Operating server + * @since 2.3 + */ + SI_TYPE_OPERATIING_SERVER = 0, + + /** + * Development server + * @since 2.3 + */ + SI_TYPE_DEVELOPMENT_SERVER = 1, + + /** + * Developing server + * @since 2.3 + */ + SI_TYPE_DEVELOPING_SERVER = 2, +} + +/** + * Callback method for product info configuration changes. + * @param key Key of each ProductInfo config + * @since 2.3 + */ +export interface ProductInfoConfigChangeCallback { + (key: ProductInfoConfigKey): void; +} + +/** + * Defines a WebApi object instance of the Tizen Samsung TV Product API. + * The webapis.productinfo object enables access to ProductInfo API functionality. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @since 2.3 + */ +export interface ProductInfoManager { + ProductInfoConfigKey: { + /** + * Data service configuration, it can be set as string type with numbers + * @since 2.3 + */ + CONFIG_KEY_DATA_SERVICE: 0; + /** + * Service country, readonly + * @since 2.3 + */ + CONFIG_KEY_SERVICE_COUNTRY: 1; + }; + ProductInfoNoGlass3dSupport: { + /** + * Glasses-free 3D is not supported + * @since 2.3 + */ + NO_GLASS_3D_NOT_SUPPORTED: 0; + /** + * @descEng Glasses-free 3D is supported + * @since 2.3 + */ + NO_GLASS_3D_SUPPORTED: 1; + }; + ProductInfoSiServerType: { + /** + * Operating server + * @since 2.3 + */ + SI_TYPE_OPERATIING_SERVER: 0; + /** + * Development server + * @since 2.3 + */ + SI_TYPE_DEVELOPMENT_SERVER: 1; + /** + * Developing server + * @since 2.3 + */ + SI_TYPE_DEVELOPING_SERVER: 2; + }; + /** + * Retrieves the plugin version number. + * @returns Plugin version + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getVersion: () => string; + + /** + * Retrieves the firmware information. + * @returns Firmware version + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getFirmware: () => string; + + /** + * Retrieves the DUID. + * @returns DUID + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getDuid: () => string; + + /** + * Retrieves the model code, such as "15_HAWKP". + * @returns Model code + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getModelCode: () => string; + + /** + * Retrieves the model name, such as "UJS9500". + * @returns Model name + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getModel: () => string; + + /** + * Retrieves the infolink server type. + * @returns Infolink server type + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getSmartTVServerType: () => ProductInfoSiServerType; + + /** + * Retrieves the infolink server version, such as "T-INFOLINK2014-1002". + * @returns Infolink server version + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getSmartTVServerVersion: () => string; + + /** + * Retrieves the tuner value from factory information. + * @returns Tuner value + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException NotSupportedError, SecurityError + * @since 2.3 + */ + getTunerEpop: () => string; + + /** + * Checks whether the TV Soccer Mode is enabled. + * @returns Boolean value: + * true: Enabled + * false: Disabled + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException NotSupportedError, SecurityError + * @since 2.3 + */ + isSoccerModeEnabled: () => boolean; + + /** + * Checks whether TTV is supported. + * @returns Boolean value: + * true: Supported + * false: Not supported + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + isTtvSupported: () => boolean; + + /** + * Checks whether UdPanel is supported. + * @returns Boolean value: + * true: Supported + * false: Not supported + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + isUdPanelSupported: () => boolean; + + /** + * Checks whether 8K panel is supported. + * @returns Boolean value: + * true: Supported + * false: Not supported + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 4.0 + */ + is8KPanelSupported: () => boolean; + + /** + * Retrieves the full model name, such as UN65JS9500. + * @returns Model name + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 2.3 + */ + getRealModel: () => string; + + /** + * Checks whether the product model is WALL. + * @returns Boolean value: + * true: Wall Model + * false: Not Wall Model + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 5.0 + */ + isWallModel: () => boolean; + + /** + * Checks whether glasses-free 3D is supported. + * @returns NoGlass3dSupport value + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException NotSupportedError, SecurityError + * @since 2.3 + */ + getNoGlass3dSupport: () => ProductInfoNoGlass3dSupport; + + /** + * Retrieves the local set. + * @returns LocalSet value + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException NotSupportedError, SecurityError + * @since 2.3 + */ + getLocalSet: () => string; + + /** + * Retrieves the value for the specified system configuration key, such as service country code. + * @param key ProductInfoConfigKey + * @returns System configuration value + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException TypeMismatchError, InvalidValuesError, SecurityError + * @since 2.3 + */ + getSystemConfig: (key: ProductInfoConfigKey) => string; + // getSystemConfig: ( + // key: ProductInfoConfigKey + // ) => string; + + /** + * Sets the value for the specified system configuration key. + * @param key Product info configuration key + * @param value Value to set + * @param onsuccess Callback method to invoke when the system configuration key value is successfully set + * @param onerror Callback method to invoke if an error has occurred + * @returns void + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException TypeMismatchError, InvalidValuesError, NotSupportedError, SecurityError + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + setSystemConfig: ( + key: ProductInfoConfigKey, + value: string, + onsuccess?: SuccessCallback, + onerror?: ErrorCallback, + ) => void; + + /** + * Registers a system configuration change listener. + * @param key Productinfo configuration key + * @param listener ProductInfoConfigChangeCallback listener + * @returns Listener ID + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException TypeMismatchError, InvalidValuesError, SecurityError + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + addSystemConfigChangeListener: (key: ProductInfoConfigKey, listener: ProductInfoConfigChangeCallback) => number; + + /** + * Unregister a system configuration change listener. + * @param key Productinfo configuration key + * @param listenerId ProductInfoConfigChangeCallback ID + * @returns void + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException TypeMismatchError, InvalidValuesError, SecurityError + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + removeSystemConfigChangeListener: (listenerId: number) => void; + + /** + * Checks whether the device supports Ultra HD Premium features. + * @returns Boolean value: + * true: Supported + * false: Not supported + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/productinfo + * @throw WebAPIException SecurityError + * @since 3.0 + */ + isUHDAModel: () => boolean; + + /** + * This method check whether display rotator is supported or not. + * @returns true if display rotator is supported, else false + * @since 5.5 + */ + isDisplayRotatorSupported: () => boolean; +} diff --git a/types/tizen-tv-webapis/sso.d.ts b/types/tizen-tv-webapis/sso.d.ts new file mode 100644 index 0000000000..e061e0dffa --- /dev/null +++ b/types/tizen-tv-webapis/sso.d.ts @@ -0,0 +1,125 @@ +import { ErrorCallback } from './webapis'; +/* + * This module defines the SSO functionalities provided by the Tizen Samsung TV Product API. + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/sso.partner + * @since 2.3 + */ +export interface SsoManager { + /** + * Retrieves the plugin version number. + * @returns string The version of the sso + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/sso.partner + * @throw `TypeMismatchError`, `NotSupportedError`, `InvalidValuesError`, `SecurityError`, `UnknownError` + * @since 2.3 + */ + getVersion: () => string; + + /** + * Shows the SSO login or logout page, and returns the SSO login or logout information. + * @param widgetName Widget name + * @param onsuccess Callback method to invoke when the account page is shown + * @param onerror Callback method to invoke if an error has occurred. It provides the status, error name, and error message. + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/sso.partner + * @throw `SecurityError`, `TypeMismatchError`, `NotSupportedError`, `InvalidValuesError`, `UnknownError` + * @since 2.3 + */ + showAccountView: (widgetName: string, onsuccess: SsoCallDataSuccessCallback, onerror?: ErrorCallback) => void; + + /** + * Retrieves the UID. + * The UID is considered personally-identifying information and must be handled according to the privacy regulations for each country. + * It must not be used for any purpose other than as an input parameter for the Samsung Checkout API. + * Whenever the UID value is sent outside the TV device, a secure protocol, such as HTTPS, must be used. + * @returns string UID + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/sso.partner + * @throw `TypeMismatchError`, `NotSupportedError`, `InvalidValuesError`, `InvalidStateError`, `SecurityError`, `UnknownError` + * @since 2.3 + */ + getLoginUid: () => string; + + /** + * Retrieves the SSO login status. + * @returns `SsoLoginState` A object of the current login state. + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/sso.partner + * @throw `TypeMismatchError`, `NotSupportedError`, `InvalidValuesError`, `SecurityError`, `UnknownError` + * @since 2.3 + */ + getLoginStatus: () => SsoLoginState; + + /** + * Shows the SSO account creation screen. + * @param onsuccess Callback method to invoke when the CreateAccountPage is shown + * @param onerror Callback method to invoke if an error has occurred. It provides the status, error name, and error message. + * @privilegeLevel Partner + * @privilegeName http://developer.samsung.com/privilege/sso.partner + * @throw `TypeMismatchError`, `NotSupportedError`, `InvalidValuesError`, `UnknownError` + * @since 2.3 + */ + showCreateAccountView: (onsuccess: SsoStringSuccessCallback, onerror?: ErrorCallback) => void; +} + +/** + * Defines a dictionary for call success data. + * @param status Login status + */ +export interface SsoCallData { + status: string; +} + +/** + * Defines a dictionary for login data. + * @param bLogin Login status + * @param id Login ID + * @param authToken Login authentication token + * @param uid Login UID + * @param guid Login GUID + */ +export interface SsoData { + bLogin: boolean; + id: string; + authToken: string; + uid: string; + guid: string; +} + +/** + * Defines the login success callback. + */ +export interface SsoCallDataSuccessCallback { + (data: SsoCallData): void; +} + +/** + * Defines the success callback for string data. + */ +export interface SsoDataSuccessCallback { + (data: SsoData): void; +} + +/** + * Defines the success callback for number data. + */ +export interface SsoStringSuccessCallback { + (data: string): void; +} + +/** + * Defines constants for login status. + * - `SSO_NOT_LOGIN` - Test NOT LOGIN + * - `SSO_LOGIN` - Test Login + */ +export enum SsoLoginState { + /** + * Not logged in + */ + SSO_NOT_LOGIN = 0, + /** + * Logged in + */ + SSO_LOGIN = 1, +} diff --git a/types/tizen-tv-webapis/test/tizen-tv-webapis-tests.cjs.ts b/types/tizen-tv-webapis/test/tizen-tv-webapis-tests.cjs.ts new file mode 100644 index 0000000000..cf0195c305 --- /dev/null +++ b/types/tizen-tv-webapis/test/tizen-tv-webapis-tests.cjs.ts @@ -0,0 +1,12 @@ +import webapis = require('tizen-tv-webapis'); + +webapis.adinfo.getVersion(); // $ExpectType string +webapis.appcommon.getVersion(); // $ExpectType string +webapis.avplay.getVersion(); // $ExpectType string +webapis.avinfo.getVersion(); // $ExpectType string +webapis.billing.getVersion(); // $ExpectType string +webapis.network.getVersion(); // $ExpectType string +webapis.productinfo.getVersion(); // $ExpectType string +webapis.sso.getVersion(); // $ExpectType string +webapis.tvinfo.getVersion(); // $ExpectType string +webapis.widgetdata.getVersion(); // $ExpectType string diff --git a/types/tizen-tv-webapis/test/tizen-tv-webapis-tests.global.ts b/types/tizen-tv-webapis/test/tizen-tv-webapis-tests.global.ts new file mode 100644 index 0000000000..666f84f1e6 --- /dev/null +++ b/types/tizen-tv-webapis/test/tizen-tv-webapis-tests.global.ts @@ -0,0 +1,11 @@ +const { adinfo, appcommon, avplay, avinfo, billing, network, productinfo, sso, tvinfo, widgetdata } = webapis; +adinfo.getVersion(); // $ExpectType string +appcommon.getVersion(); // $ExpectType string +avplay.getVersion(); // $ExpectType string +avinfo.getVersion(); // $ExpectType string +billing.getVersion(); // $ExpectType string +network.getVersion(); // $ExpectType string +productinfo.getVersion(); // $ExpectType string +sso.getVersion(); // $ExpectType string +tvinfo.getVersion(); // $ExpectType string +widgetdata.getVersion(); // $ExpectType string diff --git a/types/tizen-tv-webapis/tsconfig.json b/types/tizen-tv-webapis/tsconfig.json new file mode 100644 index 0000000000..f6eaa2cfb5 --- /dev/null +++ b/types/tizen-tv-webapis/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ES2016", + "module": "commonjs", + "lib": ["dom", "es6"], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "esModuleInterop": true, + "noImplicitAny": true, + "noImplicitThis" : true, + "strictNullChecks": true, + "strictFunctionTypes":true + }, + "files": [ + "index.d.ts", + "test/tizen-tv-webapis-tests.cjs.ts", + "test/tizen-tv-webapis-tests.global.ts" + ] +} \ No newline at end of file diff --git a/types/tizen-tv-webapis/tslint.json b/types/tizen-tv-webapis/tslint.json new file mode 100644 index 0000000000..0c4b7755af --- /dev/null +++ b/types/tizen-tv-webapis/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "max-line-length": false, + "interface-over-type-literal": false + } +} diff --git a/types/tizen-tv-webapis/tvinfo.d.ts b/types/tizen-tv-webapis/tvinfo.d.ts new file mode 100644 index 0000000000..9cca1a0340 --- /dev/null +++ b/types/tizen-tv-webapis/tvinfo.d.ts @@ -0,0 +1,2305 @@ +/** + * Defines constants for caption settings keys. + */ +export enum TvInfoMenuKey { + /** + * Caption On/Off + * expected value TvInfoMenuValue + * unsigned long CAPTION_OFF = 0; + * unsigned long CAPTION_ON = 1; + */ + CAPTION_ONOFF_KEY = 0, + + /** + * Caption mode. Default: Service 6 + * expected value TvInfoMenuValue + * unsigned long CAPTION_MODE_DEFAULT = 0; + * unsigned long CAPTION_MODE_SERVICE1 = 1; + * unsigned long CAPTION_MODE_SERVICE2 = 2; + * unsigned long CAPTION_MODE_SERVICE3 = 3; + * unsigned long CAPTION_MODE_SERVICE4 = 4; + * unsigned long CAPTION_MODE_SERVICE5 = 5; + * unsigned long CAPTION_MODE_SERVICE6 = 6; + * unsigned long CAPTION_MODE_CC1 = 7; + * unsigned long CAPTION_MODE_CC2 = 8; + * unsigned long CAPTION_MODE_CC3 = 9; + * unsigned long CAPTION_MODE_CC4 = 10; + * unsigned long CAPTION_MODE_TEXT1 = 11; + * unsigned long CAPTION_MODE_TEXT2 = 12; + * unsigned long CAPTION_MODE_TEXT3 = 13; + * unsigned long CAPTION_MODE_TEXT4 = 14; + */ + CAPTION_MODE_KEY = 1, + + /** + * expected value TvInfoMenuValue + * unsigned long CAPTION_SIZE_DEFAULT = 0; + * unsigned long CAPTION_SIZE_SMALL = 1; + * unsigned long CAPTION_SIZE_STANDARD = 2; + * unsigned long CAPTION_SIZE_LARGE = 3; + * unsigned long CAPTION_SIZE_EXTRA_LARGE = 4; + */ + CAPTION_FONT_SIZE_KEY = 2, + + /** + * Caption font style. Default: Style 6 + * expected value TvInfoMenuValue + * unsigned long CAPTION_FONT_DEFAULT = 0; + * unsigned long CAPTION_FONT_STYLE0 = 1; + * unsigned long CAPTION_FONT_STYLE1 = 2; + * unsigned long CAPTION_FONT_STYLE2 = 3; + * unsigned long CAPTION_FONT_STYLE3 = 4; + * unsigned long CAPTION_FONT_STYLE4 = 5; + * unsigned long CAPTION_FONT_STYLE5 = 6; + * unsigned long CAPTION_FONT_STYLE6 = 7; + */ + CAPTION_FONT_STYLE_KEY = 3, + + /** + * Caption text foreground color + * expected value TvInfoMenuValue + * unsigned long CAPTION_COLOR_DEFAULT = 0; + * unsigned long CAPTION_COLOR_WHITE = 1; + * unsigned long CAPTION_COLOR_BLACK = 2; + * unsigned long CAPTION_COLOR_RED = 3; + * unsigned long CAPTION_COLOR_GREEN = 4; + * unsigned long CAPTION_COLOR_BLUE = 5; + * unsigned long CAPTION_COLOR_YELLOW = 6; + * unsigned long CAPTION_COLOR_MAGENTA = 7; + * unsigned long CAPTION_COLOR_CYAN = 8; + */ + CAPTION_FG_COLOR_KEY = 4, + + /** + * Caption text foreground opacity + * expected value TvInfoMenuValue + * unsigned long CAPTION_OPACITY_SOLID = 0; + * unsigned long CAPTION_OPACITY_FLASH = 1; + * unsigned long CAPTION_OPACITY_TRANSLUCENT = 2; + * unsigned long CAPTION_OPACITY_TRANSPARENT = 3; + * unsigned long CAPTION_OPACITY_DEFAULT = 4; + * unsigned long CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5; + * unsigned long CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6; + */ + CAPTION_FG_OPACITY_KEY = 5, + + /** + * Caption text background color + * expected value TvInfoMenuValue + * unsigned long CAPTION_COLOR_DEFAULT = 0; + * unsigned long CAPTION_COLOR_WHITE = 1; + * unsigned long CAPTION_COLOR_BLACK = 2; + * unsigned long CAPTION_COLOR_RED = 3; + * unsigned long CAPTION_COLOR_GREEN = 4; + * unsigned long CAPTION_COLOR_BLUE = 5; + * unsigned long CAPTION_COLOR_YELLOW = 6; + * unsigned long CAPTION_COLOR_MAGENTA = 7; + * unsigned long CAPTION_COLOR_CYAN = 8; + */ + CAPTION_BG_COLOR_KEY = 6, + + /** + * Caption text background opacity + * expected value TvInfoMenuValue + * unsigned long CAPTION_OPACITY_SOLID = 0; + * unsigned long CAPTION_OPACITY_FLASH = 1; + * unsigned long CAPTION_OPACITY_TRANSLUCENT = 2; + * unsigned long CAPTION_OPACITY_TRANSPARENT = 3; + * unsigned long CAPTION_OPACITY_DEFAULT = 4; + * unsigned long CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5; + * unsigned long CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6; + */ + CAPTION_BG_OPACITY_KEY = 7, + + /** + * Caption text edge type + * expected value TvInfoMenuValue + * unsigned long CAPTION_EDGE_NONE = 0; + * unsigned long CAPTION_EDGE_RAISED = 1; + * unsigned long CAPTION_EDGE_DEPRESSED = 2; + * unsigned long CAPTION_EDGE_UNIFORM = 3; + * unsigned long CAPTION_EDGE_DROP_SHADOWED = 4; + */ + CAPTION_EDGE_TYPE_KEY = 8, + + /** + * Caption text edge color + * expected value TvInfoMenuValue + * unsigned long CAPTION_COLOR_DEFAULT = 0; + * unsigned long CAPTION_COLOR_WHITE = 1; + * unsigned long CAPTION_COLOR_BLACK = 2; + * unsigned long CAPTION_COLOR_RED = 3; + * unsigned long CAPTION_COLOR_GREEN = 4; + * unsigned long CAPTION_COLOR_BLUE = 5; + * unsigned long CAPTION_COLOR_YELLOW = 6; + * unsigned long CAPTION_COLOR_MAGENTA = 7; + * unsigned long CAPTION_COLOR_CYAN = 8; + */ + CAPTION_EDGE_COLOR_KEY = 9, + + /** + * Caption text window color + * expected value TvInfoMenuValue + * unsigned long CAPTION_COLOR_DEFAULT = 0; + * unsigned long CAPTION_COLOR_WHITE = 1; + * unsigned long CAPTION_COLOR_BLACK = 2; + * unsigned long CAPTION_COLOR_RED = 3; + * unsigned long CAPTION_COLOR_GREEN = 4; + * unsigned long CAPTION_COLOR_BLUE = 5; + * unsigned long CAPTION_COLOR_YELLOW = 6; + * unsigned long CAPTION_COLOR_MAGENTA = 7; + * unsigned long CAPTION_COLOR_CYAN = 8; + */ + CAPTION_WINDOW_COLOR_KEY = 10, + + /** + * Caption text window opacity + * expected value TvInfoMenuValue + * unsigned long CAPTION_OPACITY_SOLID = 0; + * unsigned long CAPTION_OPACITY_FLASH = 1; + * unsigned long CAPTION_OPACITY_TRANSLUCENT = 2; + * unsigned long CAPTION_OPACITY_TRANSPARENT = 3; + * unsigned long CAPTION_OPACITY_DEFAULT = 4; + * unsigned long CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5; + * unsigned long CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6; + */ + CAPTION_WINDOW_OPACITY_KEY = 11, + + /** + * Focus zoom menu value + * expected value TvInfoMenuValue + * unsigned long OFF = 0; + * unsigned long ON = 1; + */ + ACCESSIBILITY_FOCUS_ZOOM = 12, + + /** + * High Contrast menu value + * expected value TvInfoMenuValue + * unsigned long OFF = 0; + * unsigned long ON = 1; + */ + ACCESSIBILITY_HIGH_CONTRAST = 13, + + /** + * Channel-bound apps ticker menu value + * expected value DOMString + * "OFF", "ON" + * @since 2.3 + * @note `deprecated` 3.0 + */ + SMARTHUB_CHANNEL_BOUND_APPS_TICKER = 14, + + /** + * Voice guide menu value + * expected value TvInfoMenuValue + * unsigned long OFF = 0; + * unsigned long ON = 1; + */ + VOICE_GUIDE_KEY = 15, + + /** + * Subtitles On/Off + * expected value TvInfoMenuValue + * unsigned long OFF = 0; + * unsigned long ON = 1; + */ + SUBTITLE_ONOFF_KEY = 16, + + /** + * Subtitle mode + * expected value TvInfoMenuValue + * unsigned long SUBTITLE_NORMAL = 0; + * unsigned long SUBTITLE_HEARING_IMMPEARED = 1; + */ + SUBTITLE_MODE_KEY = 17, + + /** + * Primary Audio Language + * expected value TvInfoMenuValue + * DOMString AUDIO_LANGUAGE_CODE_AFR = "AFR"; + * DOMString AUDIO_LANGUAGE_CODE_AKA = "AKA"; + * DOMString AUDIO_LANGUAGE_CODE_AMH = "AMH"; + * DOMString AUDIO_LANGUAGE_CODE_ARA = "ARA"; + * DOMString AUDIO_LANGUAGE_CODE_ASM = "ASM"; + * DOMString AUDIO_LANGUAGE_CODE_BEN = "BEN"; + * DOMString AUDIO_LANGUAGE_CODE_BUL = "BUL"; + * DOMString AUDIO_LANGUAGE_CODE_CAT = "CAT"; + * DOMString AUDIO_LANGUAGE_CODE_CHI = "CHI"; + * DOMString AUDIO_LANGUAGE_CODE_CMN = "CMN"; + * DOMString AUDIO_LANGUAGE_CODE_CZE = "CZE"; + * DOMString AUDIO_LANGUAGE_CODE_DAG = "DAG"; + * DOMString AUDIO_LANGUAGE_CODE_DAN = "DAN"; + * DOMString AUDIO_LANGUAGE_CODE_DUT = "DUT"; + * DOMString AUDIO_LANGUAGE_CODE_ENG = "ENG"; + * DOMString AUDIO_LANGUAGE_CODE_EST = "EST"; + * DOMString AUDIO_LANGUAGE_CODE_EUS = "EUS"; + * DOMString AUDIO_LANGUAGE_CODE_EWE = "EWE"; + * DOMString AUDIO_LANGUAGE_CODE_FIN = "FIN"; + * DOMString AUDIO_LANGUAGE_CODE_FRE = "FRE"; + * DOMString AUDIO_LANGUAGE_CODE_GAA = "GAA"; + * DOMString AUDIO_LANGUAGE_CODE_GER = "GER"; + * DOMString AUDIO_LANGUAGE_CODE_GLA = "GLA"; + * DOMString AUDIO_LANGUAGE_CODE_GLG = "GLG"; + * DOMString AUDIO_LANGUAGE_CODE_GOS = "GOS"; + * DOMString AUDIO_LANGUAGE_CODE_GRE = "GRE"; + * DOMString AUDIO_LANGUAGE_CODE_GUJ = "GUJ"; + * DOMString AUDIO_LANGUAGE_CODE_HAU = "HAU"; + * DOMString AUDIO_LANGUAGE_CODE_HEB = "HEB"; + * DOMString AUDIO_LANGUAGE_CODE_HIN = "HIN"; + * DOMString AUDIO_LANGUAGE_CODE_HRV = "HRV"; + * DOMString AUDIO_LANGUAGE_CODE_HUN = "HUN"; + * DOMString AUDIO_LANGUAGE_CODE_IGB = "IGB"; + * DOMString AUDIO_LANGUAGE_CODE_IND = "IND"; + * DOMString AUDIO_LANGUAGE_CODE_IRI = "IRI"; + * DOMString AUDIO_LANGUAGE_CODE_ITA = "ITA"; + * DOMString AUDIO_LANGUAGE_CODE_JPN = "JPN"; + * DOMString AUDIO_LANGUAGE_CODE_KAN = "KAN"; + * DOMString AUDIO_LANGUAGE_CODE_KOK = "KOK"; + * DOMString AUDIO_LANGUAGE_CODE_KOR = "KOR"; + * DOMString AUDIO_LANGUAGE_CODE_LAV = "LAV"; + * DOMString AUDIO_LANGUAGE_CODE_LIT = "LIT"; + * DOMString AUDIO_LANGUAGE_CODE_MAL = "MAL"; + * DOMString AUDIO_LANGUAGE_CODE_MAO = "MAO"; + * DOMString AUDIO_LANGUAGE_CODE_MAR = "MAR"; + * DOMString AUDIO_LANGUAGE_CODE_MSA = "MSA"; + * DOMString AUDIO_LANGUAGE_CODE_NBL = "NBL"; + * DOMString AUDIO_LANGUAGE_CODE_NOR = "NOR"; + * DOMString AUDIO_LANGUAGE_CODE_NSO = "NSO"; + * DOMString AUDIO_LANGUAGE_CODE_NZI = "NZI"; + * DOMString AUDIO_LANGUAGE_CODE_ORI = "ORI"; + * DOMString AUDIO_LANGUAGE_CODE_PAN = "PAN"; + * DOMString AUDIO_LANGUAGE_CODE_PER = "PER"; + * DOMString AUDIO_LANGUAGE_CODE_POL = "POL"; + * DOMString AUDIO_LANGUAGE_CODE_POR = "POR"; + * DOMString AUDIO_LANGUAGE_CODE_QAA = "QAA"; + * DOMString AUDIO_LANGUAGE_CODE_QAB = "QAB"; + * DOMString AUDIO_LANGUAGE_CODE_QAC = "QAC"; + * DOMString AUDIO_LANGUAGE_CODE_ROM = "ROM"; + * DOMString AUDIO_LANGUAGE_CODE_RUS = "RUS"; + * DOMString AUDIO_LANGUAGE_CODE_SLK = "SLK"; + * DOMString AUDIO_LANGUAGE_CODE_SOT = "SOT"; + * DOMString AUDIO_LANGUAGE_CODE_SPA = "SPA"; + * DOMString AUDIO_LANGUAGE_CODE_SRP = "SRP"; + * DOMString AUDIO_LANGUAGE_CODE_SSW = "SSW"; + * DOMString AUDIO_LANGUAGE_CODE_SWA = "SWA"; + * DOMString AUDIO_LANGUAGE_CODE_SWE = "SWE"; + * DOMString AUDIO_LANGUAGE_CODE_TAM = "TAM"; + * DOMString AUDIO_LANGUAGE_CODE_TEL = "TEL"; + * DOMString AUDIO_LANGUAGE_CODE_THA = "THA"; + * DOMString AUDIO_LANGUAGE_CODE_TSN = "TSN"; + * DOMString AUDIO_LANGUAGE_CODE_TSO = "TSO"; + * DOMString AUDIO_LANGUAGE_CODE_TUR = "TUR"; + * DOMString AUDIO_LANGUAGE_CODE_TWI = "TWI"; + * DOMString AUDIO_LANGUAGE_CODE_UKR = "UKR"; + * DOMString AUDIO_LANGUAGE_CODE_VAL = "VAL"; + * DOMString AUDIO_LANGUAGE_CODE_VEN = "VEN"; + * DOMString AUDIO_LANGUAGE_CODE_VIE = "VIE"; + * DOMString AUDIO_LANGUAGE_CODE_WEL = "WEL"; + * DOMString AUDIO_LANGUAGE_CODE_XHO = "XHO"; + * DOMString AUDIO_LANGUAGE_CODE_XSM = "XSM"; + * DOMString AUDIO_LANGUAGE_CODE_YOR = "YOR"; + * DOMString AUDIO_LANGUAGE_CODE_YUE = "YUE"; + * DOMString AUDIO_LANGUAGE_CODE_ZHO = "ZHO"; + * DOMString AUDIO_LANGUAGE_CODE_ZUL = "ZUL"; + * Only the values that can be set in the menu can be set to webapi + */ + PRIMARY_AUDIO_LANGUAGE_KEY = 18, + + /** + * Secondary Audio Language + * expected value TvInfoMenuValue + * DOMString AUDIO_LANGUAGE_CODE_AFR = "AFR"; + * DOMString AUDIO_LANGUAGE_CODE_AKA = "AKA"; + * DOMString AUDIO_LANGUAGE_CODE_AMH = "AMH"; + * DOMString AUDIO_LANGUAGE_CODE_ARA = "ARA"; + * DOMString AUDIO_LANGUAGE_CODE_ASM = "ASM"; + * DOMString AUDIO_LANGUAGE_CODE_BEN = "BEN"; + * DOMString AUDIO_LANGUAGE_CODE_BUL = "BUL"; + * DOMString AUDIO_LANGUAGE_CODE_CAT = "CAT"; + * DOMString AUDIO_LANGUAGE_CODE_CHI = "CHI"; + * DOMString AUDIO_LANGUAGE_CODE_CMN = "CMN"; + * DOMString AUDIO_LANGUAGE_CODE_CZE = "CZE"; + * DOMString AUDIO_LANGUAGE_CODE_DAG = "DAG"; + * DOMString AUDIO_LANGUAGE_CODE_DAN = "DAN"; + * DOMString AUDIO_LANGUAGE_CODE_DUT = "DUT"; + * DOMString AUDIO_LANGUAGE_CODE_ENG = "ENG"; + * DOMString AUDIO_LANGUAGE_CODE_EST = "EST"; + * DOMString AUDIO_LANGUAGE_CODE_EUS = "EUS"; + * DOMString AUDIO_LANGUAGE_CODE_EWE = "EWE"; + * DOMString AUDIO_LANGUAGE_CODE_FIN = "FIN"; + * DOMString AUDIO_LANGUAGE_CODE_FRE = "FRE"; + * DOMString AUDIO_LANGUAGE_CODE_GAA = "GAA"; + * DOMString AUDIO_LANGUAGE_CODE_GER = "GER"; + * DOMString AUDIO_LANGUAGE_CODE_GLA = "GLA"; + * DOMString AUDIO_LANGUAGE_CODE_GLG = "GLG"; + * DOMString AUDIO_LANGUAGE_CODE_GOS = "GOS"; + * DOMString AUDIO_LANGUAGE_CODE_GRE = "GRE"; + * DOMString AUDIO_LANGUAGE_CODE_GUJ = "GUJ"; + * DOMString AUDIO_LANGUAGE_CODE_HAU = "HAU"; + * DOMString AUDIO_LANGUAGE_CODE_HEB = "HEB"; + * DOMString AUDIO_LANGUAGE_CODE_HIN = "HIN"; + * DOMString AUDIO_LANGUAGE_CODE_HRV = "HRV"; + * DOMString AUDIO_LANGUAGE_CODE_HUN = "HUN"; + * DOMString AUDIO_LANGUAGE_CODE_IGB = "IGB"; + * DOMString AUDIO_LANGUAGE_CODE_IND = "IND"; + * DOMString AUDIO_LANGUAGE_CODE_IRI = "IRI"; + * DOMString AUDIO_LANGUAGE_CODE_ITA = "ITA"; + * DOMString AUDIO_LANGUAGE_CODE_JPN = "JPN"; + * DOMString AUDIO_LANGUAGE_CODE_KAN = "KAN"; + * DOMString AUDIO_LANGUAGE_CODE_KOK = "KOK"; + * DOMString AUDIO_LANGUAGE_CODE_KOR = "KOR"; + * DOMString AUDIO_LANGUAGE_CODE_LAV = "LAV"; + * DOMString AUDIO_LANGUAGE_CODE_LIT = "LIT"; + * DOMString AUDIO_LANGUAGE_CODE_MAL = "MAL"; + * DOMString AUDIO_LANGUAGE_CODE_MAO = "MAO"; + * DOMString AUDIO_LANGUAGE_CODE_MAR = "MAR"; + * DOMString AUDIO_LANGUAGE_CODE_MSA = "MSA"; + * DOMString AUDIO_LANGUAGE_CODE_NBL = "NBL"; + * DOMString AUDIO_LANGUAGE_CODE_NOR = "NOR"; + * DOMString AUDIO_LANGUAGE_CODE_NSO = "NSO"; + * DOMString AUDIO_LANGUAGE_CODE_NZI = "NZI"; + * DOMString AUDIO_LANGUAGE_CODE_ORI = "ORI"; + * DOMString AUDIO_LANGUAGE_CODE_PAN = "PAN"; + * DOMString AUDIO_LANGUAGE_CODE_PER = "PER"; + * DOMString AUDIO_LANGUAGE_CODE_POL = "POL"; + * DOMString AUDIO_LANGUAGE_CODE_POR = "POR"; + * DOMString AUDIO_LANGUAGE_CODE_QAA = "QAA"; + * DOMString AUDIO_LANGUAGE_CODE_QAB = "QAB"; + * DOMString AUDIO_LANGUAGE_CODE_QAC = "QAC"; + * DOMString AUDIO_LANGUAGE_CODE_ROM = "ROM"; + * DOMString AUDIO_LANGUAGE_CODE_RUS = "RUS"; + * DOMString AUDIO_LANGUAGE_CODE_SLK = "SLK"; + * DOMString AUDIO_LANGUAGE_CODE_SOT = "SOT"; + * DOMString AUDIO_LANGUAGE_CODE_SPA = "SPA"; + * DOMString AUDIO_LANGUAGE_CODE_SRP = "SRP"; + * DOMString AUDIO_LANGUAGE_CODE_SSW = "SSW"; + * DOMString AUDIO_LANGUAGE_CODE_SWA = "SWA"; + * DOMString AUDIO_LANGUAGE_CODE_SWE = "SWE"; + * DOMString AUDIO_LANGUAGE_CODE_TAM = "TAM"; + * DOMString AUDIO_LANGUAGE_CODE_TEL = "TEL"; + * DOMString AUDIO_LANGUAGE_CODE_THA = "THA"; + * DOMString AUDIO_LANGUAGE_CODE_TSN = "TSN"; + * DOMString AUDIO_LANGUAGE_CODE_TSO = "TSO"; + * DOMString AUDIO_LANGUAGE_CODE_TUR = "TUR"; + * DOMString AUDIO_LANGUAGE_CODE_TWI = "TWI"; + * DOMString AUDIO_LANGUAGE_CODE_UKR = "UKR"; + * DOMString AUDIO_LANGUAGE_CODE_VAL = "VAL"; + * DOMString AUDIO_LANGUAGE_CODE_VEN = "VEN"; + * DOMString AUDIO_LANGUAGE_CODE_VIE = "VIE"; + * DOMString AUDIO_LANGUAGE_CODE_WEL = "WEL"; + * DOMString AUDIO_LANGUAGE_CODE_XHO = "XHO"; + * DOMString AUDIO_LANGUAGE_CODE_XSM = "XSM"; + * DOMString AUDIO_LANGUAGE_CODE_YOR = "YOR"; + * DOMString AUDIO_LANGUAGE_CODE_YUE = "YUE"; + * DOMString AUDIO_LANGUAGE_CODE_ZHO = "ZHO"; + * DOMString AUDIO_LANGUAGE_CODE_ZUL = "ZUL"; + * Only the values that can be set in the menu can be set to webapi + */ + SECONDARY_AUDIO_LANGUAGE_KEY = 19, + + /** + * voice guide speed + * expected value TvInfoMenuValue + * DOMString VOICEGUIDE_SPEED_VERY_FAST = "VERY_FAST"; + * DOMString VOICEGUIDE_SPEED_FAST = "FAST"; + * DOMString VOICEGUIDE_SPEED_NORMAL= "NORMAL"; + * DOMString VOICEGUIDE_SPEED_SLOW = "SLOW"; + * DOMString VOICEGUIDE_SPEED_VERY_SLOW = "VERY_SLOW"; + */ + ACCESSIBILITY_VOICE_GUIDE_SPEED = 20, + + /** + * caption style + * expected value TvInfoMenuValue + * unsigned long CAPTION_STYLE_DEFAULT = 0; + * unsigned long CAPTION_STYLE_BOLD = 1; + * unsigned long CAPTION_STYLE_ITALIC = 2; + */ + CAPTION_STYLE_KEY = 21, +} + +/** + * Defines constants for TV menu settings values. + */ +export enum TvInfoMenuValue { + /** + * MenuValue Off + */ + OFF = 0, + + /** + * MenuValue On + */ + ON = 1, + + /** + * Caption Off + */ + CAPTION_OFF = 0, + + /** + * Caption On + */ + CAPTION_ON = 1, + + /** + * Default Mode + */ + CAPTION_MODE_DEFAULT = 0, + + /** + * Service 1 + */ + CAPTION_MODE_SERVICE1 = 1, + + /** + * Service 2 + */ + CAPTION_MODE_SERVICE2 = 2, + + /** + * Service 3 + */ + CAPTION_MODE_SERVICE3 = 3, + + /** + * Service 4 + */ + CAPTION_MODE_SERVICE4 = 4, + + /** + * Service 5 + */ + CAPTION_MODE_SERVICE5 = 5, + + /** + * Service 6 + */ + CAPTION_MODE_SERVICE6 = 6, + + /** + * English (KOR Localset) + */ + CAPTION_MODE_CC1 = 7, + + /** + * Korean (KOR Localset) + */ + CAPTION_MODE_CC2 = 8, + + /** + * US Localset only + */ + CAPTION_MODE_CC3 = 9, + + /** + * US Localset only + */ + CAPTION_MODE_CC4 = 10, + + /** + * Text 1 + */ + CAPTION_MODE_TEXT1 = 11, + + /** + * Text 2 + */ + CAPTION_MODE_TEXT2 = 12, + + /** + * Text 3 + */ + CAPTION_MODE_TEXT3 = 13, + + /** + * Text 4 + */ + CAPTION_MODE_TEXT4 = 14, + + /** + * Default + */ + CAPTION_SIZE_DEFAULT = 0, + + /** + * Small + */ + CAPTION_SIZE_SMALL = 1, + + /** + * Standard + */ + CAPTION_SIZE_STANDARD = 2, + + /** + * Large + */ + CAPTION_SIZE_LARGE = 3, + + /** + * Extra large + */ + CAPTION_SIZE_EXTRA_LARGE = 4, + + /** + * Default + */ + CAPTION_FONT_DEFAULT = 0, + + /** + * Style 0 + */ + CAPTION_FONT_STYLE0 = 1, + + /** + * Style 1 + */ + CAPTION_FONT_STYLE1 = 2, + + /** + * Style 2 + */ + CAPTION_FONT_STYLE2 = 3, + + /** + * Style 3 + */ + CAPTION_FONT_STYLE3 = 4, + + /** + * Style 4 + */ + CAPTION_FONT_STYLE4 = 5, + + /** + * Style 5 + */ + CAPTION_FONT_STYLE5 = 6, + + /** + * Style 6 + */ + CAPTION_FONT_STYLE6 = 7, + + /** + * Default + */ + CAPTION_COLOR_DEFAULT = 0, + + /** + * White + */ + CAPTION_COLOR_WHITE = 1, + + /** + * Black + */ + CAPTION_COLOR_BLACK = 2, + + /** + * Red + */ + CAPTION_COLOR_RED = 3, + + /** + * Green + */ + CAPTION_COLOR_GREEN = 4, + + /** + * Blue + */ + CAPTION_COLOR_BLUE = 5, + + /** + * Yellow + */ + CAPTION_COLOR_YELLOW = 6, + + /** + * Magenta + */ + CAPTION_COLOR_MAGENTA = 7, + + /** + * Cyan + */ + CAPTION_COLOR_CYAN = 8, + + /** + * Solid + */ + CAPTION_OPACITY_SOLID = 0, + + /** + * Flashing + */ + CAPTION_OPACITY_FLASH = 1, + + /** + * Translucent + */ + CAPTION_OPACITY_TRANSLUCENT = 2, + + /** + * Transparent + */ + CAPTION_OPACITY_TRANSPARENT = 3, + + /** + * Default + */ + CAPTION_OPACITY_DEFAULT = 4, + + /** + * Highly translucent + */ + CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5, + + /** + * Slightly translucent + */ + CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6, + + /** + * No edge + */ + CAPTION_EDGE_NONE = 0, + + /** + * Raised + */ + CAPTION_EDGE_RAISED = 1, + + /** + * Depressed + */ + CAPTION_EDGE_DEPRESSED = 2, + + /** + * Uniform + */ + CAPTION_EDGE_UNIFORM = 3, + + /** + * Drop shadow + */ + CAPTION_EDGE_DROP_SHADOWED = 4, + + /** + * Normal subtitles + */ + SUBTITLE_NORMAL = 0, + + /** + * Subtitles for the hearing-immpeared + */ + SUBTITLE_HEARING_IMMPEARED = 1, + + /** + * Afrikaans voice mode + */ + AUDIO_LANGUAGE_CODE_AFR = 'AFR', + + /** + * Akan voice mode + */ + AUDIO_LANGUAGE_CODE_AKA = 'AKA', + + /** + * Amharic voice mode + */ + AUDIO_LANGUAGE_CODE_AMH = 'AMH', + + /** + * Arab voice mode + */ + AUDIO_LANGUAGE_CODE_ARA = 'ARA', + + /** + * India-Assamese voice mode + */ + AUDIO_LANGUAGE_CODE_ASM = 'ASM', + + /** + * India-Bengali voice mode + */ + AUDIO_LANGUAGE_CODE_BEN = 'BEN', + + /** + * Bulgarian voice mode + */ + AUDIO_LANGUAGE_CODE_BUL = 'BUL', + + /** + * catala voice mode + */ + AUDIO_LANGUAGE_CODE_CAT = 'CAT', + + /** + * Chinese voice mode + */ + AUDIO_LANGUAGE_CODE_CHI = 'CHI', + + /** + * Chinese (Mandarin) voice mode + */ + AUDIO_LANGUAGE_CODE_CMN = 'CMN', + + /** + * Czech voice mode + */ + AUDIO_LANGUAGE_CODE_CZE = 'CZE', + + /** + * Ghana-Dagbani voice mode + */ + AUDIO_LANGUAGE_CODE_DAG = 'DAG', + + /** + * Danish voice mode + */ + AUDIO_LANGUAGE_CODE_DAN = 'DAN', + + /** + * Dutch voice mode + */ + AUDIO_LANGUAGE_CODE_DUT = 'DUT', + + /** + * English voice mode + */ + AUDIO_LANGUAGE_CODE_ENG = 'ENG', + + /** + * Estonia voice mode + */ + AUDIO_LANGUAGE_CODE_EST = 'EST', + + /** + * basque voice mode + */ + AUDIO_LANGUAGE_CODE_EUS = 'EUS', + + /** + * Ewe voice mode + */ + AUDIO_LANGUAGE_CODE_EWE = 'EWE', + + /** + * Finnish voice mode + */ + AUDIO_LANGUAGE_CODE_FIN = 'FIN', + + /** + * French voice mode + */ + AUDIO_LANGUAGE_CODE_FRE = 'FRE', + + /** + * Gaa voice mode + */ + AUDIO_LANGUAGE_CODE_GAA = 'GAA', + + /** + * German voice mode + */ + AUDIO_LANGUAGE_CODE_GER = 'GER', + + /** + * Gaelic voice mode + */ + AUDIO_LANGUAGE_CODE_GLA = 'GLA', + + /** + * Galician voice mode + */ + AUDIO_LANGUAGE_CODE_GLG = 'GLG', + + /** + * Netherlands private code + */ + AUDIO_LANGUAGE_CODE_GOS = 'GOS', + + /** + * Greek voice mode + */ + AUDIO_LANGUAGE_CODE_GRE = 'GRE', + + /** + * India-Gujarati voice mode + */ + AUDIO_LANGUAGE_CODE_GUJ = 'GUJ', + + /** + * Hausa voice mode + */ + AUDIO_LANGUAGE_CODE_HAU = 'HAU', + + /** + * Hebrew voice mode + */ + AUDIO_LANGUAGE_CODE_HEB = 'HEB', + + /** + * Hindi voice mode + */ + AUDIO_LANGUAGE_CODE_HIN = 'HIN', + + /** + * Croatian voice mode + */ + AUDIO_LANGUAGE_CODE_HRV = 'HRV', + + /** + * Hungarian voice mode + */ + AUDIO_LANGUAGE_CODE_HUN = 'HUN', + + /** + * Igbo voice mode + */ + AUDIO_LANGUAGE_CODE_IGB = 'IGB', + + /** + * Indonesia voice mode + */ + AUDIO_LANGUAGE_CODE_IND = 'IND', + + /** + * Irish voice mode + */ + AUDIO_LANGUAGE_CODE_IRI = 'IRI', + + /** + * Italian voice mode + */ + AUDIO_LANGUAGE_CODE_ITA = 'ITA', + + /** + * Japanes voice mode + */ + AUDIO_LANGUAGE_CODE_JPN = 'JPN', + + /** + * India-Kannada voice mode + */ + AUDIO_LANGUAGE_CODE_KAN = 'KAN', + + /** + * India-Kokani voice mode + */ + AUDIO_LANGUAGE_CODE_KOK = 'KOK', + + /** + * Korean voice mode + */ + AUDIO_LANGUAGE_CODE_KOR = 'KOR', + + /** + * Latvian voice mode + */ + AUDIO_LANGUAGE_CODE_LAV = 'LAV', + + /** + * Lithuanian voice mode + */ + AUDIO_LANGUAGE_CODE_LIT = 'LIT', + + /** + * India-Malayalam voice mode + */ + AUDIO_LANGUAGE_CODE_MAL = 'MAL', + + /** + * Maori voice mode + */ + AUDIO_LANGUAGE_CODE_MAO = 'MAO', + + /** + * Marathi voice mode + */ + AUDIO_LANGUAGE_CODE_MAR = 'MAR', + + /** + * India-Marathi voice mode + */ + AUDIO_LANGUAGE_CODE_MSA = 'MSA', + + /** + * Ndebele voice mode + */ + AUDIO_LANGUAGE_CODE_NBL = 'NBL', + + /** + * Norwegian voice mode + */ + AUDIO_LANGUAGE_CODE_NOR = 'NOR', + + /** + * Sotho, Northern voice mode + */ + AUDIO_LANGUAGE_CODE_NSO = 'NSO', + + /** + * Nzema voice mode + */ + AUDIO_LANGUAGE_CODE_NZI = 'NZI', + + /** + * India-Oriya voice mode + */ + AUDIO_LANGUAGE_CODE_ORI = 'ORI', + + /** + * India-Punjabi voice mode + */ + AUDIO_LANGUAGE_CODE_PAN = 'PAN', + + /** + * Persisian voice mode + */ + AUDIO_LANGUAGE_CODE_PER = 'PER', + + /** + * Polish voice mode + */ + AUDIO_LANGUAGE_CODE_POL = 'POL', + + /** + * Portuguese voice mode + */ + AUDIO_LANGUAGE_CODE_POR = 'POR', + + /** + * Singapore preffered audio. + */ + AUDIO_LANGUAGE_CODE_QAA = 'QAA', + + /** + * Singapore secondary audio. + */ + AUDIO_LANGUAGE_CODE_QAB = 'QAB', + + /** + * Singapore third audio + */ + AUDIO_LANGUAGE_CODE_QAC = 'QAC', + + /** + * Rumanian voice mode + */ + AUDIO_LANGUAGE_CODE_ROM = 'ROM', + + /** + * Russian voice mode + */ + AUDIO_LANGUAGE_CODE_RUS = 'RUS', + + /** + * Slovakia voice mode + */ + AUDIO_LANGUAGE_CODE_SLK = 'SLK', + + /** + * Sotho, Southern voice mode + */ + AUDIO_LANGUAGE_CODE_SOT = 'SOT', + + /** + * Spanish voice mode + */ + AUDIO_LANGUAGE_CODE_SPA = 'SPA', + + /** + * Serbian voice mode + */ + AUDIO_LANGUAGE_CODE_SRP = 'SRP', + + /** + * Swati voice mode + */ + AUDIO_LANGUAGE_CODE_SSW = 'SSW', + + /** + * Swahili voice mode + */ + AUDIO_LANGUAGE_CODE_SWA = 'SWA', + + /** + * Swedish voice mode + */ + AUDIO_LANGUAGE_CODE_SWE = 'SWE', + + /** + * tamil voice mode + */ + AUDIO_LANGUAGE_CODE_TAM = 'TAM', + + /** + * India-Telugu voice mode + */ + AUDIO_LANGUAGE_CODE_TEL = 'TEL', + + /** + * Thai voice mode + */ + AUDIO_LANGUAGE_CODE_THA = 'THA', + + /** + * Thai voice mode + */ + AUDIO_LANGUAGE_CODE_TSN = 'TSN', + + /** + * Tsonga voice mode + */ + AUDIO_LANGUAGE_CODE_TSO = 'TSO', + + /** + * Turkish voice mode + */ + AUDIO_LANGUAGE_CODE_TUR = 'TUR', + + /** + * Twi voice mode + */ + AUDIO_LANGUAGE_CODE_TWI = 'TWI', + + /** + * Ukraine voice mode + */ + AUDIO_LANGUAGE_CODE_UKR = 'UKR', + + /** + * valencia voice mode + */ + AUDIO_LANGUAGE_CODE_VAL = 'VAL', + + /** + * Venda voice mode + */ + AUDIO_LANGUAGE_CODE_VEN = 'VEN', + + /** + * Vietnamese voice mode + */ + AUDIO_LANGUAGE_CODE_VIE = 'VIE', + + /** + * Welsh voice mode + */ + AUDIO_LANGUAGE_CODE_WEL = 'WEL', + + /** + * Xhosa voice mode + */ + AUDIO_LANGUAGE_CODE_XHO = 'XHO', + + /** + * Ghana-Kasem voice mode + */ + AUDIO_LANGUAGE_CODE_XSM = 'XSM', + + /** + * Yoruba voice mode + */ + AUDIO_LANGUAGE_CODE_YOR = 'YOR', + + /** + * Chinese (Cantonese) voice mode + */ + AUDIO_LANGUAGE_CODE_YUE = 'YUE', + + /** + * Malaysia-Chinense voice mode + */ + AUDIO_LANGUAGE_CODE_ZHO = 'ZHO', + + /** + * Zulu voice mode + */ + AUDIO_LANGUAGE_CODE_ZUL = 'ZUL', + + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_VERY_FAST = 'VERY_FAST', + + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_FAST = 'FAST', + + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_NORMAL = 'NORMAL', + + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_SLOW = 'SLOW', + + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_VERY_SLOW = 'VERY_SLOW', + + /** + * caption style + */ + CAPTION_STYLE_DEFAULT = 0, + + /** + * caption style + */ + CAPTION_STYLE_BOLD = 1, + + /** + * caption style + */ + CAPTION_STYLE_ITALIC = 2, +} + +/** + * Defines constants for TV information keys. + */ +export enum TvInfoKey { + /** + * Whether the application can be executed in the background + */ + TV_VIEWER_BG_EXECUTABLE = 0, +} + +/** + * Defines constants for TV information values. + */ +export enum TvInfoValue { + /** + * Background execution is not supported + */ + TV_VIEWER_BG_NOT_EXECUTABLE = 0, + + /** + * Background execution is supported + */ + TV_VIEWER_BG_EXECUTABLE = 1, +} + +/** + * This module defines the TV settings value functionalities provided by the Tizen Samsung TV Product API. + * @since 2.3 + */ +export interface TvInfoManager { + /** + * Caption settings key + */ + TvInfoMenuKey: { + /** + * Caption On/Off + * expected value TvInfoMenuValue + * unsigned long CAPTION_OFF = 0; + * unsigned long CAPTION_ON = 1; + */ + CAPTION_ONOFF_KEY: 0; + /** + * Caption mode. Default: Service 6 + * expected value TvInfoMenuValue + * unsigned long CAPTION_MODE_DEFAULT = 0; + * unsigned long CAPTION_MODE_SERVICE1 = 1; + * unsigned long CAPTION_MODE_SERVICE2 = 2; + * unsigned long CAPTION_MODE_SERVICE3 = 3; + * unsigned long CAPTION_MODE_SERVICE4 = 4; + * unsigned long CAPTION_MODE_SERVICE5 = 5; + * unsigned long CAPTION_MODE_SERVICE6 = 6; + * unsigned long CAPTION_MODE_CC1 = 7; + * unsigned long CAPTION_MODE_CC2 = 8; + * unsigned long CAPTION_MODE_CC3 = 9; + * unsigned long CAPTION_MODE_CC4 = 10; + * unsigned long CAPTION_MODE_TEXT1 = 11; + * unsigned long CAPTION_MODE_TEXT2 = 12; + * unsigned long CAPTION_MODE_TEXT3 = 13; + * unsigned long CAPTION_MODE_TEXT4 = 14; + */ + CAPTION_MODE_KEY: 1; + /** + * expected value TvInfoMenuValue + * unsigned long CAPTION_SIZE_DEFAULT = 0; + * unsigned long CAPTION_SIZE_SMALL = 1; + * unsigned long CAPTION_SIZE_STANDARD = 2; + * unsigned long CAPTION_SIZE_LARGE = 3; + * unsigned long CAPTION_SIZE_EXTRA_LARGE = 4; + */ + CAPTION_FONT_SIZE_KEY: 2; + /** + * Caption font style. Default: Style 6 + * expected value TvInfoMenuValue + * unsigned long CAPTION_FONT_DEFAULT = 0; + * unsigned long CAPTION_FONT_STYLE0 = 1; + * unsigned long CAPTION_FONT_STYLE1 = 2; + * unsigned long CAPTION_FONT_STYLE2 = 3; + * unsigned long CAPTION_FONT_STYLE3 = 4; + * unsigned long CAPTION_FONT_STYLE4 = 5; + * unsigned long CAPTION_FONT_STYLE5 = 6; + * unsigned long CAPTION_FONT_STYLE6 = 7; + */ + CAPTION_FONT_STYLE_KEY: 3; + /** + * Caption text foreground color + * expected value TvInfoMenuValue + * unsigned long CAPTION_COLOR_DEFAULT = 0; + * unsigned long CAPTION_COLOR_WHITE = 1; + * unsigned long CAPTION_COLOR_BLACK = 2; + * unsigned long CAPTION_COLOR_RED = 3; + * unsigned long CAPTION_COLOR_GREEN = 4; + * unsigned long CAPTION_COLOR_BLUE = 5; + * unsigned long CAPTION_COLOR_YELLOW = 6; + * unsigned long CAPTION_COLOR_MAGENTA = 7; + * unsigned long CAPTION_COLOR_CYAN = 8; + */ + CAPTION_FG_COLOR_KEY: 4; + /** + * Caption text foreground opacity + * expected value TvInfoMenuValue + * unsigned long CAPTION_OPACITY_SOLID = 0; + * unsigned long CAPTION_OPACITY_FLASH = 1; + * unsigned long CAPTION_OPACITY_TRANSLUCENT = 2; + * unsigned long CAPTION_OPACITY_TRANSPARENT = 3; + * unsigned long CAPTION_OPACITY_DEFAULT = 4; + * unsigned long CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5; + * unsigned long CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6; + */ + CAPTION_FG_OPACITY_KEY: 5; + /** + * Caption text background color + * expected value TvInfoMenuValue + * unsigned long CAPTION_COLOR_DEFAULT = 0; + * unsigned long CAPTION_COLOR_WHITE = 1; + * unsigned long CAPTION_COLOR_BLACK = 2; + * unsigned long CAPTION_COLOR_RED = 3; + * unsigned long CAPTION_COLOR_GREEN = 4; + * unsigned long CAPTION_COLOR_BLUE = 5; + * unsigned long CAPTION_COLOR_YELLOW = 6; + * unsigned long CAPTION_COLOR_MAGENTA = 7; + * unsigned long CAPTION_COLOR_CYAN = 8; + */ + CAPTION_BG_COLOR_KEY: 6; + /** + * Caption text background opacity + * expected value TvInfoMenuValue + * unsigned long CAPTION_OPACITY_SOLID = 0; + * unsigned long CAPTION_OPACITY_FLASH = 1; + * unsigned long CAPTION_OPACITY_TRANSLUCENT = 2; + * unsigned long CAPTION_OPACITY_TRANSPARENT = 3; + * unsigned long CAPTION_OPACITY_DEFAULT = 4; + * unsigned long CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5; + * unsigned long CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6; + */ + CAPTION_BG_OPACITY_KEY: 7; + /** + * Caption text edge type + * expected value TvInfoMenuValue + * unsigned long CAPTION_EDGE_NONE = 0; + * unsigned long CAPTION_EDGE_RAISED = 1; + * unsigned long CAPTION_EDGE_DEPRESSED = 2; + * unsigned long CAPTION_EDGE_UNIFORM = 3; + * unsigned long CAPTION_EDGE_DROP_SHADOWED = 4; + */ + CAPTION_EDGE_TYPE_KEY: 8; + /** + * Caption text edge color + * expected value TvInfoMenuValue + * unsigned long CAPTION_COLOR_DEFAULT = 0; + * unsigned long CAPTION_COLOR_WHITE = 1; + * unsigned long CAPTION_COLOR_BLACK = 2; + * unsigned long CAPTION_COLOR_RED = 3; + * unsigned long CAPTION_COLOR_GREEN = 4; + * unsigned long CAPTION_COLOR_BLUE = 5; + * unsigned long CAPTION_COLOR_YELLOW = 6; + * unsigned long CAPTION_COLOR_MAGENTA = 7; + * unsigned long CAPTION_COLOR_CYAN = 8; + */ + CAPTION_EDGE_COLOR_KEY: 9; + /** + * Caption text window color + * expected value TvInfoMenuValue + * unsigned long CAPTION_COLOR_DEFAULT = 0; + * unsigned long CAPTION_COLOR_WHITE = 1; + * unsigned long CAPTION_COLOR_BLACK = 2; + * unsigned long CAPTION_COLOR_RED = 3; + * unsigned long CAPTION_COLOR_GREEN = 4; + * unsigned long CAPTION_COLOR_BLUE = 5; + * unsigned long CAPTION_COLOR_YELLOW = 6; + * unsigned long CAPTION_COLOR_MAGENTA = 7; + * unsigned long CAPTION_COLOR_CYAN = 8; + */ + CAPTION_WINDOW_COLOR_KEY: 10; + /** + * Caption text window opacity + * expected value TvInfoMenuValue + * unsigned long CAPTION_OPACITY_SOLID = 0; + * unsigned long CAPTION_OPACITY_FLASH = 1; + * unsigned long CAPTION_OPACITY_TRANSLUCENT = 2; + * unsigned long CAPTION_OPACITY_TRANSPARENT = 3; + * unsigned long CAPTION_OPACITY_DEFAULT = 4; + * unsigned long CAPTION_OPACITY_HIGHLY_TRANSLUCENT = 5; + * unsigned long CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT = 6; + */ + CAPTION_WINDOW_OPACITY_KEY: 11; + /** + * Focus zoom menu value + * expected value TvInfoMenuValue + * unsigned long OFF = 0; + * unsigned long ON = 1; + */ + ACCESSIBILITY_FOCUS_ZOOM: 12; + /** + * High Contrast menu value + * expected value TvInfoMenuValue + * unsigned long OFF = 0; + * unsigned long ON = 1; + */ + ACCESSIBILITY_HIGH_CONTRAST: 13; + /** + * Channel-bound apps ticker menu value + * expected value DOMString + * "OFF", "ON" + * @since 2.3 + * @note `deprecated` 3.0 + */ + SMARTHUB_CHANNEL_BOUND_APPS_TICKER: 14; + /** + * Voice guide menu value + * expected value TvInfoMenuValue + * unsigned long OFF = 0; + * unsigned long ON = 1; + */ + VOICE_GUIDE_KEY: 15; + /** + * Subtitles On/Off + * expected value TvInfoMenuValue + * unsigned long OFF = 0; + * unsigned long ON = 1; + */ + SUBTITLE_ONOFF_KEY: 16; + /** + * Subtitle mode + * expected value TvInfoMenuValue + * unsigned long SUBTITLE_NORMAL = 0; + * unsigned long SUBTITLE_HEARING_IMMPEARED = 1; + */ + SUBTITLE_MODE_KEY: 17; + /** + * Primary Audio Language + * expected value TvInfoMenuValue + * DOMString AUDIO_LANGUAGE_CODE_AFR = "AFR"; + * DOMString AUDIO_LANGUAGE_CODE_AKA = "AKA"; + * DOMString AUDIO_LANGUAGE_CODE_AMH = "AMH"; + * DOMString AUDIO_LANGUAGE_CODE_ARA = "ARA"; + * DOMString AUDIO_LANGUAGE_CODE_ASM = "ASM"; + * DOMString AUDIO_LANGUAGE_CODE_BEN = "BEN"; + * DOMString AUDIO_LANGUAGE_CODE_BUL = "BUL"; + * DOMString AUDIO_LANGUAGE_CODE_CAT = "CAT"; + * DOMString AUDIO_LANGUAGE_CODE_CHI = "CHI"; + * DOMString AUDIO_LANGUAGE_CODE_CMN = "CMN"; + * DOMString AUDIO_LANGUAGE_CODE_CZE = "CZE"; + * DOMString AUDIO_LANGUAGE_CODE_DAG = "DAG"; + * DOMString AUDIO_LANGUAGE_CODE_DAN = "DAN"; + * DOMString AUDIO_LANGUAGE_CODE_DUT = "DUT"; + * DOMString AUDIO_LANGUAGE_CODE_ENG = "ENG"; + * DOMString AUDIO_LANGUAGE_CODE_EST = "EST"; + * DOMString AUDIO_LANGUAGE_CODE_EUS = "EUS"; + * DOMString AUDIO_LANGUAGE_CODE_EWE = "EWE"; + * DOMString AUDIO_LANGUAGE_CODE_FIN = "FIN"; + * DOMString AUDIO_LANGUAGE_CODE_FRE = "FRE"; + * DOMString AUDIO_LANGUAGE_CODE_GAA = "GAA"; + * DOMString AUDIO_LANGUAGE_CODE_GER = "GER"; + * DOMString AUDIO_LANGUAGE_CODE_GLA = "GLA"; + * DOMString AUDIO_LANGUAGE_CODE_GLG = "GLG"; + * DOMString AUDIO_LANGUAGE_CODE_GOS = "GOS"; + * DOMString AUDIO_LANGUAGE_CODE_GRE = "GRE"; + * DOMString AUDIO_LANGUAGE_CODE_GUJ = "GUJ"; + * DOMString AUDIO_LANGUAGE_CODE_HAU = "HAU"; + * DOMString AUDIO_LANGUAGE_CODE_HEB = "HEB"; + * DOMString AUDIO_LANGUAGE_CODE_HIN = "HIN"; + * DOMString AUDIO_LANGUAGE_CODE_HRV = "HRV"; + * DOMString AUDIO_LANGUAGE_CODE_HUN = "HUN"; + * DOMString AUDIO_LANGUAGE_CODE_IGB = "IGB"; + * DOMString AUDIO_LANGUAGE_CODE_IND = "IND"; + * DOMString AUDIO_LANGUAGE_CODE_IRI = "IRI"; + * DOMString AUDIO_LANGUAGE_CODE_ITA = "ITA"; + * DOMString AUDIO_LANGUAGE_CODE_JPN = "JPN"; + * DOMString AUDIO_LANGUAGE_CODE_KAN = "KAN"; + * DOMString AUDIO_LANGUAGE_CODE_KOK = "KOK"; + * DOMString AUDIO_LANGUAGE_CODE_KOR = "KOR"; + * DOMString AUDIO_LANGUAGE_CODE_LAV = "LAV"; + * DOMString AUDIO_LANGUAGE_CODE_LIT = "LIT"; + * DOMString AUDIO_LANGUAGE_CODE_MAL = "MAL"; + * DOMString AUDIO_LANGUAGE_CODE_MAO = "MAO"; + * DOMString AUDIO_LANGUAGE_CODE_MAR = "MAR"; + * DOMString AUDIO_LANGUAGE_CODE_MSA = "MSA"; + * DOMString AUDIO_LANGUAGE_CODE_NBL = "NBL"; + * DOMString AUDIO_LANGUAGE_CODE_NOR = "NOR"; + * DOMString AUDIO_LANGUAGE_CODE_NSO = "NSO"; + * DOMString AUDIO_LANGUAGE_CODE_NZI = "NZI"; + * DOMString AUDIO_LANGUAGE_CODE_ORI = "ORI"; + * DOMString AUDIO_LANGUAGE_CODE_PAN = "PAN"; + * DOMString AUDIO_LANGUAGE_CODE_PER = "PER"; + * DOMString AUDIO_LANGUAGE_CODE_POL = "POL"; + * DOMString AUDIO_LANGUAGE_CODE_POR = "POR"; + * DOMString AUDIO_LANGUAGE_CODE_QAA = "QAA"; + * DOMString AUDIO_LANGUAGE_CODE_QAB = "QAB"; + * DOMString AUDIO_LANGUAGE_CODE_QAC = "QAC"; + * DOMString AUDIO_LANGUAGE_CODE_ROM = "ROM"; + * DOMString AUDIO_LANGUAGE_CODE_RUS = "RUS"; + * DOMString AUDIO_LANGUAGE_CODE_SLK = "SLK"; + * DOMString AUDIO_LANGUAGE_CODE_SOT = "SOT"; + * DOMString AUDIO_LANGUAGE_CODE_SPA = "SPA"; + * DOMString AUDIO_LANGUAGE_CODE_SRP = "SRP"; + * DOMString AUDIO_LANGUAGE_CODE_SSW = "SSW"; + * DOMString AUDIO_LANGUAGE_CODE_SWA = "SWA"; + * DOMString AUDIO_LANGUAGE_CODE_SWE = "SWE"; + * DOMString AUDIO_LANGUAGE_CODE_TAM = "TAM"; + * DOMString AUDIO_LANGUAGE_CODE_TEL = "TEL"; + * DOMString AUDIO_LANGUAGE_CODE_THA = "THA"; + * DOMString AUDIO_LANGUAGE_CODE_TSN = "TSN"; + * DOMString AUDIO_LANGUAGE_CODE_TSO = "TSO"; + * DOMString AUDIO_LANGUAGE_CODE_TUR = "TUR"; + * DOMString AUDIO_LANGUAGE_CODE_TWI = "TWI"; + * DOMString AUDIO_LANGUAGE_CODE_UKR = "UKR"; + * DOMString AUDIO_LANGUAGE_CODE_VAL = "VAL"; + * DOMString AUDIO_LANGUAGE_CODE_VEN = "VEN"; + * DOMString AUDIO_LANGUAGE_CODE_VIE = "VIE"; + * DOMString AUDIO_LANGUAGE_CODE_WEL = "WEL"; + * DOMString AUDIO_LANGUAGE_CODE_XHO = "XHO"; + * DOMString AUDIO_LANGUAGE_CODE_XSM = "XSM"; + * DOMString AUDIO_LANGUAGE_CODE_YOR = "YOR"; + * DOMString AUDIO_LANGUAGE_CODE_YUE = "YUE"; + * DOMString AUDIO_LANGUAGE_CODE_ZHO = "ZHO"; + * DOMString AUDIO_LANGUAGE_CODE_ZUL = "ZUL"; + * Only the values that can be set in the menu can be set to webapi + */ + PRIMARY_AUDIO_LANGUAGE_KEY: 18; + /** + * Secondary Audio Language + * expected value TvInfoMenuValue + * DOMString AUDIO_LANGUAGE_CODE_AFR = "AFR"; + * DOMString AUDIO_LANGUAGE_CODE_AKA = "AKA"; + * DOMString AUDIO_LANGUAGE_CODE_AMH = "AMH"; + * DOMString AUDIO_LANGUAGE_CODE_ARA = "ARA"; + * DOMString AUDIO_LANGUAGE_CODE_ASM = "ASM"; + * DOMString AUDIO_LANGUAGE_CODE_BEN = "BEN"; + * DOMString AUDIO_LANGUAGE_CODE_BUL = "BUL"; + * DOMString AUDIO_LANGUAGE_CODE_CAT = "CAT"; + * DOMString AUDIO_LANGUAGE_CODE_CHI = "CHI"; + * DOMString AUDIO_LANGUAGE_CODE_CMN = "CMN"; + * DOMString AUDIO_LANGUAGE_CODE_CZE = "CZE"; + * DOMString AUDIO_LANGUAGE_CODE_DAG = "DAG"; + * DOMString AUDIO_LANGUAGE_CODE_DAN = "DAN"; + * DOMString AUDIO_LANGUAGE_CODE_DUT = "DUT"; + * DOMString AUDIO_LANGUAGE_CODE_ENG = "ENG"; + * DOMString AUDIO_LANGUAGE_CODE_EST = "EST"; + * DOMString AUDIO_LANGUAGE_CODE_EUS = "EUS"; + * DOMString AUDIO_LANGUAGE_CODE_EWE = "EWE"; + * DOMString AUDIO_LANGUAGE_CODE_FIN = "FIN"; + * DOMString AUDIO_LANGUAGE_CODE_FRE = "FRE"; + * DOMString AUDIO_LANGUAGE_CODE_GAA = "GAA"; + * DOMString AUDIO_LANGUAGE_CODE_GER = "GER"; + * DOMString AUDIO_LANGUAGE_CODE_GLA = "GLA"; + * DOMString AUDIO_LANGUAGE_CODE_GLG = "GLG"; + * DOMString AUDIO_LANGUAGE_CODE_GOS = "GOS"; + * DOMString AUDIO_LANGUAGE_CODE_GRE = "GRE"; + * DOMString AUDIO_LANGUAGE_CODE_GUJ = "GUJ"; + * DOMString AUDIO_LANGUAGE_CODE_HAU = "HAU"; + * DOMString AUDIO_LANGUAGE_CODE_HEB = "HEB"; + * DOMString AUDIO_LANGUAGE_CODE_HIN = "HIN"; + * DOMString AUDIO_LANGUAGE_CODE_HRV = "HRV"; + * DOMString AUDIO_LANGUAGE_CODE_HUN = "HUN"; + * DOMString AUDIO_LANGUAGE_CODE_IGB = "IGB"; + * DOMString AUDIO_LANGUAGE_CODE_IND = "IND"; + * DOMString AUDIO_LANGUAGE_CODE_IRI = "IRI"; + * DOMString AUDIO_LANGUAGE_CODE_ITA = "ITA"; + * DOMString AUDIO_LANGUAGE_CODE_JPN = "JPN"; + * DOMString AUDIO_LANGUAGE_CODE_KAN = "KAN"; + * DOMString AUDIO_LANGUAGE_CODE_KOK = "KOK"; + * DOMString AUDIO_LANGUAGE_CODE_KOR = "KOR"; + * DOMString AUDIO_LANGUAGE_CODE_LAV = "LAV"; + * DOMString AUDIO_LANGUAGE_CODE_LIT = "LIT"; + * DOMString AUDIO_LANGUAGE_CODE_MAL = "MAL"; + * DOMString AUDIO_LANGUAGE_CODE_MAO = "MAO"; + * DOMString AUDIO_LANGUAGE_CODE_MAR = "MAR"; + * DOMString AUDIO_LANGUAGE_CODE_MSA = "MSA"; + * DOMString AUDIO_LANGUAGE_CODE_NBL = "NBL"; + * DOMString AUDIO_LANGUAGE_CODE_NOR = "NOR"; + * DOMString AUDIO_LANGUAGE_CODE_NSO = "NSO"; + * DOMString AUDIO_LANGUAGE_CODE_NZI = "NZI"; + * DOMString AUDIO_LANGUAGE_CODE_ORI = "ORI"; + * DOMString AUDIO_LANGUAGE_CODE_PAN = "PAN"; + * DOMString AUDIO_LANGUAGE_CODE_PER = "PER"; + * DOMString AUDIO_LANGUAGE_CODE_POL = "POL"; + * DOMString AUDIO_LANGUAGE_CODE_POR = "POR"; + * DOMString AUDIO_LANGUAGE_CODE_QAA = "QAA"; + * DOMString AUDIO_LANGUAGE_CODE_QAB = "QAB"; + * DOMString AUDIO_LANGUAGE_CODE_QAC = "QAC"; + * DOMString AUDIO_LANGUAGE_CODE_ROM = "ROM"; + * DOMString AUDIO_LANGUAGE_CODE_RUS = "RUS"; + * DOMString AUDIO_LANGUAGE_CODE_SLK = "SLK"; + * DOMString AUDIO_LANGUAGE_CODE_SOT = "SOT"; + * DOMString AUDIO_LANGUAGE_CODE_SPA = "SPA"; + * DOMString AUDIO_LANGUAGE_CODE_SRP = "SRP"; + * DOMString AUDIO_LANGUAGE_CODE_SSW = "SSW"; + * DOMString AUDIO_LANGUAGE_CODE_SWA = "SWA"; + * DOMString AUDIO_LANGUAGE_CODE_SWE = "SWE"; + * DOMString AUDIO_LANGUAGE_CODE_TAM = "TAM"; + * DOMString AUDIO_LANGUAGE_CODE_TEL = "TEL"; + * DOMString AUDIO_LANGUAGE_CODE_THA = "THA"; + * DOMString AUDIO_LANGUAGE_CODE_TSN = "TSN"; + * DOMString AUDIO_LANGUAGE_CODE_TSO = "TSO"; + * DOMString AUDIO_LANGUAGE_CODE_TUR = "TUR"; + * DOMString AUDIO_LANGUAGE_CODE_TWI = "TWI"; + * DOMString AUDIO_LANGUAGE_CODE_UKR = "UKR"; + * DOMString AUDIO_LANGUAGE_CODE_VAL = "VAL"; + * DOMString AUDIO_LANGUAGE_CODE_VEN = "VEN"; + * DOMString AUDIO_LANGUAGE_CODE_VIE = "VIE"; + * DOMString AUDIO_LANGUAGE_CODE_WEL = "WEL"; + * DOMString AUDIO_LANGUAGE_CODE_XHO = "XHO"; + * DOMString AUDIO_LANGUAGE_CODE_XSM = "XSM"; + * DOMString AUDIO_LANGUAGE_CODE_YOR = "YOR"; + * DOMString AUDIO_LANGUAGE_CODE_YUE = "YUE"; + * DOMString AUDIO_LANGUAGE_CODE_ZHO = "ZHO"; + * DOMString AUDIO_LANGUAGE_CODE_ZUL = "ZUL"; + * Only the values that can be set in the menu can be set to webapi + */ + SECONDARY_AUDIO_LANGUAGE_KEY: 19; + /** + * voice guide speed + * expected value TvInfoMenuValue + * DOMString VOICEGUIDE_SPEED_VERY_FAST = "VERY_FAST"; + * DOMString VOICEGUIDE_SPEED_FAST = "FAST"; + * DOMString VOICEGUIDE_SPEED_NORMAL= "NORMAL"; + * DOMString VOICEGUIDE_SPEED_SLOW = "SLOW"; + * DOMString VOICEGUIDE_SPEED_VERY_SLOW = "VERY_SLOW"; + */ + ACCESSIBILITY_VOICE_GUIDE_SPEED: 20; + /** + * caption style + * expected value TvInfoMenuValue + * unsigned long CAPTION_STYLE_DEFAULT = 0; + * unsigned long CAPTION_STYLE_BOLD = 1; + * unsigned long CAPTION_STYLE_ITALIC = 2; + */ + CAPTION_STYLE_KEY: 21; + }; + + /** + * Defines constants for TV menu settings values. + */ + TvInfoMenuValue: { + /** + * MenuValue Off + */ + OFF: 0; + /** + * MenuValue On + */ + ON: 1; + /** + * Caption Off + */ + CAPTION_OFF: 0; + /** + * Caption On + */ + CAPTION_ON: 1; + /** + * Default Mode + */ + CAPTION_MODE_DEFAULT: 0; + /** + * Service 1 + */ + CAPTION_MODE_SERVICE1: 1; + /** + * Service 2 + */ + CAPTION_MODE_SERVICE2: 2; + /** + * Service 3 + */ + CAPTION_MODE_SERVICE3: 3; + /** + * Service 4 + */ + CAPTION_MODE_SERVICE4: 4; + /** + * Service 5 + */ + CAPTION_MODE_SERVICE5: 5; + /** + * Service 6 + */ + CAPTION_MODE_SERVICE6: 6; + /** + * English (KOR Localset) + */ + CAPTION_MODE_CC1: 7; + /** + * Korean (KOR Localset) + */ + CAPTION_MODE_CC2: 8; + /** + * US Localset only + */ + CAPTION_MODE_CC3: 9; + /** + * US Localset only + */ + CAPTION_MODE_CC4: 10; + /** + * Text 1 + */ + CAPTION_MODE_TEXT1: 11; + /** + * Text 2 + */ + CAPTION_MODE_TEXT2: 12; + /** + * Text 3 + */ + CAPTION_MODE_TEXT3: 13; + /** + * Text 4 + */ + CAPTION_MODE_TEXT4: 14; + /** + * Default + */ + CAPTION_SIZE_DEFAULT: 0; + /** + * Small + */ + CAPTION_SIZE_SMALL: 1; + /** + * Standard + */ + CAPTION_SIZE_STANDARD: 2; + /** + * Large + */ + CAPTION_SIZE_LARGE: 3; + /** + * Extra large + */ + CAPTION_SIZE_EXTRA_LARGE: 4; + /** + * Default + */ + CAPTION_FONT_DEFAULT: 0; + /** + * Style 0 + */ + CAPTION_FONT_STYLE0: 1; + /** + * Style 1 + */ + CAPTION_FONT_STYLE1: 2; + /** + * Style 2 + */ + CAPTION_FONT_STYLE2: 3; + /** + * Style 3 + */ + CAPTION_FONT_STYLE3: 4; + /** + * Style 4 + */ + CAPTION_FONT_STYLE4: 5; + /** + * Style 5 + */ + CAPTION_FONT_STYLE5: 6; + /** + * Style 6 + */ + CAPTION_FONT_STYLE6: 7; + /** + * Default + */ + CAPTION_COLOR_DEFAULT: 0; + /** + * White + */ + CAPTION_COLOR_WHITE: 1; + /** + * Black + */ + CAPTION_COLOR_BLACK: 2; + /** + * Red + */ + CAPTION_COLOR_RED: 3; + /** + * Green + */ + CAPTION_COLOR_GREEN: 4; + /** + * Blue + */ + CAPTION_COLOR_BLUE: 5; + /** + * Yellow + */ + CAPTION_COLOR_YELLOW: 6; + /** + * Magenta + */ + CAPTION_COLOR_MAGENTA: 7; + /** + * Cyan + */ + CAPTION_COLOR_CYAN: 8; + /** + * Solid + */ + CAPTION_OPACITY_SOLID: 0; + /** + * Flashing + */ + CAPTION_OPACITY_FLASH: 1; + /** + * Translucent + */ + CAPTION_OPACITY_TRANSLUCENT: 2; + /** + * Transparent + */ + CAPTION_OPACITY_TRANSPARENT: 3; + /** + * Default + */ + CAPTION_OPACITY_DEFAULT: 4; + /** + * Highly translucent + */ + CAPTION_OPACITY_HIGHLY_TRANSLUCENT: 5; + /** + * Slightly translucent + */ + CAPTION_OPACITY_SLIGHTLY_TRANSLUCENT: 6; + /** + * No edge + */ + CAPTION_EDGE_NONE: 0; + /** + * Raised + */ + CAPTION_EDGE_RAISED: 1; + /** + * Depressed + */ + CAPTION_EDGE_DEPRESSED: 2; + /** + * Uniform + */ + CAPTION_EDGE_UNIFORM: 3; + /** + * Drop shadow + */ + CAPTION_EDGE_DROP_SHADOWED: 4; + /** + * Normal subtitles + */ + SUBTITLE_NORMAL: 0; + /** + * Subtitles for the hearing-immpeared + */ + SUBTITLE_HEARING_IMMPEARED: 1; + /** + * Afrikaans voice mode + */ + AUDIO_LANGUAGE_CODE_AFR: 'AFR'; + /** + * Akan voice mode + */ + AUDIO_LANGUAGE_CODE_AKA: 'AKA'; + /** + * Amharic voice mode + */ + AUDIO_LANGUAGE_CODE_AMH: 'AMH'; + /** + * Arab voice mode + */ + AUDIO_LANGUAGE_CODE_ARA: 'ARA'; + /** + * India-Assamese voice mode + */ + AUDIO_LANGUAGE_CODE_ASM: 'ASM'; + /** + * India-Bengali voice mode + */ + AUDIO_LANGUAGE_CODE_BEN: 'BEN'; + /** + * Bulgarian voice mode + */ + AUDIO_LANGUAGE_CODE_BUL: 'BUL'; + /** + * catala voice mode + */ + AUDIO_LANGUAGE_CODE_CAT: 'CAT'; + /** + * Chinese voice mode + */ + AUDIO_LANGUAGE_CODE_CHI: 'CHI'; + /** + * Chinese (Mandarin) voice mode + */ + AUDIO_LANGUAGE_CODE_CMN: 'CMN'; + /** + * Czech voice mode + */ + AUDIO_LANGUAGE_CODE_CZE: 'CZE'; + /** + * Ghana-Dagbani voice mode + */ + AUDIO_LANGUAGE_CODE_DAG: 'DAG'; + /** + * Danish voice mode + */ + AUDIO_LANGUAGE_CODE_DAN: 'DAN'; + /** + * Dutch voice mode + */ + AUDIO_LANGUAGE_CODE_DUT: 'DUT'; + /** + * English voice mode + */ + AUDIO_LANGUAGE_CODE_ENG: 'ENG'; + /** + * Estonia voice mode + */ + AUDIO_LANGUAGE_CODE_EST: 'EST'; + /** + * basque voice mode + */ + AUDIO_LANGUAGE_CODE_EUS: 'EUS'; + /** + * Ewe voice mode + */ + AUDIO_LANGUAGE_CODE_EWE: 'EWE'; + /** + * Finnish voice mode + */ + AUDIO_LANGUAGE_CODE_FIN: 'FIN'; + /** + * French voice mode + */ + AUDIO_LANGUAGE_CODE_FRE: 'FRE'; + /** + * Gaa voice mode + */ + AUDIO_LANGUAGE_CODE_GAA: 'GAA'; + /** + * German voice mode + */ + AUDIO_LANGUAGE_CODE_GER: 'GER'; + /** + * Gaelic voice mode + */ + AUDIO_LANGUAGE_CODE_GLA: 'GLA'; + /** + * Galician voice mode + */ + AUDIO_LANGUAGE_CODE_GLG: 'GLG'; + /** + * Netherlands private code + */ + AUDIO_LANGUAGE_CODE_GOS: 'GOS'; + /** + * Greek voice mode + */ + AUDIO_LANGUAGE_CODE_GRE: 'GRE'; + /** + * India-Gujarati voice mode + */ + AUDIO_LANGUAGE_CODE_GUJ: 'GUJ'; + /** + * Hausa voice mode + */ + AUDIO_LANGUAGE_CODE_HAU: 'HAU'; + /** + * Hebrew voice mode + */ + AUDIO_LANGUAGE_CODE_HEB: 'HEB'; + /** + * Hindi voice mode + */ + AUDIO_LANGUAGE_CODE_HIN: 'HIN'; + /** + * Croatian voice mode + */ + AUDIO_LANGUAGE_CODE_HRV: 'HRV'; + /** + * Hungarian voice mode + */ + AUDIO_LANGUAGE_CODE_HUN: 'HUN'; + /** + * Igbo voice mode + */ + AUDIO_LANGUAGE_CODE_IGB: 'IGB'; + /** + * Indonesia voice mode + */ + AUDIO_LANGUAGE_CODE_IND: 'IND'; + /** + * Irish voice mode + */ + AUDIO_LANGUAGE_CODE_IRI: 'IRI'; + /** + * Italian voice mode + */ + AUDIO_LANGUAGE_CODE_ITA: 'ITA'; + /** + * Japanes voice mode + */ + AUDIO_LANGUAGE_CODE_JPN: 'JPN'; + /** + * India-Kannada voice mode + */ + AUDIO_LANGUAGE_CODE_KAN: 'KAN'; + /** + * India-Kokani voice mode + */ + AUDIO_LANGUAGE_CODE_KOK: 'KOK'; + /** + * Korean voice mode + */ + AUDIO_LANGUAGE_CODE_KOR: 'KOR'; + /** + * Latvian voice mode + */ + AUDIO_LANGUAGE_CODE_LAV: 'LAV'; + /** + * Lithuanian voice mode + */ + AUDIO_LANGUAGE_CODE_LIT: 'LIT'; + /** + * India-Malayalam voice mode + */ + AUDIO_LANGUAGE_CODE_MAL: 'MAL'; + /** + * Maori voice mode + */ + AUDIO_LANGUAGE_CODE_MAO: 'MAO'; + /** + * Marathi voice mode + */ + AUDIO_LANGUAGE_CODE_MAR: 'MAR'; + /** + * India-Marathi voice mode + */ + AUDIO_LANGUAGE_CODE_MSA: 'MSA'; + /** + * Ndebele voice mode + */ + AUDIO_LANGUAGE_CODE_NBL: 'NBL'; + /** + * Norwegian voice mode + */ + AUDIO_LANGUAGE_CODE_NOR: 'NOR'; + /** + * Sotho, Northern voice mode + */ + AUDIO_LANGUAGE_CODE_NSO: 'NSO'; + /** + * Nzema voice mode + */ + AUDIO_LANGUAGE_CODE_NZI: 'NZI'; + /** + * India-Oriya voice mode + */ + AUDIO_LANGUAGE_CODE_ORI: 'ORI'; + /** + * India-Punjabi voice mode + */ + AUDIO_LANGUAGE_CODE_PAN: 'PAN'; + /** + * Persisian voice mode + */ + AUDIO_LANGUAGE_CODE_PER: 'PER'; + /** + * Polish voice mode + */ + AUDIO_LANGUAGE_CODE_POL: 'POL'; + /** + * Portuguese voice mode + */ + AUDIO_LANGUAGE_CODE_POR: 'POR'; + /** + * Singapore preffered audio. + */ + AUDIO_LANGUAGE_CODE_QAA: 'QAA'; + /** + * Singapore secondary audio. + */ + AUDIO_LANGUAGE_CODE_QAB: 'QAB'; + /** + * Singapore third audio + */ + AUDIO_LANGUAGE_CODE_QAC: 'QAC'; + /** + * Rumanian voice mode + */ + AUDIO_LANGUAGE_CODE_ROM: 'ROM'; + /** + * Russian voice mode + */ + AUDIO_LANGUAGE_CODE_RUS: 'RUS'; + /** + * Slovakia voice mode + */ + AUDIO_LANGUAGE_CODE_SLK: 'SLK'; + /** + * Sotho, Southern voice mode + */ + AUDIO_LANGUAGE_CODE_SOT: 'SOT'; + /** + * Spanish voice mode + */ + AUDIO_LANGUAGE_CODE_SPA: 'SPA'; + /** + * Serbian voice mode + */ + AUDIO_LANGUAGE_CODE_SRP: 'SRP'; + /** + * Swati voice mode + */ + AUDIO_LANGUAGE_CODE_SSW: 'SSW'; + /** + * Swahili voice mode + */ + AUDIO_LANGUAGE_CODE_SWA: 'SWA'; + /** + * Swedish voice mode + */ + AUDIO_LANGUAGE_CODE_SWE: 'SWE'; + /** + * tamil voice mode + */ + AUDIO_LANGUAGE_CODE_TAM: 'TAM'; + /** + * India-Telugu voice mode + */ + AUDIO_LANGUAGE_CODE_TEL: 'TEL'; + /** + * Thai voice mode + */ + AUDIO_LANGUAGE_CODE_THA: 'THA'; + /** + * Thai voice mode + */ + AUDIO_LANGUAGE_CODE_TSN: 'TSN'; + /** + * Tsonga voice mode + */ + AUDIO_LANGUAGE_CODE_TSO: 'TSO'; + /** + * Turkish voice mode + */ + AUDIO_LANGUAGE_CODE_TUR: 'TUR'; + /** + * Twi voice mode + */ + AUDIO_LANGUAGE_CODE_TWI: 'TWI'; + /** + * Ukraine voice mode + */ + AUDIO_LANGUAGE_CODE_UKR: 'UKR'; + /** + * valencia voice mode + */ + AUDIO_LANGUAGE_CODE_VAL: 'VAL'; + /** + * Venda voice mode + */ + AUDIO_LANGUAGE_CODE_VEN: 'VEN'; + /** + * Vietnamese voice mode + */ + AUDIO_LANGUAGE_CODE_VIE: 'VIE'; + /** + * Welsh voice mode + */ + AUDIO_LANGUAGE_CODE_WEL: 'WEL'; + /** + * Xhosa voice mode + */ + AUDIO_LANGUAGE_CODE_XHO: 'XHO'; + /** + * Ghana-Kasem voice mode + */ + AUDIO_LANGUAGE_CODE_XSM: 'XSM'; + /** + * Yoruba voice mode + */ + AUDIO_LANGUAGE_CODE_YOR: 'YOR'; + /** + * Chinese (Cantonese) voice mode + */ + AUDIO_LANGUAGE_CODE_YUE: 'YUE'; + /** + * Malaysia-Chinense voice mode + */ + AUDIO_LANGUAGE_CODE_ZHO: 'ZHO'; + /** + * Zulu voice mode + */ + AUDIO_LANGUAGE_CODE_ZUL: 'ZUL'; + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_VERY_FAST: 'VERY_FAST'; + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_FAST: 'FAST'; + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_NORMAL: 'NORMAL'; + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_SLOW: 'SLOW'; + /** + * voice guide speed + */ + VOICEGUIDE_SPEED_VERY_SLOW: 'VERY_SLOW'; + /** + * caption style + */ + CAPTION_STYLE_DEFAULT: 0; + /** + * caption style + */ + CAPTION_STYLE_BOLD: 1; + /** + * caption style + */ + CAPTION_STYLE_ITALIC: 2; + }; + + /** + * Defines constants for TV information keys. + */ + TvInfoKey: { + /** + * Whether the application can be executed in the background + */ + TV_VIEWER_BG_EXECUTABLE: 0; + }; + + /** + * Defines constants for TV information values. + */ + TvInfoValue: { + /** + * Background execution is not supported + */ + TV_VIEWER_BG_NOT_EXECUTABLE: 0; + /** + * Background execution is supported + */ + TV_VIEWER_BG_EXECUTABLE: 1; + }; + + /** + * Retrieves the plugin version number. + * @returns Plugin version + * @since 2.3 + */ + getVersion: () => string; + + /** + * Retrieves the specified caption or subtitle menu key value. + * @param key Caption or subtitle menu key + * @returns Key value + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + getMenuValue: (key: TvInfoMenuKey) => TvInfoMenuValue; + + /** + * Registers a caption menu change listener callback. + * @param listener TvInfoCaptionChangeCallback listener + * @param key Caption menu key + * @returns Listener ID + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + addCaptionChangeListener: (key: TvInfoMenuKey, listener: TvInfoCaptionChangeCallback) => number; + + /** + * Unregisters a caption menu change listener callback. + * @param listenerId TvInfoCaptionChangeCallback ID + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + removeCaptionChangeListener: (listenerId: number) => void; + + /** + * Checks whether the picture size has been resized. + * @param listenerId TvInfoCaptionChangeCallback ID + * @returns Boolean value: + * true: Yes + * false: No + * @throw WebAPIException NotSupportedError + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + isTvsPicSizeResized: () => boolean; + + /** + * Retrieves the specified TV information key value. + * @param key TV information key + * @returns Key value + * @throw WebAPIException TypeMismatchError, InvalidValuesError + * @since 2.3 + * @note Since plugin version 3.0, if a parameter value is out of range, InvalidValuesError is thrown instead of TypeMismatchError. + */ + getTvInfoValue: (key: TvInfoKey) => TvInfoValue; + + /** + * If captions are switched on in the TV menu, controls the caption visibility state. + * If captions are switched off in the TV menu, captions are not shown even if the application calls showCaption(true). + * @param show Boolean value + * @throw WebAPIException TypeMismatchError + * @since 2.3 + */ + showCaption: (show: boolean) => void; + + /** + * Enables controlling caption display dynamically from within the application. + * The application gains full permission to show and hide the captions. + * When the application launches or resumes, call registerInAppCaptionControl(true). + * When the application is sent to the background or deactivated states, you must call registerInAppCaptionControl(false). + * @param status Enable or disable dynamic caption display control. + * @throw WebAPIException TypeMismatchError + * @since 2.3 + */ + registerInAppCaptionControl: (status: boolean) => void; +} + +export interface TvInfoCaptionChangeCallback { + /** + * Defines a listener for caption setting change notifications. + * @since 2.3 + */ + (key: TvInfoMenuKey): void; +} diff --git a/types/tizen-tv-webapis/webapis.d.ts b/types/tizen-tv-webapis/webapis.d.ts new file mode 100644 index 0000000000..a4dba4feaf --- /dev/null +++ b/types/tizen-tv-webapis/webapis.d.ts @@ -0,0 +1,248 @@ +/** + * Defines the WebApi exception errors. + * @since 2.3 + */ + +export interface WebAPIException { + /** + * Error code + * @since 2.3 + */ + readonly code: number; + /** + * Error name. The attribute must return the value it was initialized with.\ + * @since 2.3 + */ + readonly name: string; + + /** + * Detailed error message + * @since 2.3 + */ + readonly message: string; + + /** + * Index is not in the allowed range + * @since 2.3 + */ + INDEX_SIZE_ERR: 1; + + /** + * Specified text range is too large + * @since 2.3 + */ + DOMSTRING_SIZE_ERR: 2; + + /** + * Operation yields an incorrect node tree + * @since 2.3 + */ + HIERARCHY_REQUEST_ERR: 3; + + /** + * Object is in the wrong document + * @since 2.3 + */ + WRONG_DOCUMENT_ERR: 4; + + /** + * String contains invalid characters + * @since 2.3 + */ + INVALID_CHARACTER_ERR: 5; + + /** + * Data specified for a node that does not support it + * @since 2.3 + */ + NO_DATA_ALLOWED_ERR: 6; + + /** + * Object cannot be modified + * @since 2.3 + */ + NO_MODIFICATION_ALLOWED_ERR: 7; + + /** + * Object not found + * @since 2.3 + */ + NOT_FOUND_ERR: 8; + + /** + * Operation not supported + * @since 2.3 + */ + NOT_SUPPORTED_ERR: 9; + + /** + * Specified attribute already in use + * @since 2.3 + */ + INUSE_ATTRIBUTE_ERR: 10; + + /** + * Object is in an invalid state + * @since 2.3 + */ + INVALID_STATE_ERR: 11; + + /** + * String does not match the expected pattern + * @since 2.3 + */ + SYNTAX_ERR: 12; + + /** + * Object cannot be modified in this way + * @since 2.3 + */ + INVALID_MODIFICATION_ERR: 13; + + /** + * Operation not allowed in XML namespaces + * @since 2.3 + */ + NAMESPACE_ERR: 14; + + /** + * Object does not support the operation or argument + * @since 2.3 + */ + INVALID_ACCESS_ERR: 15; + + /** + * Operation causes the node to fail validation + * @since 2.3 + */ + VALIDATION_ERR: 16; + + /** + * Object type does not match the expected type + * @since 2.3 + */ + TYPE_MISMATCH_ERR: 17; + + /** + * Operation insecure + * @since 2.3 + */ + SECURITY_ERR: 18; + + /** + * Network error occurred + * @since 2.3 + */ + NETWORK_ERR: 19; + + /** + * Operation aborted + * @since 2.3 + */ + ABORT_ERR: 20; + + /** + * URL provided does not match + * @since 2.3 + */ + URL_MISMATCH_ERR: 21; + + /** + * Quota exceeded + * @since 2.3 + */ + QUOTA_EXCEEDED_ERR: 22; + + /** + * Operation timed out + * @since 2.3 + */ + TIMEOUT_ERR: 23; + + /** + * Supplied node is incorrect or has an incorrect ancestor for this operation + * @since 2.3 + */ + INVALID_NODE_TYPE_ERR: 24; + + /** + * Object cannot be cloned + * @since 2.3 + */ + DATA_CLONE_ERR: 25; + + /** + * Input parameter contains an invalid value + * @since 2.3 + */ + INVALID_VALUES_ERR: 26; + + /** + * IO error + * @since 2.3 + */ + IO_ERR: 27; + + /** + * Service not available + * @since 2.3 + */ + SERVICE_NOT_AVAILABLE_ERR: 28; + + /** + * Unknown error + * @since 2.3 + */ + UNKNOWN_ERR: 9999; +} + +/** + * Defines the data returned by asynchronous method error callbacks. + * @since 2.3 + */ + +export interface WebAPIError { + /** + * Error code + * @since 2.3 + */ + readonly code: number; + + /** + * Error name. The attribute must return the value it was initialized with. + * @since 2.3 + */ + readonly name: string; + + /** + * Detailed error message + * @since 2.3 + */ + readonly message: string; +} + +/** + * Defines a generic callback for methods that do not require a return value in the success callback. + * @since 2.3 + */ + +export interface SuccessCallback { + /** + * Callback method invoked when an asynchronous call completes successfully. + * @since 2.3 + */ + (): void; +} + +/** + * Defines a generic error callback for methods that require only the error as an input parameter in the error callback. + * @since 2.3 + */ + +export interface ErrorCallback { + /** + * @descEng Callback method invoked if an error occurs. + * @since 2.3 + */ + (error: WebAPIError): void; +} diff --git a/types/tizen-tv-webapis/widgetdata.d.ts b/types/tizen-tv-webapis/widgetdata.d.ts new file mode 100644 index 0000000000..dd6bceb319 --- /dev/null +++ b/types/tizen-tv-webapis/widgetdata.d.ts @@ -0,0 +1,68 @@ +import { SuccessCallback, ErrorCallback } from './webapis'; +/** + * Defines a WebApi object instance of the Tizen Samsung TV Product API. + * The webapis.widgetdata object enables access to WidgetData API functionality. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/widgetdata + * @since 2.3 + */ +export interface WidgetDataManager { + /** + * Retrieves the plugin version number. + * @returns string value of plugin's version + * @throw WebAPIException with error type SecurityError, if the application does not have the privilege to call this method. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/widgetdata + * @since 2.3 + */ + getVersion: () => string; + + /** + * Reads encrypted data. + * @param onsuccess Callback method to invoke when the data is successfully read + * @param onerror Callback method to invoke if an error occurs + * NotFoundError, if no file was found in the local path. + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @return void + * @throw WebAPIException TypeMismatchError + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/widgetdata + * @since 4.0 + * @note If you need to share a file created by the widgetdata api with another c or c# app, you need to use one more privilege(http://tizen.org/privilege/appdir.shareddata) + */ + read: (onsuccess: SuccessCallback, onerror?: ErrorCallback) => void; + + /** + * Writes encrypted data. + * @param data Data, up to 20000 characters + * @param onsuccess Callback method to invoke when the data is successfully written + * @param onerror Callback method to invoke if an error occurs + * DOMStringSizeError, if any of the input parameters exceeds the limited size. + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @return void + * @throw WebAPIException with error type TypeMismatchError, if an input parameter is not compatible with its expected type. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/widgetdata + * @since 4.0 + * @note If you need to share a file created by the widgetdata api with another c or c# app, you need to use one more privilege(http://tizen.org/privilege/appdir.shareddata) + */ + write: (data: string, onsuccess?: SuccessCallback, onerror?: ErrorCallback) => void; + + /** + * Removes encrypted data. + * @param onsuccess Callback method to invoke when the data is successfully removed + * @param onerror Callback method to invoke if an error occurs + * NotFoundError, if no file was found in the local path. + * SecurityError, if the application does not have the privilege to call this method. + * UnknownError, if any other error occurs. + * @return void + * @throw WebAPIException with error type TypeMismatchError, if an input parameter is not compatible with its expected type. + * @privilegeLevel Public + * @privilegeName http://developer.samsung.com/privilege/widgetdata + * @since 4.0 + * @note If you need to share a file created by the widgetdata api with another c or c# app, you need to use one more privilege(http://tizen.org/privilege/appdir.shareddata) + */ + remove: (onsuccess?: SuccessCallback, onerror?: ErrorCallback) => void; +}