{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface ConfigureOptions {\n /**\n * Set the preferences group.\n *\n * Preferences groups are used to organize key/value pairs.\n *\n * Using the value 'NativeStorage' provides backwards-compatibility with\n * [`cordova-plugin-nativestorage`](https://www.npmjs.com/package/cordova-plugin-nativestorage).\n * WARNING: The `clear()` method can delete unintended values when using the\n * 'NativeStorage' group.\n *\n * @default CapacitorStorage\n * @since 1.0.0\n */\n group?: string;\n}\n\nexport interface GetOptions {\n /**\n * The key whose value to retrieve from preferences.\n *\n * @since 1.0.0\n */\n key: string;\n}\n\nexport interface GetResult {\n /**\n * The value from preferences associated with the given key.\n *\n * If a value was not previously set or was removed, value will be `null`.\n *\n * @since 1.0.0\n */\n value: string | null;\n}\n\nexport interface SetOptions {\n /**\n * The key to associate with the value being set in preferences.\n *\n * @since 1.0.0\n */\n key: string;\n\n /**\n * The value to set in preferences with the associated key.\n *\n * @since 1.0.0\n */\n value: string;\n}\n\nexport interface RemoveOptions {\n /**\n * The key whose value to remove from preferences.\n *\n * @since 1.0.0\n */\n key: string;\n}\n\nexport interface KeysResult {\n /**\n * The known keys in preferences.\n *\n * @since 1.0.0\n */\n keys: string[];\n}\n\nexport interface MigrateResult {\n /**\n * An array of keys that were migrated.\n *\n * @since 1.0.0\n */\n migrated: string[];\n\n /**\n * An array of keys that were already migrated or otherwise exist in preferences\n * that had a value in the Capacitor 2 Preferences plugin.\n *\n * @since 1.0.0\n */\n existing: string[];\n}\n\nexport interface PreferencesPlugin {\n /**\n * Configure the preferences plugin at runtime.\n *\n * Options that are `undefined` will not be used.\n *\n * @since 1.0.0\n */\n configure(options: ConfigureOptions): Promise;\n\n /**\n * Get the value from preferences of a given key.\n *\n * @since 1.0.0\n */\n get(options: GetOptions): Promise;\n\n /**\n * Set the value in preferences for a given key.\n *\n * @since 1.0.0\n */\n set(options: SetOptions): Promise;\n\n /**\n * Remove the value from preferences for a given key, if any.\n *\n * @since 1.0.0\n */\n remove(options: RemoveOptions): Promise;\n\n /**\n * Clear keys and values from preferences.\n *\n * @since 1.0.0\n */\n clear(): Promise;\n\n /**\n * Return the list of known keys in preferences.\n *\n * @since 1.0.0\n */\n keys(): Promise;\n\n /**\n * Migrate data from the Capacitor 2 Storage plugin.\n *\n * This action is non-destructive. It will not remove old data and will only\n * write new data if they key was not already set.\n * To remove the old data after being migrated, call removeOld().\n *\n * @since 1.0.0\n */\n migrate(): Promise;\n\n /**\n * Removes old data with `_cap_` prefix from the Capacitor 2 Storage plugin.\n *\n * @since 1.1.0\n */\n removeOld(): Promise;\n}\n"]}