forked from microsoft/immersive-reader-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.ts
More file actions
40 lines (35 loc) · 3.01 KB
/
options.ts
File metadata and controls
40 lines (35 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
export type Options = {
uiLang?: string; // Language of the UI, e.g. en, es-ES (optional). Defaults to browser language if not specified.
timeout?: number; // Duration (in milliseconds) before launchAsync fails with a timeout error (default is 15000 ms).
uiZIndex?: number; // Z-index of the iframe that will be created (default is 1000)
useWebview?: boolean; // Use a webview tag instead of an iframe, for compatibility with Chrome Apps (default is false).
onExit?: () => any; // Executes when the Immersive Reader exits
customDomain?: string; // Reserved for internal use. Custom domain where the Immersive Reader webapp is hosted (default is null).
allowFullscreen?: boolean; // The ability to toggle fullscreen (default is true).
hideExitButton?: boolean; // Whether or not to hide the Immersive Reader's exit button arrow (default is false). This should only be true if there is an alternative mechanism provided to exit the Immersive Reader (e.g a mobile toolbar's back arrow).
cookiePolicy?: CookiePolicy; // Setting for the Immersive Reader's cookie usage (default is CookiePolicy.Disable). It's the responsibility of the host application to obtain any necessary user consent in accordance with EU Cookie Compliance Policy.
disableFirstRun?: boolean; // Disable the first run experience.
readAloudOptions?: ReadAloudOptions; // Options to configure Read Aloud.
translationOptions?: TranslationOptions; // Options to configure Translation.
displayOptions?: DisplayOptions; // Options to configure text size, font, etc.
preferences?: string; // String returned from onPreferencesChanged representing the user's preferences in the Immersive Reader.
onPreferencesChanged?: (value: string) => any; // Executes when the user's preferences have changed.
};
export enum CookiePolicy { Disable, Enable }
export type ReadAloudOptions = {
voice?: string; // Voice, either 'male' or 'female'. Note that not all languages support both genders.
speed?: number; // Playback speed, must be between 0.5 and 2.5, inclusive.
autoplay?: boolean; // Automatically start Read Aloud when the Immersive Reader loads.
};
export type TranslationOptions = {
language: string; // Set the translation language, e.g. fr-FR, es-MX, zh-Hans-CN. Required to automatically enable word or document translation.
autoEnableDocumentTranslation?: boolean; // Automatically translate the entire document
autoEnableWordTranslation?: boolean; // Automatically enable word translation
};
export type DisplayOptions = {
textSize?: number; // Valid values are 14, 20, 28, 36, 42, 48, 56, 64, 72, 84, 96.
increaseSpacing?: boolean; // Set whether increased spacing is enabled.
fontFamily?: string; // Valid values are 'Calibri', 'ComicSans', and 'Sitka'
};