@firebolt-js/manage-sdk
Version:
The Firebolt Manage JS SDK
1,921 lines (1,689 loc) • 83.6 kB
TypeScript
/*
* Copyright 2021 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
export module Settings {
type LogLevel = 'WARN' | 'INFO' | 'DEBUG' | 'ERROR'
function setLogLevel(logLevel: LogLevel): void
function getLogLevel(): LogLevel
}
export module Log {
function info(...args: any[]): void
function debug(...args: any[]): void
function error(...args: any[]): void
function warn(...args: any[]): void
}
export module Events {
function listen(...args: any[]): Promise<number>
function once(...args: any[]): Promise<number>
function clear(...args: any[]): boolean
}
export module Localization {
type Event =
| 'countryCodeChanged'
| 'languageChanged'
| 'localeChanged'
| 'localityChanged'
| 'postalCodeChanged'
| 'preferredAudioLanguagesChanged'
| 'timeZoneChanged'
// Types
/**
*
*/
type Locality = string
/**
*
*/
type CountryCode = string
/**
*
*/
type Language = string
/**
*
*/
type ISO639_2Language = string
/**
*
*/
type Locale = string
/**
*
*/
type TimeZone = string
/**
* Add any platform-specific localization information in key/value pair
*
* @param {string} key Key to add additionalInfo
* @param {number} value Value to be set for additionalInfo. Value can be a number, string or boolean
*/
function addAdditionalInfo(key: string, value: number): Promise<void>
/**
* Get any platform-specific localization information
*
*/
function additionalInfo(): Promise<object>
/**
* Turn off all listeners previously registered from this module.
*/
function clear(): boolean
/**
* Clear a specific listen by the listener ID.
*
* @param {number} id The id of the listener to clear
*/
function clear(id: number): boolean
/**
* Getter: Get the ISO 3166-1 alpha-2 code for the country device is located in
*
*/
function countryCode(): Promise<CountryCode>
/**
* Setter: Get the ISO 3166-1 alpha-2 code for the country device is located in
*
*/
function countryCode(value: CountryCode): Promise<void>
/**
* Subscriber: Get the ISO 3166-1 alpha-2 code for the country device is located in
*
*/
function countryCode(subscriber: (code: CountryCode) => void): Promise<number>
/**
* Getter: Get the ISO 639 1/2 code for the preferred language
*
* @deprecated since version 0.17.0
*/
function language(): Promise<Language>
/**
* Setter: Get the ISO 639 1/2 code for the preferred language
*
*/
function language(value: Language): Promise<void>
/**
* Subscriber: Get the ISO 639 1/2 code for the preferred language
*
*/
function language(subscriber: (lang: Language) => void): Promise<number>
/**
* Listen to all events dispatched by this module.
*
* @param {Function} callback
*/
function listen(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Getter: Get the *full* BCP 47 code, including script, region, variant, etc., for the preferred langauage/locale
*
*/
function locale(): Promise<Locale>
/**
* Setter: Get the *full* BCP 47 code, including script, region, variant, etc., for the preferred langauage/locale
*
*/
function locale(value: Locale): Promise<void>
/**
* Subscriber: Get the *full* BCP 47 code, including script, region, variant, etc., for the preferred langauage/locale
*
*/
function locale(subscriber: (locale: Locale) => void): Promise<number>
/**
* Getter: Get the locality/city the device is located in
*
*/
function locality(): Promise<Locality>
/**
* Setter: Get the locality/city the device is located in
*
*/
function locality(value: Locality): Promise<void>
/**
* Subscriber: Get the locality/city the device is located in
*
*/
function locality(subscriber: (locality: Locality) => void): Promise<number>
/**
* Listen for the first of any and all events dispatched by this module.
*
* @param {Function} callback
*/
function once(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Get the ISO 3166-1 alpha-2 code for the country device is located in
*
* @param {'countryCodeChanged'} event
* @param {Function} callback
*/
function listen(
event: 'countryCodeChanged',
callback: (data: CountryCode) => void,
): Promise<number>
/**
* Get the ISO 3166-1 alpha-2 code for the country device is located in
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'countryCodeChanged'} event
* @param {Function} callback
*/
function once(
event: 'countryCodeChanged',
callback: (data: CountryCode) => void,
): Promise<number>
/**
* Get the ISO 639 1/2 code for the preferred language
*
* @param {'languageChanged'} event
* @param {Function} callback
* @deprecated since version 0.17.0
*/
function listen(
event: 'languageChanged',
callback: (data: Language) => void,
): Promise<number>
/**
* Get the ISO 639 1/2 code for the preferred language
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'languageChanged'} event
* @param {Function} callback
* @deprecated since version 0.17.0
*/
function once(
event: 'languageChanged',
callback: (data: Language) => void,
): Promise<number>
/**
* Get the *full* BCP 47 code, including script, region, variant, etc., for the preferred langauage/locale
*
* @param {'localeChanged'} event
* @param {Function} callback
*/
function listen(
event: 'localeChanged',
callback: (data: Locale) => void,
): Promise<number>
/**
* Get the *full* BCP 47 code, including script, region, variant, etc., for the preferred langauage/locale
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'localeChanged'} event
* @param {Function} callback
*/
function once(
event: 'localeChanged',
callback: (data: Locale) => void,
): Promise<number>
/**
* Get the locality/city the device is located in
*
* @param {'localityChanged'} event
* @param {Function} callback
*/
function listen(
event: 'localityChanged',
callback: (data: Locality) => void,
): Promise<number>
/**
* Get the locality/city the device is located in
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'localityChanged'} event
* @param {Function} callback
*/
function once(
event: 'localityChanged',
callback: (data: Locality) => void,
): Promise<number>
/**
* Get the postal code the device is located in
*
* @param {'postalCodeChanged'} event
* @param {Function} callback
*/
function listen(
event: 'postalCodeChanged',
callback: (data: string) => void,
): Promise<number>
/**
* Get the postal code the device is located in
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'postalCodeChanged'} event
* @param {Function} callback
*/
function once(
event: 'postalCodeChanged',
callback: (data: string) => void,
): Promise<number>
/**
* A prioritized list of ISO 639 1/2 codes for the preferred audio languages on this device.
*
* @param {'preferredAudioLanguagesChanged'} event
* @param {Function} callback
*/
function listen(
event: 'preferredAudioLanguagesChanged',
callback: (data: ISO639_2Language[]) => void,
): Promise<number>
/**
* A prioritized list of ISO 639 1/2 codes for the preferred audio languages on this device.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'preferredAudioLanguagesChanged'} event
* @param {Function} callback
*/
function once(
event: 'preferredAudioLanguagesChanged',
callback: (data: ISO639_2Language[]) => void,
): Promise<number>
/**
* Set the IANA timezone for the device
*
* @param {'timeZoneChanged'} event
* @param {Function} callback
*/
function listen(
event: 'timeZoneChanged',
callback: (data: TimeZone) => void,
): Promise<number>
/**
* Set the IANA timezone for the device
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'timeZoneChanged'} event
* @param {Function} callback
*/
function once(
event: 'timeZoneChanged',
callback: (data: TimeZone) => void,
): Promise<number>
/**
* Getter: Get the postal code the device is located in
*
*/
function postalCode(): Promise<string>
/**
* Setter: Get the postal code the device is located in
*
*/
function postalCode(value: string): Promise<void>
/**
* Subscriber: Get the postal code the device is located in
*
*/
function postalCode(subscriber: (postalCode: string) => void): Promise<number>
/**
* Getter: A prioritized list of ISO 639 1/2 codes for the preferred audio languages on this device.
*
*/
function preferredAudioLanguages(): Promise<ISO639_2Language[]>
/**
* Setter: A prioritized list of ISO 639 1/2 codes for the preferred audio languages on this device.
*
*/
function preferredAudioLanguages(value: ISO639_2Language[]): Promise<void>
/**
* Subscriber: A prioritized list of ISO 639 1/2 codes for the preferred audio languages on this device.
*
*/
function preferredAudioLanguages(
subscriber: (languages: ISO639_2Language[]) => void,
): Promise<number>
/**
* Remove any platform-specific localization information from map
*
* @param {string} key Key to remove additionalInfo
*/
function removeAdditionalInfo(key: string): Promise<void>
/**
* Getter: Set the IANA timezone for the device
*
*/
function timeZone(): Promise<TimeZone>
/**
* Setter: Set the IANA timezone for the device
*
*/
function timeZone(value: TimeZone): Promise<void>
/**
* Subscriber: Set the IANA timezone for the device
*
*/
function timeZone(subscriber: (result: TimeZone) => void): Promise<number>
}
export module Metrics {
// Types
/**
*
*/
type EventObjectPrimitives = string | number | number | boolean | null
/**
*
*/
type EventObject = {}
/**
* Inform the platform of 1st party distributor metrics.
*
* @param {string} schema The schema URI of the metric type
* @param {EventObject} data A JSON payload conforming the the provided schema
*/
function event(schema: string, data: EventObject): Promise<null>
}
export module Wifi {
// Types
/**
* Security Mode supported for Wifi
*/
enum WifiSecurityMode {
NONE = 'none',
WEP_64 = 'wep64',
WEP_128 = 'wep128',
WPA_PSK_TKIP = 'wpaPskTkip',
WPA_PSK_AES = 'wpaPskAes',
WPA_2PSK_TKIP = 'wpa2PskTkip',
WPA_2PSK_AES = 'wpa2PskAes',
WPA_ENTERPRISE_TKIP = 'wpaEnterpriseTkip',
WPA_ENTERPRISE_AES = 'wpaEnterpriseAes',
WPA_2ENTERPRISE_TKIP = 'wpa2EnterpriseTkip',
WPA_2ENTERPRISE_AES = 'wpa2EnterpriseAes',
WPA_2PSK = 'wpa2Psk',
WPA_2ENTERPRISE = 'wpa2Enterprise',
WPA_3PSK_AES = 'wpa3PskAes',
WPA_3SAE = 'wpa3Sae',
}
/**
* Security pin type for WPS(Wifi Protected Setup).
*/
enum WPSSecurityPin {
PUSH_BUTTON = 'pushButton',
PIN = 'pin',
MANUFACTURER_PIN = 'manufacturerPin',
}
/**
* Defines the timeout in seconds. If the threshold for timeout is passed for any operation without a result it will throw an error.
*/
type Timeout = number
/**
* Strength of Wifi signal, value is negative based on RSSI specification.
*/
type WifiSignalStrength = number
/**
* Wifi Frequency in Ghz, example 2.4Ghz and 5Ghz.
*/
type WifiFrequency = number
/**
* Properties of a scanned wifi list item.
*/
type AccessPoint = {
ssid?: string // Name of the wifi.
securityMode?: WifiSecurityMode // Security Mode supported for Wifi
signalStrength?: WifiSignalStrength // Strength of Wifi signal, value is negative based on RSSI specification.
frequency?: WifiFrequency // Wifi Frequency in Ghz, example 2.4Ghz and 5Ghz.
}
/**
* List of scanned Wifi networks available near the device.
*/
type AccessPointList = {
list?: AccessPoint[] // Properties of a scanned wifi list item.
}
/**
* Connect the device to the specified SSID.
*
* @param {string} ssid
* @param {string} passphrase
* @param {WifiSecurityMode} security
*/
function connect(
ssid?: string,
passphrase?: string,
security?: WifiSecurityMode,
): Promise<AccessPoint>
/**
* Disconnect the device if connected via WIFI.
*
*/
function disconnect(): Promise<void>
/**
* Scan available wifi networks in the location.
*
* @param {Timeout} timeout
*/
function scan(timeout?: Timeout): Promise<AccessPointList>
/**
* Connect to WPS
*
* @param {WPSSecurityPin} security
*/
function wps(security?: WPSSecurityPin): Promise<AccessPoint>
}
export module ClosedCaptions {
type Event =
| 'backgroundColorChanged'
| 'backgroundOpacityChanged'
| 'enabledChanged'
| 'fontColorChanged'
| 'fontEdgeChanged'
| 'fontEdgeColorChanged'
| 'fontFamilyChanged'
| 'fontOpacityChanged'
| 'fontSizeChanged'
| 'preferredLanguagesChanged'
| 'textAlignChanged'
| 'textAlignVerticalChanged'
| 'windowColorChanged'
| 'windowOpacityChanged'
// Types
/**
*
*/
enum FontFamily {
MONOSPACED_SERIF = 'monospaced_serif',
PROPORTIONAL_SERIF = 'proportional_serif',
MONOSPACED_SANSERIF = 'monospaced_sanserif',
PROPORTIONAL_SANSERIF = 'proportional_sanserif',
SMALLCAPS = 'smallcaps',
CURSIVE = 'cursive',
CASUAL = 'casual',
}
/**
*
*/
type FontSize = number
/**
*
*/
type Color = string
/**
*
*/
enum FontEdge {
NONE = 'none',
RAISED = 'raised',
DEPRESSED = 'depressed',
UNIFORM = 'uniform',
DROP_SHADOW_LEFT = 'drop_shadow_left',
DROP_SHADOW_RIGHT = 'drop_shadow_right',
}
/**
*
*/
type Opacity = number
/**
*
*/
type HorizontalAlignment = string
/**
*
*/
type VerticalAlignment = string
/**
*
*/
type ISO639_2Language = string
/**
* Getter: The preferred background color for displaying closed-captions, .
*
*/
function backgroundColor(): Promise<Color>
/**
* Setter: The preferred background color for displaying closed-captions, .
*
*/
function backgroundColor(value: Color): Promise<void>
/**
* Subscriber: The preferred background color for displaying closed-captions, .
*
*/
function backgroundColor(subscriber: (color: Color) => void): Promise<number>
/**
* Getter: The preferred opacity for displaying closed-captions backgrounds.
*
*/
function backgroundOpacity(): Promise<Opacity>
/**
* Setter: The preferred opacity for displaying closed-captions backgrounds.
*
*/
function backgroundOpacity(value: Opacity): Promise<void>
/**
* Subscriber: The preferred opacity for displaying closed-captions backgrounds.
*
*/
function backgroundOpacity(
subscriber: (opacity: Opacity) => void,
): Promise<number>
/**
* Turn off all listeners previously registered from this module.
*/
function clear(): boolean
/**
* Clear a specific listen by the listener ID.
*
* @param {number} id The id of the listener to clear
*/
function clear(id: number): boolean
/**
* Getter: Whether or not closed-captions are enabled.
*
*/
function enabled(): Promise<boolean>
/**
* Setter: Whether or not closed-captions are enabled.
*
*/
function enabled(value: boolean): Promise<void>
/**
* Subscriber: Whether or not closed-captions are enabled.
*
*/
function enabled(subscriber: (enabled: boolean) => void): Promise<number>
/**
* Getter: The preferred font color for displaying closed-captions.
*
*/
function fontColor(): Promise<Color>
/**
* Setter: The preferred font color for displaying closed-captions.
*
*/
function fontColor(value: Color): Promise<void>
/**
* Subscriber: The preferred font color for displaying closed-captions.
*
*/
function fontColor(subscriber: (color: Color) => void): Promise<number>
/**
* Getter: The preferred font edge style for displaying closed-captions.
*
*/
function fontEdge(): Promise<FontEdge>
/**
* Setter: The preferred font edge style for displaying closed-captions.
*
*/
function fontEdge(value: FontEdge): Promise<void>
/**
* Subscriber: The preferred font edge style for displaying closed-captions.
*
*/
function fontEdge(subscriber: (edge: FontEdge) => void): Promise<number>
/**
* Getter: The preferred font edge color for displaying closed-captions.
*
*/
function fontEdgeColor(): Promise<Color>
/**
* Setter: The preferred font edge color for displaying closed-captions.
*
*/
function fontEdgeColor(value: Color): Promise<void>
/**
* Subscriber: The preferred font edge color for displaying closed-captions.
*
*/
function fontEdgeColor(subscriber: (color: Color) => void): Promise<number>
/**
* Getter: The preferred font family for displaying closed-captions.
*
*/
function fontFamily(): Promise<FontFamily>
/**
* Setter: The preferred font family for displaying closed-captions.
*
*/
function fontFamily(value: FontFamily): Promise<void>
/**
* Subscriber: The preferred font family for displaying closed-captions.
*
*/
function fontFamily(subscriber: (family: FontFamily) => void): Promise<number>
/**
* Getter: The preferred opacity for displaying closed-captions characters.
*
*/
function fontOpacity(): Promise<Opacity>
/**
* Setter: The preferred opacity for displaying closed-captions characters.
*
*/
function fontOpacity(value: Opacity): Promise<void>
/**
* Subscriber: The preferred opacity for displaying closed-captions characters.
*
*/
function fontOpacity(subscriber: (opacity: Opacity) => void): Promise<number>
/**
* Getter: The preferred font size for displaying closed-captions.
*
*/
function fontSize(): Promise<FontSize>
/**
* Setter: The preferred font size for displaying closed-captions.
*
*/
function fontSize(value: FontSize): Promise<void>
/**
* Subscriber: The preferred font size for displaying closed-captions.
*
*/
function fontSize(subscriber: (size: FontSize) => void): Promise<number>
/**
* Listen to all events dispatched by this module.
*
* @param {Function} callback
*/
function listen(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* The preferred background color for displaying closed-captions, .
*
* @param {'backgroundColorChanged'} event
* @param {Function} callback
*/
function listen(
event: 'backgroundColorChanged',
callback: (data: Color) => void,
): Promise<number>
/**
* The preferred background color for displaying closed-captions, .
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'backgroundColorChanged'} event
* @param {Function} callback
*/
function once(
event: 'backgroundColorChanged',
callback: (data: Color) => void,
): Promise<number>
/**
* The preferred opacity for displaying closed-captions backgrounds.
*
* @param {'backgroundOpacityChanged'} event
* @param {Function} callback
*/
function listen(
event: 'backgroundOpacityChanged',
callback: (data: Opacity) => void,
): Promise<number>
/**
* The preferred opacity for displaying closed-captions backgrounds.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'backgroundOpacityChanged'} event
* @param {Function} callback
*/
function once(
event: 'backgroundOpacityChanged',
callback: (data: Opacity) => void,
): Promise<number>
/**
* Listen for the first of any and all events dispatched by this module.
*
* @param {Function} callback
*/
function once(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Whether or not closed-captions are enabled.
*
* @param {'enabledChanged'} event
* @param {Function} callback
*/
function listen(
event: 'enabledChanged',
callback: (data: boolean) => void,
): Promise<number>
/**
* Whether or not closed-captions are enabled.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'enabledChanged'} event
* @param {Function} callback
*/
function once(
event: 'enabledChanged',
callback: (data: boolean) => void,
): Promise<number>
/**
* The preferred font color for displaying closed-captions.
*
* @param {'fontColorChanged'} event
* @param {Function} callback
*/
function listen(
event: 'fontColorChanged',
callback: (data: Color) => void,
): Promise<number>
/**
* The preferred font color for displaying closed-captions.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'fontColorChanged'} event
* @param {Function} callback
*/
function once(
event: 'fontColorChanged',
callback: (data: Color) => void,
): Promise<number>
/**
* The preferred font edge style for displaying closed-captions.
*
* @param {'fontEdgeChanged'} event
* @param {Function} callback
*/
function listen(
event: 'fontEdgeChanged',
callback: (data: FontEdge) => void,
): Promise<number>
/**
* The preferred font edge style for displaying closed-captions.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'fontEdgeChanged'} event
* @param {Function} callback
*/
function once(
event: 'fontEdgeChanged',
callback: (data: FontEdge) => void,
): Promise<number>
/**
* The preferred font edge color for displaying closed-captions.
*
* @param {'fontEdgeColorChanged'} event
* @param {Function} callback
*/
function listen(
event: 'fontEdgeColorChanged',
callback: (data: Color) => void,
): Promise<number>
/**
* The preferred font edge color for displaying closed-captions.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'fontEdgeColorChanged'} event
* @param {Function} callback
*/
function once(
event: 'fontEdgeColorChanged',
callback: (data: Color) => void,
): Promise<number>
/**
* The preferred font family for displaying closed-captions.
*
* @param {'fontFamilyChanged'} event
* @param {Function} callback
*/
function listen(
event: 'fontFamilyChanged',
callback: (data: FontFamily) => void,
): Promise<number>
/**
* The preferred font family for displaying closed-captions.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'fontFamilyChanged'} event
* @param {Function} callback
*/
function once(
event: 'fontFamilyChanged',
callback: (data: FontFamily) => void,
): Promise<number>
/**
* The preferred opacity for displaying closed-captions characters.
*
* @param {'fontOpacityChanged'} event
* @param {Function} callback
*/
function listen(
event: 'fontOpacityChanged',
callback: (data: Opacity) => void,
): Promise<number>
/**
* The preferred opacity for displaying closed-captions characters.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'fontOpacityChanged'} event
* @param {Function} callback
*/
function once(
event: 'fontOpacityChanged',
callback: (data: Opacity) => void,
): Promise<number>
/**
* The preferred font size for displaying closed-captions.
*
* @param {'fontSizeChanged'} event
* @param {Function} callback
*/
function listen(
event: 'fontSizeChanged',
callback: (data: FontSize) => void,
): Promise<number>
/**
* The preferred font size for displaying closed-captions.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'fontSizeChanged'} event
* @param {Function} callback
*/
function once(
event: 'fontSizeChanged',
callback: (data: FontSize) => void,
): Promise<number>
/**
* A prioritized list of ISO 639-2/B codes for the preferred closed captions languages on this device.
*
* @param {'preferredLanguagesChanged'} event
* @param {Function} callback
*/
function listen(
event: 'preferredLanguagesChanged',
callback: (data: ISO639_2Language[]) => void,
): Promise<number>
/**
* A prioritized list of ISO 639-2/B codes for the preferred closed captions languages on this device.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'preferredLanguagesChanged'} event
* @param {Function} callback
*/
function once(
event: 'preferredLanguagesChanged',
callback: (data: ISO639_2Language[]) => void,
): Promise<number>
/**
* The preferred horizontal alignment for displaying closed-captions characters.
*
* @param {'textAlignChanged'} event
* @param {Function} callback
*/
function listen(
event: 'textAlignChanged',
callback: (data: HorizontalAlignment) => void,
): Promise<number>
/**
* The preferred horizontal alignment for displaying closed-captions characters.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'textAlignChanged'} event
* @param {Function} callback
*/
function once(
event: 'textAlignChanged',
callback: (data: HorizontalAlignment) => void,
): Promise<number>
/**
* The preferred horizontal alignment for displaying closed-captions characters.
*
* @param {'textAlignVerticalChanged'} event
* @param {Function} callback
*/
function listen(
event: 'textAlignVerticalChanged',
callback: (data: VerticalAlignment) => void,
): Promise<number>
/**
* The preferred horizontal alignment for displaying closed-captions characters.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'textAlignVerticalChanged'} event
* @param {Function} callback
*/
function once(
event: 'textAlignVerticalChanged',
callback: (data: VerticalAlignment) => void,
): Promise<number>
/**
* The preferred window color for displaying closed-captions, .
*
* @param {'windowColorChanged'} event
* @param {Function} callback
*/
function listen(
event: 'windowColorChanged',
callback: (data: Color) => void,
): Promise<number>
/**
* The preferred window color for displaying closed-captions, .
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'windowColorChanged'} event
* @param {Function} callback
*/
function once(
event: 'windowColorChanged',
callback: (data: Color) => void,
): Promise<number>
/**
* The preferred window opacity for displaying closed-captions backgrounds.
*
* @param {'windowOpacityChanged'} event
* @param {Function} callback
*/
function listen(
event: 'windowOpacityChanged',
callback: (data: Opacity) => void,
): Promise<number>
/**
* The preferred window opacity for displaying closed-captions backgrounds.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'windowOpacityChanged'} event
* @param {Function} callback
*/
function once(
event: 'windowOpacityChanged',
callback: (data: Opacity) => void,
): Promise<number>
/**
* Getter: A prioritized list of ISO 639-2/B codes for the preferred closed captions languages on this device.
*
*/
function preferredLanguages(): Promise<ISO639_2Language[]>
/**
* Setter: A prioritized list of ISO 639-2/B codes for the preferred closed captions languages on this device.
*
*/
function preferredLanguages(value: ISO639_2Language[]): Promise<void>
/**
* Subscriber: A prioritized list of ISO 639-2/B codes for the preferred closed captions languages on this device.
*
*/
function preferredLanguages(
subscriber: (languages: ISO639_2Language[]) => void,
): Promise<number>
/**
* Getter: The preferred horizontal alignment for displaying closed-captions characters.
*
*/
function textAlign(): Promise<HorizontalAlignment>
/**
* Setter: The preferred horizontal alignment for displaying closed-captions characters.
*
*/
function textAlign(value: HorizontalAlignment): Promise<void>
/**
* Subscriber: The preferred horizontal alignment for displaying closed-captions characters.
*
*/
function textAlign(
subscriber: (alignment: HorizontalAlignment) => void,
): Promise<number>
/**
* Getter: The preferred horizontal alignment for displaying closed-captions characters.
*
*/
function textAlignVertical(): Promise<VerticalAlignment>
/**
* Setter: The preferred horizontal alignment for displaying closed-captions characters.
*
*/
function textAlignVertical(value: VerticalAlignment): Promise<void>
/**
* Subscriber: The preferred horizontal alignment for displaying closed-captions characters.
*
*/
function textAlignVertical(
subscriber: (alignment: VerticalAlignment) => void,
): Promise<number>
/**
* Getter: The preferred window color for displaying closed-captions, .
*
*/
function windowColor(): Promise<Color>
/**
* Setter: The preferred window color for displaying closed-captions, .
*
*/
function windowColor(value: Color): Promise<void>
/**
* Subscriber: The preferred window color for displaying closed-captions, .
*
*/
function windowColor(subscriber: (color: Color) => void): Promise<number>
/**
* Getter: The preferred window opacity for displaying closed-captions backgrounds.
*
*/
function windowOpacity(): Promise<Opacity>
/**
* Setter: The preferred window opacity for displaying closed-captions backgrounds.
*
*/
function windowOpacity(value: Opacity): Promise<void>
/**
* Subscriber: The preferred window opacity for displaying closed-captions backgrounds.
*
*/
function windowOpacity(
subscriber: (opacity: Opacity) => void,
): Promise<number>
}
export module AudioDescriptions {
type Event = 'enabledChanged'
// Types
/**
* Turn off all listeners previously registered from this module.
*/
function clear(): boolean
/**
* Clear a specific listen by the listener ID.
*
* @param {number} id The id of the listener to clear
*/
function clear(id: number): boolean
/**
* Getter: Whether or not audio-descriptions are enabled.
*
*/
function enabled(): Promise<boolean>
/**
* Setter: Whether or not audio-descriptions are enabled.
*
*/
function enabled(value: boolean): Promise<void>
/**
* Subscriber: Whether or not audio-descriptions are enabled.
*
*/
function enabled(subscriber: (enabled: boolean) => void): Promise<number>
/**
* Listen to all events dispatched by this module.
*
* @param {Function} callback
*/
function listen(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Listen for the first of any and all events dispatched by this module.
*
* @param {Function} callback
*/
function once(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Whether or not audio-descriptions are enabled.
*
* @param {'enabledChanged'} event
* @param {Function} callback
*/
function listen(
event: 'enabledChanged',
callback: (data: boolean) => void,
): Promise<number>
/**
* Whether or not audio-descriptions are enabled.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'enabledChanged'} event
* @param {Function} callback
*/
function once(
event: 'enabledChanged',
callback: (data: boolean) => void,
): Promise<number>
}
export module VoiceGuidance {
type Event =
| 'enabledChanged'
| 'navigationHintsChanged'
| 'rateChanged'
| 'speedChanged'
// Types
/**
*
*/
type SpeechRate = number
/**
* Turn off all listeners previously registered from this module.
*/
function clear(): boolean
/**
* Clear a specific listen by the listener ID.
*
* @param {number} id The id of the listener to clear
*/
function clear(id: number): boolean
/**
* Getter: Whether or not voice-guidance is enabled.
*
*/
function enabled(): Promise<boolean>
/**
* Setter: Whether or not voice-guidance is enabled.
*
*/
function enabled(value: boolean): Promise<void>
/**
* Subscriber: Whether or not voice-guidance is enabled.
*
*/
function enabled(subscriber: (enabled: boolean) => void): Promise<number>
/**
* Listen to all events dispatched by this module.
*
* @param {Function} callback
*/
function listen(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Getter: The user's preference for whether additional navigation hints should be synthesized.
*
*/
function navigationHints(): Promise<boolean>
/**
* Setter: The user's preference for whether additional navigation hints should be synthesized.
*
*/
function navigationHints(value: boolean): Promise<void>
/**
* Subscriber: The user's preference for whether additional navigation hints should be synthesized.
*
*/
function navigationHints(
subscriber: (navigationHints: boolean) => void,
): Promise<number>
/**
* Listen for the first of any and all events dispatched by this module.
*
* @param {Function} callback
*/
function once(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Whether or not voice-guidance is enabled.
*
* @param {'enabledChanged'} event
* @param {Function} callback
*/
function listen(
event: 'enabledChanged',
callback: (data: boolean) => void,
): Promise<number>
/**
* Whether or not voice-guidance is enabled.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'enabledChanged'} event
* @param {Function} callback
*/
function once(
event: 'enabledChanged',
callback: (data: boolean) => void,
): Promise<number>
/**
* The user's preference for whether additional navigation hints should be synthesized.
*
* @param {'navigationHintsChanged'} event
* @param {Function} callback
*/
function listen(
event: 'navigationHintsChanged',
callback: (data: boolean) => void,
): Promise<number>
/**
* The user's preference for whether additional navigation hints should be synthesized.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'navigationHintsChanged'} event
* @param {Function} callback
*/
function once(
event: 'navigationHintsChanged',
callback: (data: boolean) => void,
): Promise<number>
/**
* The rate at which voice guidance speech will be read back to the user.
*
* @param {'rateChanged'} event
* @param {Function} callback
*/
function listen(
event: 'rateChanged',
callback: (data: SpeechRate) => void,
): Promise<number>
/**
* The rate at which voice guidance speech will be read back to the user.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'rateChanged'} event
* @param {Function} callback
*/
function once(
event: 'rateChanged',
callback: (data: SpeechRate) => void,
): Promise<number>
/**
* The speed at which voice guidance speech will be read back to the user.
*
* @param {'speedChanged'} event
* @param {Function} callback
* @deprecated since version 1.5.0
*/
function listen(
event: 'speedChanged',
callback: (data: SpeechRate) => void,
): Promise<number>
/**
* The speed at which voice guidance speech will be read back to the user.
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'speedChanged'} event
* @param {Function} callback
* @deprecated since version 1.5.0
*/
function once(
event: 'speedChanged',
callback: (data: SpeechRate) => void,
): Promise<number>
/**
* Getter: The rate at which voice guidance speech will be read back to the user.
*
*/
function rate(): Promise<SpeechRate>
/**
* Setter: The rate at which voice guidance speech will be read back to the user.
*
*/
function rate(value: SpeechRate): Promise<void>
/**
* Subscriber: The rate at which voice guidance speech will be read back to the user.
*
*/
function rate(subscriber: (rate: SpeechRate) => void): Promise<number>
/**
* Getter: The speed at which voice guidance speech will be read back to the user.
*
* @deprecated since version 1.5.0
*/
function speed(): Promise<SpeechRate>
/**
* Setter: The speed at which voice guidance speech will be read back to the user.
*
*/
function speed(value: SpeechRate): Promise<void>
/**
* Subscriber: The speed at which voice guidance speech will be read back to the user.
*
*/
function speed(subscriber: (speed: SpeechRate) => void): Promise<number>
}
export module Device {
type Event = 'deviceNameChanged' | 'nameChanged'
// Types
/**
* Turn off all listeners previously registered from this module.
*/
function clear(): boolean
/**
* Clear a specific listen by the listener ID.
*
* @param {number} id The id of the listener to clear
*/
function clear(id: number): boolean
/**
* Listen to all events dispatched by this module.
*
* @param {Function} callback
*/
function listen(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Getter: The human readable name of the device
*
*/
function name(): Promise<string>
/**
* Setter: The human readable name of the device
*
*/
function name(value: string): Promise<void>
/**
* Subscriber: The human readable name of the device
*
*/
function name(subscriber: (value: string) => void): Promise<number>
/**
* Listen for the first of any and all events dispatched by this module.
*
* @param {Function} callback
*/
function once(
callback: (event: string, data: object) => void,
): Promise<number>
/**
* Get the human readable name of the device
*
* @param {'deviceNameChanged'} event
* @param {Function} callback
* @deprecated since version 0.6.0
*/
function listen(
event: 'deviceNameChanged',
callback: (data: string) => void,
): Promise<number>
/**
* Get the human readable name of the device
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'deviceNameChanged'} event
* @param {Function} callback
* @deprecated since version 0.6.0
*/
function once(
event: 'deviceNameChanged',
callback: (data: string) => void,
): Promise<number>
/**
* The human readable name of the device
*
* @param {'nameChanged'} event
* @param {Function} callback
*/
function listen(
event: 'nameChanged',
callback: (data: string) => void,
): Promise<number>
/**
* The human readable name of the device
* When using `once` the callback method will only fire once, and then disconnect your listener
*
* @param {'nameChanged'} event
* @param {Function} callback
*/
function once(
event: 'nameChanged',
callback: (data: string) => void,
): Promise<number>
/**
* Used by a distributor to push provision info to firebolt.
*
* @param {string} accountId The id of the account that is device is attached to in the back office.
* @param {string} deviceId The id of the device in the back office.
* @param {string} distributorId The id of the distributor in the back office.
*/
function provision(
accountId: string,
deviceId: string,
distributorId?: string,
): Promise<void>
}
export module UserGrants {
// Types
/**
* Role provides access level for the app for a given capability.
*/
enum Role {
USE = 'use',
MANAGE = 'manage',
PROVIDE = 'provide',
}
/**
* The state the grant is in
*/
enum GrantState {
GRANTED = 'granted',
DENIED = 'denied',
}
/**
* Information about an app that a grant was for
*/
type AppInfo = {
id: string
title?: string
}
/**
* Options when modifying any grant
*/
type GrantModificationOptions = {
appId?: string
}
/**
* A Capability is a discrete unit of functionality that a Firebolt device might be able to perform.
*/
type Capability = string
/**
*
*/
type RequestOptions = {
force?: boolean // Whether to force for user grant even if the previous decision stored
}
/**
* Information about a grant given by a user
*/
type GrantInfo = {
app?: AppInfo // Information about an app that a grant was for
state: GrantState // The state the grant is in
capability: Capability // A Capability is a discrete unit of functionality that a Firebolt device might be able to perform.
role: Role // Role provides access level for the app for a given capability.
lifespan: 'once' | 'forever' | 'appActive' | 'powerActive' | 'seconds'
expires?: string
}
/**
* A capability combined with a Role, which an app may be permitted (by a distributor) or granted (by an end user).
*/
type Permission = {
role?: Role // Role provides access level for the app for a given capability.
capability: Capability // A Capability is a discrete unit of functionality that a Firebolt device might be able to perform.
}
/**
* Get all granted and denied user grants for the given app
*
* @param {string} appId
*/
function app(appId: string): Promise<GrantInfo[]>
/**
* Get all granted and denied user grants for the given capability
*
* @param {Capability} capability
*/
function capability(capability: Capability): Promise<GrantInfo[]>
/**
* Clears the grant for a given capability, to a specific app if appropriate. Calling this results in a persisted Denied Grant that lasts for the duration of the Grant Policy lifespan.
*
* @param {Role} role
* @param {Capability} capability
* @param {GrantModificationOptions} options
*/
function clear(
role: Role,
capability: Capability,
options?: GrantModificationOptions,
): Promise<void>
/**
* Denies a given capability, to a specific app if appropriate. Calling this results in a persisted Denied Grant that lasts for the duration of the Grant Policy lifespan.
*
* @param {Role} role
* @param {Capability} capability
* @param {GrantModificationOptions} options
*/
function deny(
role: Role,
capability: Capability,
options?: GrantModificationOptions,
): Promise<void>
/**
* Get all granted and denied user grants for the device
*
*/
function device(): Promise<GrantInfo[]>
/**
* Grants a given capability to a specific app, if appropriate. Calling this results in a persisted active grant that lasts for the duration of the grant policy lifespan.
*
* @param {Role} role
* @param {Capability} capability
* @param {GrantModificationOptions} options
*/
function grant(
role: Role,
capability: Capability,
options?: GrantModificationOptions,
): Promise<void>
/**
* Requests Firebolt to carry out a set of user grants for a given application such that the user grant provider is notified or an existing user grant is reused.
*
* @param {string} appId
* @param {Permission[]} permissions
* @param {RequestOptions} options Request options
*/
function request(
appId: string,
permissions: Permission[],
options?: RequestOptions,
): Promise<GrantInfo[]>
}
export module Privacy {
type Event =
| 'allowACRCollectionChanged'
| 'allowAppContentAdTargetingChanged'
| 'allowCameraAnalyticsChanged'
| 'allowPersonalizationChanged'
| 'allowPrimaryBrowseAdTargetingChanged'
| 'allowPrimaryContentAdTargetingChanged'
| 'allowProductAnalyticsChanged'
| 'allowRemoteDiagnosticsChanged'
| 'allowResumePointsChanged'
| 'allowUnentitledPersonalizationChanged'
| 'allowUnentitledResumePointsChanged'
| 'allowWatchHistoryChanged'
// Types
/**
*
*/
type PrivacySettings = {
allowACRCollection: boolean
allowResumePoints: boolean
allowAppContentAdTargeting: boolean
allowCameraAnalytics: boolean
allowPersonalization: boolean
allowPrimaryBrowseAdTargeting: boolean
allowPrimaryContentAdTargeting: boolean
allowProductAnalytics: boolean
allowRemoteDiagnostics: boolean
allowUnentitledPersonalization: boolean
allowUnentitledResumePoints: boolean
allowWatchHistory: boolean
}
/**
* Getter: Whether the user allows their automatic content recognition data to be collected
*
*/
function allowACRCollection(): Promise<boolean>
/**
* Setter: Whether the user allows their automatic content recognition data to be collected
*
*/
function allowACRCollection(value: boolean): Promise<void>
/**
* Subscriber: Whether the user allows their automatic content recognition data to be collected
*
*/
function allowACRCollection(
subscriber: (allow: boolean) => void,
): Promise<number>
/**
* Getter: Whether the user allows ads to be targeted to the user while watching content in apps
*
*/
function allowAppContentAdTargeting(): Promise<boolean>
/**
* Setter: Whether the user allows ads to be targeted to the user while watching content in apps
*
*/
function allowAppContentAdTargeting(value: boolean): Promise<void>
/**
* Subscriber: Whether the user allows ads to be targeted to the user while watching content in apps
*
*/
function allowAppContentAdTargeting(
subscriber: (allow: boolean) => void,
): Promise<number>
/**
* Getter: Whether the user allows data from their camera to be used for Product Analytics
*
*/
function allowCameraAnalytics(): Promise<boolean>
/**
* Setter: Whether the user allows data from their camera to be used for Product Analytics
*
*/
function allowCameraAnalytics(value: boolean): Promise<void>
/**
* Subscriber: Whether the user allows data from their camera to be used for Product Analytics
*
*/
function allowCameraAnalytics(
subscriber: (allow: boolean) => void,
): Promise<number>
/**
* Getter: Whether the user allows their usage data to be used for personalization and recommendations
*
*/
function allowPersonalization(): Promise<boolean>
/**
* Setter: Whether the user allows their usage data to be used for personalization and recommendations
*
*/
function allowPersonalization(value: boolean): Promise<void>
/**
* Subscriber: Whether the user allows their usage data to be used for personalization and recommendations
*
*/
function allowPersonalization(
subscriber: (allow: boolean) => void,
): Promise<number>
/**
* Getter: Whether the user allows ads to be targeted to the user while browsing in the primary experience
*
*/
function allowPrimaryBrowseAdTargeting(): Promise<boolean>
/**
* Setter: Whether the user allows ads to be targeted to the user while browsing in the primary experience
*
*/
function allowPrimaryBrowseAdTargeting(value: boolean): Promise<void>
/**
* Subscriber: Whether the user allows ads to be targeted to the user while browsing in the primary experience
*
*/
function allowPrimaryBrowseAdTargeting(
subscriber: (allow: boolean) => void,
): Promise<number>
/**
* Getter: Whether the user allows ads to be targeted to the user while watching content in the primary experience
*
*/
function allowPrimaryContentAdTargeting(): Promise<boolean>
/**
* Setter: Whether the user allows ads to be targeted to the user while watching content in the primary experience
*
*/
function allowPrimaryContentAdTargeting(value: boolean): Promise<void>
/**
* Subscriber: Whether the user allows ads to be targeted to the user while watching content in the primary experience
*
*/
function