UNPKG

appium-ios-simulator

Version:
142 lines 6.81 kB
import type { CoreSimulator, HasSettings, DevicePreferences, CommonPreferences, RunOptions, LocalizationOptions } from '../types'; import type { StringRecord } from '@appium/types'; type CoreSimulatorWithSettings = CoreSimulator & HasSettings; /** * Updates Reduce Motion setting state. * * @param reduceMotion Whether to enable or disable the setting. */ export declare function setReduceMotion(this: CoreSimulatorWithSettings, reduceMotion: boolean): Promise<boolean>; /** * Updates Reduce Transparency setting state. * * @param reduceTransparency Whether to enable or disable the setting. */ export declare function setReduceTransparency(this: CoreSimulatorWithSettings, reduceTransparency: boolean): Promise<boolean>; /** * Disable keyboard tutorial as 'com.apple.keyboard.preferences' domain via 'defaults' command. * @returns Promise that resolves to true if settings were updated */ export declare function disableKeyboardIntroduction(this: CoreSimulatorWithSettings): Promise<boolean>; /** * Allows to update Simulator preferences in runtime. * * @param domain The name of preferences domain to be updated, * for example, 'com.apple.Preferences' or 'com.apple.Accessibility' or * full path to a plist file on the local file system. * @param updates Mapping of keys/values to be updated * @returns True if settings were actually changed */ export declare function updateSettings(this: CoreSimulatorWithSettings, domain: string, updates: StringRecord): Promise<boolean>; /** * Sets UI appearance style. * This function can only be called on a booted simulator. * * @param value one of possible appearance values: * - dark: to switch to the Dark mode * - light: to switch to the Light mode * @since Xcode SDK 11.4 */ export declare function setAppearance(this: CoreSimulatorWithSettings, value: string): Promise<void>; /** * Gets the current UI appearance style * This function can only be called on a booted simulator. * * @returns the current UI appearance style. * Possible values are: * - dark: to switch to the Dark mode * - light: to switch to the Light mode * @since Xcode SDK 11.4 */ export declare function getAppearance(this: CoreSimulatorWithSettings): Promise<string>; /** * Sets the increase contrast configuration for the given simulator. * This function can only be called on a booted simulator. * * @param _value valid increase contrast configuration value. * Acceptable value is 'enabled' or 'disabled' with Xcode 16.2. * @since Xcode SDK 15 (but lower xcode could have this command) */ export declare function setIncreaseContrast(this: CoreSimulatorWithSettings, _value: string): Promise<void>; /** * Retrieves the current increase contrast configuration value from the given simulator. * This function can only be called on a booted simulator. * * @returns the contrast configuration value. * Possible return value is 'enabled', 'disabled', * 'unsupported' or 'unknown' with Xcode 16.2. * @since Xcode SDK 15 (but lower xcode could have this command) */ export declare function getIncreaseContrast(this: CoreSimulatorWithSettings): Promise<string>; /** * Sets content size for the given simulator. * This function can only be called on a booted simulator. * * @param _value valid content size or action value. Acceptable value is * extra-small, small, medium, large, extra-large, extra-extra-large, * extra-extra-extra-large, accessibility-medium, accessibility-large, * accessibility-extra-large, accessibility-extra-extra-large, * accessibility-extra-extra-extra-large with Xcode 16.2. * @since Xcode SDK 15 (but lower xcode could have this command) */ export declare function setContentSize(this: CoreSimulatorWithSettings, _value: string): Promise<void>; /** * Retrieves the current content size value from the given simulator. * This function can only be called on a booted simulator. * * @return the content size value. Possible return value is * extra-small, small, medium, large, extra-large, extra-extra-large, * extra-extra-extra-large, accessibility-medium, accessibility-large, * accessibility-extra-large, accessibility-extra-extra-large, * accessibility-extra-extra-extra-large, * unknown or unsupported with Xcode 16.2. * @since Xcode SDK 15 (but lower xcode could have this command) */ export declare function getContentSize(this: CoreSimulatorWithSettings): Promise<string>; /** * Change localization settings on the currently booted simulator * * @param opts Localization options * @throws {Error} If there was a failure while setting the preferences * @returns `true` if any of settings has been successfully changed */ export declare function configureLocalization(this: CoreSimulatorWithSettings, opts?: LocalizationOptions): Promise<boolean>; /** * Updates Auto Fill Passwords setting state. * * @param isEnabled Whether to enable or disable the setting. * @returns Promise that resolves to true if settings were updated */ export declare function setAutoFillPasswords(this: CoreSimulatorWithSettings, isEnabled: boolean): Promise<boolean>; /** * Update the common iOS Simulator preferences file with new values. * It is necessary to restart the corresponding Simulator before * these changes are applied. * * @param devicePrefs The mapping, which represents new device preference values * for the given Simulator. * @param commonPrefs The mapping, which represents new common preference values * for all Simulators. * @return True if the preferences were successfully updated. */ export declare function updatePreferences(this: CoreSimulatorWithSettings, devicePrefs?: DevicePreferences, commonPrefs?: CommonPreferences): Promise<boolean>; /** * Creates device and common Simulator preferences, which could * be later applied using `defaults` CLI utility. * * @param opts Run options * @returns The first array item is the resulting device preferences * object and the second one is common preferences object */ export declare function compileSimulatorPreferences(this: CoreSimulatorWithSettings, opts?: RunOptions): [DevicePreferences, CommonPreferences & Record<string, any>]; /** * Perform verification of device preferences correctness. * * @param prefs The preferences to be verified * @returns void * @throws {Error} If any of the given preference values does not match the expected * format. */ export declare function verifyDevicePreferences(this: CoreSimulatorWithSettings, prefs?: DevicePreferences): void; export {}; //# sourceMappingURL=settings.d.ts.map