@amazon-devices/kepler-a11y-settings-interface-turbo 1.0.0-rn-83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +230 -0
  3. package/dist/kepler/aarch64-debug/lib/libKeplerA11ySettingsInterfaceTurbo.so +0 -0
  4. package/dist/kepler/aarch64-debug/lib/libKeplerA11ySettingsInterfaceTurbo.so.debug +0 -0
  5. package/dist/kepler/aarch64-release/lib/libKeplerA11ySettingsInterfaceTurbo.so +0 -0
  6. package/dist/kepler/aarch64-release/lib/libKeplerA11ySettingsInterfaceTurbo.so.debug +0 -0
  7. package/dist/kepler/armv7-debug/lib/libKeplerA11ySettingsInterfaceTurbo.so +0 -0
  8. package/dist/kepler/armv7-debug/lib/libKeplerA11ySettingsInterfaceTurbo.so.debug +0 -0
  9. package/dist/kepler/armv7-release/lib/libKeplerA11ySettingsInterfaceTurbo.so +0 -0
  10. package/dist/kepler/armv7-release/lib/libKeplerA11ySettingsInterfaceTurbo.so.debug +0 -0
  11. package/dist/kepler/tm-manifest.json +1 -0
  12. package/dist/kepler/x86_64-debug/lib/libKeplerA11ySettingsInterfaceTurbo.so +0 -0
  13. package/dist/kepler/x86_64-debug/lib/libKeplerA11ySettingsInterfaceTurbo.so.debug +0 -0
  14. package/dist/kepler/x86_64-release/lib/libKeplerA11ySettingsInterfaceTurbo.so +0 -0
  15. package/dist/kepler/x86_64-release/lib/libKeplerA11ySettingsInterfaceTurbo.so.debug +0 -0
  16. package/dist/src/KeplerA11ySettingsInterface.d.ts +309 -0
  17. package/dist/src/KeplerA11ySettingsInterface.js +836 -0
  18. package/dist/src/UiScaleSettingContextProvider.d.ts +53 -0
  19. package/dist/src/UiScaleSettingContextProvider.js +164 -0
  20. package/dist/src/index.d.ts +12 -0
  21. package/dist/src/index.js +31 -0
  22. package/dist/src/turbo-modules/KeplerA11ySettingsInterfaceTurbo.d.ts +214 -0
  23. package/dist/src/turbo-modules/KeplerA11ySettingsInterfaceTurbo.js +33 -0
  24. package/dist/src/turbo-modules/__mocks__/KeplerA11ySettingsInterfaceTurbo.d.ts +7 -0
  25. package/dist/src/turbo-modules/__mocks__/KeplerA11ySettingsInterfaceTurbo.js +8 -0
  26. package/dist/src/utils/constants.d.ts +18 -0
  27. package/dist/src/utils/constants.js +21 -0
  28. package/dist/src/utils/dipUtils.d.ts +30 -0
  29. package/dist/src/utils/dipUtils.js +63 -0
  30. package/dist/test/KeplerA11ySettingsInterfaceTurbo.spec.d.ts +1 -0
  31. package/dist/test/KeplerA11ySettingsInterfaceTurbo.spec.js +7 -0
  32. package/package.json +61 -0
  33. package/react-native.config.js +19 -0
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ *
4
+ * PROPRIETARY/CONFIDENTIAL
5
+ *
6
+ * Use is subject to license terms.
7
+ *
8
+ */
9
+ import * as React from 'react';
10
+ import { ScalingProps, UiScaleSetting } from './KeplerA11ySettingsInterface';
11
+ /**
12
+ * Props for UiScaleSettingProvider component
13
+ */
14
+ interface UiScaleSettingProviderProps {
15
+ children: React.ReactNode;
16
+ }
17
+ /**
18
+ * Provider component that supplies UI scale setting context to child components
19
+ */
20
+ export declare function UiScaleSettingContextProvider({ children }: UiScaleSettingProviderProps): JSX.Element;
21
+ /**
22
+ * Hook to access the current UI scale setting.
23
+ * @returns The current UI scale setting
24
+ */
25
+ export declare const useUiScaleSetting: () => UiScaleSetting;
26
+ /**
27
+ * Hook to check whether we're still fetching the UI scale setting.
28
+ * @returns whether we're still loading the UI scale setting
29
+ */
30
+ export declare const useUiScaleSettingLoading: () => boolean;
31
+ /**
32
+ * Hook to retrieve the UI scaled size value based on original size and scaling properties.
33
+ *
34
+ * @param originalSize The original size to scale (in DIP if PLATFORM_DENSITY_INDEPENDENT_PIXEL
35
+ * is enabled, or in physical pixels otherwise)
36
+ * @param scalingProps Properties that define how scaling should be applied
37
+ * @returns The scaled size
38
+ */
39
+ export declare const useScaledSize: (originalSize: number, scalingProps: ScalingProps) => number;
40
+ /**
41
+ * Hook to retrieve the UI scaling multiplier value based on original size and scaling properties.
42
+ *
43
+ * The scaling multiplier can be applied to values that have different scaling properties, but
44
+ * should be scaled at the same rate, like the height and width of an image. In most cases,
45
+ * developers should prefer the useScaledSize hook.
46
+ *
47
+ * @param originalSize The original size to scale (in DIP if PLATFORM_DENSITY_INDEPENDENT_PIXEL
48
+ * is enabled, or in physical pixels otherwise)
49
+ * @param scalingProps Properties that define how scaling should be applied
50
+ * @returns The scaling multiplier
51
+ */
52
+ export declare const useScalingMultiplier: (originalSize: number, scalingProps: ScalingProps) => number;
53
+ export {};
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ *
5
+ * PROPRIETARY/CONFIDENTIAL
6
+ *
7
+ * Use is subject to license terms.
8
+ *
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || function (mod) {
27
+ if (mod && mod.__esModule) return mod;
28
+ var result = {};
29
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
30
+ __setModuleDefault(result, mod);
31
+ return result;
32
+ };
33
+ var __importDefault = (this && this.__importDefault) || function (mod) {
34
+ return (mod && mod.__esModule) ? mod : { "default": mod };
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.useScalingMultiplier = exports.useScaledSize = exports.useUiScaleSettingLoading = exports.useUiScaleSetting = exports.UiScaleSettingContextProvider = void 0;
38
+ const React = __importStar(require("react"));
39
+ const KeplerA11ySettingsInterfaceTurbo_1 = __importDefault(require("./turbo-modules/KeplerA11ySettingsInterfaceTurbo"));
40
+ const react_native_1 = require("react-native");
41
+ const constants_1 = require("./utils/constants");
42
+ const dipUtils_1 = require("./utils/dipUtils");
43
+ const DEFAULT_UI_SCALE_SETTING = 1.0;
44
+ const DEFAULT_SCALING_MULTIPLIER = 1.0;
45
+ /**
46
+ * Context for sharing UI scale setting data across components
47
+ */
48
+ const UiScaleSettingContext = React.createContext({ uiScaleSetting: DEFAULT_UI_SCALE_SETTING, isLoading: true });
49
+ /**
50
+ * Provider component that supplies UI scale setting context to child components
51
+ */
52
+ function UiScaleSettingContextProvider({ children }) {
53
+ const [uiScaleSetting, setUiScaleSetting] = React.useState(DEFAULT_UI_SCALE_SETTING);
54
+ const [isLoading, setIsLoading] = React.useState(true);
55
+ React.useEffect(() => {
56
+ try {
57
+ setUiScaleSetting(KeplerA11ySettingsInterfaceTurbo_1.default.getUiScaleSettingSync());
58
+ setIsLoading(false);
59
+ KeplerA11ySettingsInterfaceTurbo_1.default.addUiScaleSettingListener();
60
+ const emitter = new react_native_1.NativeEventEmitter();
61
+ const listener = emitter.addListener(constants_1.UI_SCALE_SETTING_CHANGED_EVENT, (args) => {
62
+ setUiScaleSetting(args.intValue);
63
+ });
64
+ return () => {
65
+ try {
66
+ KeplerA11ySettingsInterfaceTurbo_1.default.removeUiScaleSettingListener();
67
+ }
68
+ catch (e) {
69
+ console.error(e);
70
+ }
71
+ listener.remove();
72
+ };
73
+ }
74
+ catch (e) {
75
+ setIsLoading(false);
76
+ console.error(e);
77
+ }
78
+ }, []);
79
+ const contextValue = React.useMemo(() => ({
80
+ uiScaleSetting,
81
+ isLoading,
82
+ }), [uiScaleSetting, isLoading]);
83
+ return React.createElement(UiScaleSettingContext.Provider, { value: contextValue }, children);
84
+ }
85
+ exports.UiScaleSettingContextProvider = UiScaleSettingContextProvider;
86
+ /**
87
+ * Hook to access the current UI scale setting.
88
+ * @returns The current UI scale setting
89
+ */
90
+ const useUiScaleSetting = () => {
91
+ const context = React.useContext(UiScaleSettingContext);
92
+ return context.uiScaleSetting;
93
+ };
94
+ exports.useUiScaleSetting = useUiScaleSetting;
95
+ /**
96
+ * Hook to check whether we're still fetching the UI scale setting.
97
+ * @returns whether we're still loading the UI scale setting
98
+ */
99
+ const useUiScaleSettingLoading = () => {
100
+ const context = React.useContext(UiScaleSettingContext);
101
+ return context.isLoading;
102
+ };
103
+ exports.useUiScaleSettingLoading = useUiScaleSettingLoading;
104
+ /**
105
+ * Hook to retrieve the UI scaled size value based on original size and scaling properties.
106
+ *
107
+ * @param originalSize The original size to scale (in DIP if PLATFORM_DENSITY_INDEPENDENT_PIXEL
108
+ * is enabled, or in physical pixels otherwise)
109
+ * @param scalingProps Properties that define how scaling should be applied
110
+ * @returns The scaled size
111
+ */
112
+ const useScaledSize = (originalSize, scalingProps) => {
113
+ const uiScaleSetting = (0, exports.useUiScaleSetting)();
114
+ const scaledSize = React.useMemo(() => {
115
+ try {
116
+ if (uiScaleSetting === DEFAULT_UI_SCALE_SETTING) {
117
+ return originalSize;
118
+ }
119
+ const dipFactor = (0, dipUtils_1.getDipConversionFactor)();
120
+ let result = KeplerA11ySettingsInterfaceTurbo_1.default.getScaledSizeSync(originalSize / dipFactor, (0, dipUtils_1.convertScalingPropsToDip)(scalingProps, dipFactor)) * dipFactor;
121
+ if (scalingProps.maxSize != null)
122
+ result = Math.min(result, scalingProps.maxSize);
123
+ if (scalingProps.minSize != null)
124
+ result = Math.max(result, scalingProps.minSize);
125
+ return result;
126
+ }
127
+ catch (e) {
128
+ console.error(e);
129
+ return originalSize;
130
+ }
131
+ }, [originalSize, scalingProps.itemType, scalingProps.maxSize, scalingProps.minSize, uiScaleSetting]);
132
+ return scaledSize;
133
+ };
134
+ exports.useScaledSize = useScaledSize;
135
+ /**
136
+ * Hook to retrieve the UI scaling multiplier value based on original size and scaling properties.
137
+ *
138
+ * The scaling multiplier can be applied to values that have different scaling properties, but
139
+ * should be scaled at the same rate, like the height and width of an image. In most cases,
140
+ * developers should prefer the useScaledSize hook.
141
+ *
142
+ * @param originalSize The original size to scale (in DIP if PLATFORM_DENSITY_INDEPENDENT_PIXEL
143
+ * is enabled, or in physical pixels otherwise)
144
+ * @param scalingProps Properties that define how scaling should be applied
145
+ * @returns The scaling multiplier
146
+ */
147
+ const useScalingMultiplier = (originalSize, scalingProps) => {
148
+ const uiScaleSetting = (0, exports.useUiScaleSetting)();
149
+ const scalingMultiplier = React.useMemo(() => {
150
+ try {
151
+ if (uiScaleSetting === DEFAULT_UI_SCALE_SETTING) {
152
+ return DEFAULT_SCALING_MULTIPLIER;
153
+ }
154
+ const dipFactor = (0, dipUtils_1.getDipConversionFactor)();
155
+ return KeplerA11ySettingsInterfaceTurbo_1.default.getScalingMultiplierSync(originalSize / dipFactor, (0, dipUtils_1.convertScalingPropsToDip)(scalingProps, dipFactor));
156
+ }
157
+ catch (e) {
158
+ console.error(e);
159
+ return 1.0;
160
+ }
161
+ }, [originalSize, scalingProps.itemType, scalingProps.maxSize, scalingProps.minSize, uiScaleSetting]);
162
+ return scalingMultiplier;
163
+ };
164
+ exports.useScalingMultiplier = useScalingMultiplier;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ *
4
+ * PROPRIETARY/CONFIDENTIAL
5
+ *
6
+ * Use is subject to license terms.
7
+ *
8
+ */
9
+ export { default as KeplerA11ySettingsInterface } from './KeplerA11ySettingsInterface';
10
+ export type { ItemScalingType, UiScaleSetting, ScalingProps, ColorCorrectionMode, TimeoutMultiplier, CaptionTextSize, CaptionColor, CaptionFont, CaptionEdgeStyle, CaptionOpacity, CaptioningProps } from './turbo-modules/KeplerA11ySettingsInterfaceTurbo';
11
+ export { UiScaleSettingMode, SCALING_PROP_IMAGE_TYPE, SCALING_PROP_LARGE_DOWNSCALE_TYPE, SCALING_PROP_LARGE_UPSCALE_TYPE, SCALING_PROP_LOW_DOWNSCALE_TYPE, SCALING_PROP_LOW_UPSCALE_TYPE, SCALING_PROP_MEDIUM_UPSCALE_TYPE, SCALING_PROP_TEXT_TYPE } from './turbo-modules/KeplerA11ySettingsInterfaceTurbo';
12
+ export { useScaledSize, useScalingMultiplier, useUiScaleSetting, useUiScaleSettingLoading, UiScaleSettingContextProvider } from './UiScaleSettingContextProvider';
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ *
5
+ * PROPRIETARY/CONFIDENTIAL
6
+ *
7
+ * Use is subject to license terms.
8
+ *
9
+ */
10
+ var __importDefault = (this && this.__importDefault) || function (mod) {
11
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.UiScaleSettingContextProvider = exports.useUiScaleSettingLoading = exports.useUiScaleSetting = exports.useScalingMultiplier = exports.useScaledSize = exports.SCALING_PROP_TEXT_TYPE = exports.SCALING_PROP_MEDIUM_UPSCALE_TYPE = exports.SCALING_PROP_LOW_UPSCALE_TYPE = exports.SCALING_PROP_LOW_DOWNSCALE_TYPE = exports.SCALING_PROP_LARGE_UPSCALE_TYPE = exports.SCALING_PROP_LARGE_DOWNSCALE_TYPE = exports.SCALING_PROP_IMAGE_TYPE = exports.UiScaleSettingMode = exports.KeplerA11ySettingsInterface = void 0;
15
+ var KeplerA11ySettingsInterface_1 = require("./KeplerA11ySettingsInterface");
16
+ Object.defineProperty(exports, "KeplerA11ySettingsInterface", { enumerable: true, get: function () { return __importDefault(KeplerA11ySettingsInterface_1).default; } });
17
+ var KeplerA11ySettingsInterfaceTurbo_1 = require("./turbo-modules/KeplerA11ySettingsInterfaceTurbo");
18
+ Object.defineProperty(exports, "UiScaleSettingMode", { enumerable: true, get: function () { return KeplerA11ySettingsInterfaceTurbo_1.UiScaleSettingMode; } });
19
+ Object.defineProperty(exports, "SCALING_PROP_IMAGE_TYPE", { enumerable: true, get: function () { return KeplerA11ySettingsInterfaceTurbo_1.SCALING_PROP_IMAGE_TYPE; } });
20
+ Object.defineProperty(exports, "SCALING_PROP_LARGE_DOWNSCALE_TYPE", { enumerable: true, get: function () { return KeplerA11ySettingsInterfaceTurbo_1.SCALING_PROP_LARGE_DOWNSCALE_TYPE; } });
21
+ Object.defineProperty(exports, "SCALING_PROP_LARGE_UPSCALE_TYPE", { enumerable: true, get: function () { return KeplerA11ySettingsInterfaceTurbo_1.SCALING_PROP_LARGE_UPSCALE_TYPE; } });
22
+ Object.defineProperty(exports, "SCALING_PROP_LOW_DOWNSCALE_TYPE", { enumerable: true, get: function () { return KeplerA11ySettingsInterfaceTurbo_1.SCALING_PROP_LOW_DOWNSCALE_TYPE; } });
23
+ Object.defineProperty(exports, "SCALING_PROP_LOW_UPSCALE_TYPE", { enumerable: true, get: function () { return KeplerA11ySettingsInterfaceTurbo_1.SCALING_PROP_LOW_UPSCALE_TYPE; } });
24
+ Object.defineProperty(exports, "SCALING_PROP_MEDIUM_UPSCALE_TYPE", { enumerable: true, get: function () { return KeplerA11ySettingsInterfaceTurbo_1.SCALING_PROP_MEDIUM_UPSCALE_TYPE; } });
25
+ Object.defineProperty(exports, "SCALING_PROP_TEXT_TYPE", { enumerable: true, get: function () { return KeplerA11ySettingsInterfaceTurbo_1.SCALING_PROP_TEXT_TYPE; } });
26
+ var UiScaleSettingContextProvider_1 = require("./UiScaleSettingContextProvider");
27
+ Object.defineProperty(exports, "useScaledSize", { enumerable: true, get: function () { return UiScaleSettingContextProvider_1.useScaledSize; } });
28
+ Object.defineProperty(exports, "useScalingMultiplier", { enumerable: true, get: function () { return UiScaleSettingContextProvider_1.useScalingMultiplier; } });
29
+ Object.defineProperty(exports, "useUiScaleSetting", { enumerable: true, get: function () { return UiScaleSettingContextProvider_1.useUiScaleSetting; } });
30
+ Object.defineProperty(exports, "useUiScaleSettingLoading", { enumerable: true, get: function () { return UiScaleSettingContextProvider_1.useUiScaleSettingLoading; } });
31
+ Object.defineProperty(exports, "UiScaleSettingContextProvider", { enumerable: true, get: function () { return UiScaleSettingContextProvider_1.UiScaleSettingContextProvider; } });
@@ -0,0 +1,214 @@
1
+ /**
2
+ * Copyright (c) 2025 - 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ *
4
+ * PROPRIETARY/CONFIDENTIAL
5
+ *
6
+ * Use is subject to license terms.
7
+ *
8
+ */
9
+ import type { KeplerTurboModule } from '@amazon-devices/keplerscript-turbomodule-api';
10
+ /**
11
+ * This enum defines scale settings for applications and UI frameworks
12
+ * to adjust their element sizes.
13
+ */
14
+ export declare type UiScaleSetting = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
15
+ /**
16
+ * Mapping from public-facing level name to numerical UiScaleSetting value
17
+ */
18
+ export declare const UiScaleSettingMode: {
19
+ DEFAULT: UiScaleSetting;
20
+ };
21
+ /**
22
+ * Color correction modes for addressing color vision deficiencies.
23
+ */
24
+ export declare type ColorCorrectionMode = 'off' | 'deuteranomaly' | 'protanomaly' | 'tritanomaly';
25
+ /**
26
+ * Timeout multiplier values for adjusting timeout durations.
27
+ */
28
+ export declare type TimeoutMultiplier = 'no_timeout' | 'default' | 'double_timeout' | 'triple_timeout' | 'quadruple_timeout';
29
+ /**
30
+ * Text size values for captioning.
31
+ */
32
+ export declare type CaptionTextSize = 'very_small' | 'small' | 'normal' | 'large' | 'very_large';
33
+ /**
34
+ * Color values for captioning.
35
+ */
36
+ export declare type CaptionColor = 'default' | 'white' | 'black' | 'red' | 'green' | 'blue' | 'yellow' | 'magenta' | 'cyan';
37
+ /**
38
+ * Font values for captioning.
39
+ */
40
+ export declare type CaptionFont = 'default' | 'casual' | 'cursive' | 'monospace_sans' | 'monospace_serif' | 'sans_serif' | 'serif' | 'small_capitals';
41
+ /**
42
+ * Edge style values for captioning.
43
+ */
44
+ export declare type CaptionEdgeStyle = 'none' | 'uniform' | 'drop_shadowed' | 'raised' | 'depressed';
45
+ /**
46
+ * Opacity values for captioning.
47
+ */
48
+ export declare type CaptionOpacity = 'percent_25' | 'percent_50' | 'percent_75' | 'percent_100';
49
+ /**
50
+ * Types of items that can be scaled. Different types of objects scale at different rates.
51
+ */
52
+ export declare type ItemScalingType =
53
+ /**
54
+ * The item being scaled is already very large and takes up a high percentage of the screen.
55
+ * The item will not be scaled up very much at higher ScaleFactorSettings.
56
+ * Examples include UI cards which are already very large and readable by default.
57
+ */
58
+ 'low_upscale'
59
+ /**
60
+ * The item being scaled is somewhat readable or understandable at the default
61
+ */
62
+ | 'medium_upscale'
63
+ /**
64
+ * The item being scaled is difficult to read or understand at smaller sizes, and has room to grow on the screen.
65
+ * Examples include navigation buttons or switches.
66
+ */
67
+ | 'large_upscale'
68
+ /**
69
+ * The item being scaled should be reduced in size at higher scale settings.
70
+ * This is used for whitespace and padding, to allow more space for larger visual elements on screen.
71
+ */
72
+ | 'low_downscale'
73
+ /**
74
+ * The item being scaled should be reduced dramatically in size at higher scale settings.
75
+ * This is used for very large padding.
76
+ */
77
+ | 'large_downscale'
78
+ /**
79
+ * The item being scaled is text or a line height.
80
+ */
81
+ | 'text'
82
+ /**
83
+ * The item being scaled is an image. Note that large images may not scale up.
84
+ */
85
+ | 'image';
86
+ /** Convenience ScalingProps object for text scaling when maxSize/minSize are not needed */
87
+ export declare const SCALING_PROP_TEXT_TYPE: ScalingProps;
88
+ /** Convenience ScalingProps object for image scaling when maxSize/minSize are not needed */
89
+ export declare const SCALING_PROP_IMAGE_TYPE: ScalingProps;
90
+ /** Convenience ScalingProps object for low upscale items when maxSize/minSize are not needed */
91
+ export declare const SCALING_PROP_LOW_UPSCALE_TYPE: ScalingProps;
92
+ /** Convenience ScalingProps object for medium upscale items when maxSize/minSize are not needed */
93
+ export declare const SCALING_PROP_MEDIUM_UPSCALE_TYPE: ScalingProps;
94
+ /** Convenience ScalingProps object for large upscale items when maxSize/minSize are not needed */
95
+ export declare const SCALING_PROP_LARGE_UPSCALE_TYPE: ScalingProps;
96
+ /** Convenience ScalingProps object for low downscale items when maxSize/minSize are not needed */
97
+ export declare const SCALING_PROP_LOW_DOWNSCALE_TYPE: ScalingProps;
98
+ /** Convenience ScalingProps object for large downscale items when maxSize/minSize are not needed */
99
+ export declare const SCALING_PROP_LARGE_DOWNSCALE_TYPE: ScalingProps;
100
+ /**
101
+ * Scaling properties to describe an item that will be scaled.
102
+ */
103
+ export interface ScalingProps {
104
+ /**
105
+ * The type of item being scaled
106
+ */
107
+ itemType: ItemScalingType;
108
+ /**
109
+ * The maximum size that the object being scaled should become. Application should use this parameter
110
+ * when the item's scaled size is too large to be usable at the maximum scale level.
111
+ * @default Number.MAX_VALUE
112
+ */
113
+ maxSize?: number;
114
+ /**
115
+ * The minimum size that the object being scaled should become. This parameter only needs to be
116
+ * set for items of type 'low_downscale' or 'large_downscale', which will be scaled down.
117
+ * @default 0
118
+ */
119
+ minSize?: number;
120
+ }
121
+ /**
122
+ * Captioning properties to describe captioning preferences.
123
+ */
124
+ export interface CaptioningProps {
125
+ /**
126
+ * The caption text size.
127
+ */
128
+ textSize?: CaptionTextSize;
129
+ /**
130
+ * The caption text color.
131
+ */
132
+ textColor?: CaptionColor;
133
+ /**
134
+ * The caption text font.
135
+ */
136
+ textFont?: CaptionFont;
137
+ /**
138
+ * The caption text edge style.
139
+ */
140
+ textEdgeStyle?: CaptionEdgeStyle;
141
+ /**
142
+ * The caption text opacity.
143
+ */
144
+ textOpacity?: CaptionOpacity;
145
+ /**
146
+ * The color of the background behind the caption text.
147
+ */
148
+ textBackgroundColor?: CaptionColor;
149
+ /**
150
+ * The opacity of the background behind the caption text.
151
+ */
152
+ textBackgroundOpacity?: CaptionOpacity;
153
+ /**
154
+ * The color of the caption window background.
155
+ */
156
+ windowBackgroundColor?: CaptionColor;
157
+ /**
158
+ * The opacity of the caption window background.
159
+ */
160
+ windowBackgroundOpacity?: CaptionOpacity;
161
+ }
162
+ export interface KeplerA11ySettingsInterfaceTurbo extends KeplerTurboModule {
163
+ getScalingMultiplierSync: (originalSize: number, scalingProps: ScalingProps) => number;
164
+ getScaledSizeSync: (originalSize: number, scalingProps: ScalingProps) => number;
165
+ getUiScaleSettingSync: () => UiScaleSetting;
166
+ getScalingMultiplier: (originalSize: number, scalingProps: ScalingProps) => Promise<number>;
167
+ getScaledSize: (originalSize: number, scalingProps: ScalingProps) => Promise<number>;
168
+ getUiScaleSetting: () => Promise<UiScaleSetting>;
169
+ isScreenReaderEnabled: () => Promise<boolean>;
170
+ isScreenMagnifierEnabled: () => Promise<boolean>;
171
+ isTextBannerEnabled: () => Promise<boolean>;
172
+ isColorInversionEnabled: () => Promise<boolean>;
173
+ getColorCorrectionMode: () => Promise<string>;
174
+ isHighContrastTextEnabled: () => Promise<boolean>;
175
+ isAudioDescriptionPreferred: () => Promise<boolean>;
176
+ getTimeToTakeAction: () => Promise<string>;
177
+ isClosedCaptioningEnabled: () => Promise<boolean>;
178
+ getCaptionPreferences: () => Promise<CaptioningProps>;
179
+ setScreenReaderEnabled: (enabled: boolean) => Promise<void>;
180
+ setScreenMagnifierEnabled: (enabled: boolean) => Promise<void>;
181
+ setTextBannerEnabled: (enabled: boolean) => Promise<void>;
182
+ setColorInversionEnabled: (enabled: boolean) => Promise<void>;
183
+ setColorCorrectionMode: (mode: string) => Promise<void>;
184
+ setHighContrastTextEnabled: (enabled: boolean) => Promise<void>;
185
+ setAudioDescriptionPreferred: (enabled: boolean) => Promise<void>;
186
+ setTimeToTakeAction: (multiplier: string) => Promise<void>;
187
+ setUiScaleSetting: (setting: UiScaleSetting) => Promise<void>;
188
+ setClosedCaptioningEnabled: (enabled: boolean) => Promise<void>;
189
+ setCaptionPreferences: (prefs: CaptioningProps) => Promise<void>;
190
+ addScreenReaderStateListener: () => Promise<boolean>;
191
+ addScreenMagnifierStateListener: () => Promise<boolean>;
192
+ addTextBannerStateListener: () => Promise<boolean>;
193
+ addColorInversionStateListener: () => Promise<boolean>;
194
+ addColorCorrectionModeListener: () => Promise<boolean>;
195
+ addHighContrastTextStateListener: () => Promise<boolean>;
196
+ addAudioDescriptionStateListener: () => Promise<boolean>;
197
+ addTimeToTakeActionListener: () => Promise<boolean>;
198
+ addUiScaleSettingListener: () => Promise<boolean>;
199
+ addClosedCaptioningStateListener: () => Promise<boolean>;
200
+ addCaptioningPreferencesListener: () => Promise<boolean>;
201
+ removeCaptioningPreferencesListener: () => Promise<void>;
202
+ removeScreenReaderStateListener: () => Promise<void>;
203
+ removeScreenMagnifierStateListener: () => Promise<void>;
204
+ removeTextBannerStateListener: () => Promise<void>;
205
+ removeColorInversionStateListener: () => Promise<void>;
206
+ removeColorCorrectionModeListener: () => Promise<void>;
207
+ removeHighContrastTextStateListener: () => Promise<void>;
208
+ removeAudioDescriptionStateListener: () => Promise<void>;
209
+ removeTimeToTakeActionListener: () => Promise<void>;
210
+ removeUiScaleSettingListener: () => Promise<void>;
211
+ removeClosedCaptioningStateListener: () => Promise<void>;
212
+ }
213
+ declare const _default: KeplerA11ySettingsInterfaceTurbo;
214
+ export default _default;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2025 - 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ *
5
+ * PROPRIETARY/CONFIDENTIAL
6
+ *
7
+ * Use is subject to license terms.
8
+ *
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.SCALING_PROP_LARGE_DOWNSCALE_TYPE = exports.SCALING_PROP_LOW_DOWNSCALE_TYPE = exports.SCALING_PROP_LARGE_UPSCALE_TYPE = exports.SCALING_PROP_MEDIUM_UPSCALE_TYPE = exports.SCALING_PROP_LOW_UPSCALE_TYPE = exports.SCALING_PROP_IMAGE_TYPE = exports.SCALING_PROP_TEXT_TYPE = exports.UiScaleSettingMode = void 0;
12
+ const keplerscript_turbomodule_api_1 = require("@amazon-devices/keplerscript-turbomodule-api");
13
+ /**
14
+ * Mapping from public-facing level name to numerical UiScaleSetting value
15
+ */
16
+ exports.UiScaleSettingMode = {
17
+ DEFAULT: 1,
18
+ };
19
+ /** Convenience ScalingProps object for text scaling when maxSize/minSize are not needed */
20
+ exports.SCALING_PROP_TEXT_TYPE = { itemType: 'text' };
21
+ /** Convenience ScalingProps object for image scaling when maxSize/minSize are not needed */
22
+ exports.SCALING_PROP_IMAGE_TYPE = { itemType: 'image' };
23
+ /** Convenience ScalingProps object for low upscale items when maxSize/minSize are not needed */
24
+ exports.SCALING_PROP_LOW_UPSCALE_TYPE = { itemType: 'low_upscale' };
25
+ /** Convenience ScalingProps object for medium upscale items when maxSize/minSize are not needed */
26
+ exports.SCALING_PROP_MEDIUM_UPSCALE_TYPE = { itemType: 'medium_upscale' };
27
+ /** Convenience ScalingProps object for large upscale items when maxSize/minSize are not needed */
28
+ exports.SCALING_PROP_LARGE_UPSCALE_TYPE = { itemType: 'large_upscale' };
29
+ /** Convenience ScalingProps object for low downscale items when maxSize/minSize are not needed */
30
+ exports.SCALING_PROP_LOW_DOWNSCALE_TYPE = { itemType: 'low_downscale' };
31
+ /** Convenience ScalingProps object for large downscale items when maxSize/minSize are not needed */
32
+ exports.SCALING_PROP_LARGE_DOWNSCALE_TYPE = { itemType: 'large_downscale' };
33
+ exports.default = keplerscript_turbomodule_api_1.TurboModuleRegistry.getEnforcing('KeplerA11ySettingsInterfaceTurbo');
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ getMajorVersion: () => number;
3
+ getMinorVersion: () => number;
4
+ getPatchVersion: () => number;
5
+ getHelloString: () => string;
6
+ };
7
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ getMajorVersion: () => 1,
5
+ getMinorVersion: () => 0,
6
+ getPatchVersion: () => 0,
7
+ getHelloString: () => 'hello',
8
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ *
4
+ * PROPRIETARY/CONFIDENTIAL
5
+ *
6
+ * Use is subject to license terms.
7
+ */
8
+ export declare const UI_SCALE_SETTING_CHANGED_EVENT = "uiScaleSettingChanged";
9
+ export declare const SCREEN_READER_STATE_CHANGED_EVENT = "screenReaderStateChanged";
10
+ export declare const SCREEN_MAGNIFIER_STATE_CHANGED_EVENT = "screenMagnifierStateChanged";
11
+ export declare const TEXT_BANNER_STATE_CHANGED_EVENT = "textBannerStateChanged";
12
+ export declare const COLOR_INVERSION_STATE_CHANGED_EVENT = "colorInversionStateChanged";
13
+ export declare const COLOR_CORRECTION_MODE_CHANGED_EVENT = "colorCorrectionModeChanged";
14
+ export declare const HIGH_CONTRAST_TEXT_STATE_CHANGED_EVENT = "highContrastTextStateChanged";
15
+ export declare const AUDIO_DESCRIPTION_STATE_CHANGED_EVENT = "audioDescriptionStateChanged";
16
+ export declare const TIME_TO_TAKE_ACTION_CHANGED_EVENT = "timeToTakeActionChanged";
17
+ export declare const CLOSED_CAPTIONING_STATE_CHANGED_EVENT = "closedCaptioningStateChanged";
18
+ export declare const CAPTIONING_PREFERENCES_CHANGED_EVENT = "captioningPreferencesChanged";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ *
5
+ * PROPRIETARY/CONFIDENTIAL
6
+ *
7
+ * Use is subject to license terms.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.CAPTIONING_PREFERENCES_CHANGED_EVENT = exports.CLOSED_CAPTIONING_STATE_CHANGED_EVENT = exports.TIME_TO_TAKE_ACTION_CHANGED_EVENT = exports.AUDIO_DESCRIPTION_STATE_CHANGED_EVENT = exports.HIGH_CONTRAST_TEXT_STATE_CHANGED_EVENT = exports.COLOR_CORRECTION_MODE_CHANGED_EVENT = exports.COLOR_INVERSION_STATE_CHANGED_EVENT = exports.TEXT_BANNER_STATE_CHANGED_EVENT = exports.SCREEN_MAGNIFIER_STATE_CHANGED_EVENT = exports.SCREEN_READER_STATE_CHANGED_EVENT = exports.UI_SCALE_SETTING_CHANGED_EVENT = void 0;
11
+ exports.UI_SCALE_SETTING_CHANGED_EVENT = 'uiScaleSettingChanged';
12
+ exports.SCREEN_READER_STATE_CHANGED_EVENT = 'screenReaderStateChanged';
13
+ exports.SCREEN_MAGNIFIER_STATE_CHANGED_EVENT = 'screenMagnifierStateChanged';
14
+ exports.TEXT_BANNER_STATE_CHANGED_EVENT = 'textBannerStateChanged';
15
+ exports.COLOR_INVERSION_STATE_CHANGED_EVENT = 'colorInversionStateChanged';
16
+ exports.COLOR_CORRECTION_MODE_CHANGED_EVENT = 'colorCorrectionModeChanged';
17
+ exports.HIGH_CONTRAST_TEXT_STATE_CHANGED_EVENT = 'highContrastTextStateChanged';
18
+ exports.AUDIO_DESCRIPTION_STATE_CHANGED_EVENT = 'audioDescriptionStateChanged';
19
+ exports.TIME_TO_TAKE_ACTION_CHANGED_EVENT = 'timeToTakeActionChanged';
20
+ exports.CLOSED_CAPTIONING_STATE_CHANGED_EVENT = 'closedCaptioningStateChanged';
21
+ exports.CAPTIONING_PREFERENCES_CHANGED_EVENT = 'captioningPreferencesChanged';
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ *
4
+ * PROPRIETARY/CONFIDENTIAL
5
+ *
6
+ * Use is subject to license terms.
7
+ */
8
+ import type { ScalingProps } from '../turbo-modules/KeplerA11ySettingsInterfaceTurbo';
9
+ /**
10
+ * Returns the factor to convert between the app's pixel space and DIP.
11
+ *
12
+ * If DIP is enabled (PixelRatio > 1), returns 1 (no conversion needed,
13
+ * the app is already passing DIP values).
14
+ *
15
+ * If DIP is not enabled, the app works in physical pixels. The conversion
16
+ * factor is calculated as physicalHeight / DIP_HEIGHT. For example:
17
+ * - 1080p device: 1080 / 540 = 2
18
+ * - 1440p device: 1440 / 540 = 2.66
19
+ * - 4K device: 2160 / 540 = 4
20
+ *
21
+ * The result is cached after the first call since the resolution does not
22
+ * change during the lifetime of the application.
23
+ */
24
+ export declare function getDipConversionFactor(): number;
25
+ /**
26
+ * Converts ScalingProps minSize and maxSize from physical pixels to DIP
27
+ * when the DIP feature is not enabled. Returns the original props if
28
+ * no conversion is needed or if the dipFactor is invalid.
29
+ */
30
+ export declare function convertScalingPropsToDip(scalingProps: ScalingProps, dipFactor: number): ScalingProps;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ *
5
+ * PROPRIETARY/CONFIDENTIAL
6
+ *
7
+ * Use is subject to license terms.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.convertScalingPropsToDip = exports.getDipConversionFactor = void 0;
11
+ const react_native_1 = require("react-native");
12
+ /** The DIP height for TV devices. */
13
+ const DIP_HEIGHT_TV = 540;
14
+ let cachedDipConversionFactor = null;
15
+ /**
16
+ * Returns the factor to convert between the app's pixel space and DIP.
17
+ *
18
+ * If DIP is enabled (PixelRatio > 1), returns 1 (no conversion needed,
19
+ * the app is already passing DIP values).
20
+ *
21
+ * If DIP is not enabled, the app works in physical pixels. The conversion
22
+ * factor is calculated as physicalHeight / DIP_HEIGHT. For example:
23
+ * - 1080p device: 1080 / 540 = 2
24
+ * - 1440p device: 1440 / 540 = 2.66
25
+ * - 4K device: 2160 / 540 = 4
26
+ *
27
+ * The result is cached after the first call since the resolution does not
28
+ * change during the lifetime of the application.
29
+ */
30
+ function getDipConversionFactor() {
31
+ if (cachedDipConversionFactor === null) {
32
+ const pixelRatio = react_native_1.PixelRatio.get();
33
+ if (pixelRatio > 1) {
34
+ cachedDipConversionFactor = 1;
35
+ }
36
+ else {
37
+ const screen = react_native_1.Dimensions.get('screen');
38
+ const screenHeight = screen?.height ?? DIP_HEIGHT_TV;
39
+ cachedDipConversionFactor = screenHeight / DIP_HEIGHT_TV;
40
+ }
41
+ }
42
+ return cachedDipConversionFactor;
43
+ }
44
+ exports.getDipConversionFactor = getDipConversionFactor;
45
+ /**
46
+ * Converts ScalingProps minSize and maxSize from physical pixels to DIP
47
+ * when the DIP feature is not enabled. Returns the original props if
48
+ * no conversion is needed or if the dipFactor is invalid.
49
+ */
50
+ function convertScalingPropsToDip(scalingProps, dipFactor) {
51
+ if (dipFactor <= 0 || dipFactor === 1) {
52
+ return scalingProps;
53
+ }
54
+ const converted = { ...scalingProps };
55
+ if (converted.minSize != null) {
56
+ converted.minSize = converted.minSize / dipFactor;
57
+ }
58
+ if (converted.maxSize != null) {
59
+ converted.maxSize = converted.maxSize / dipFactor;
60
+ }
61
+ return converted;
62
+ }
63
+ exports.convertScalingPropsToDip = convertScalingPropsToDip;