import { AsyncStorage } from '../types/AsyncStorage.js'; import { SyncStorage } from '../types/SyncStorage.js'; /** * Property decorator that saves the value of a property into storage whenever the property value changes. * * Support is provided for both synchronous and asynchronous storage mechanisms, including: * 1) LocalStorage * 2) SessionStorage * 3) custom storage implementations based of the SyncStorage or AsyncStorage classes. * * The decorator can be used in any of the following decorator implementations: * 1) Typescript (experimentalDecorators: true) * 2) Babel Legacy (version: "legacy"), and * 3) Babel Standard (version: "2018-09") * * @param args - The decorator arguments. * - storage: The storage mechanism to write property value changes to. * - key: The storage key to write property values under. * * ```js * import { ObservableProperty } from '@capitec/omni-state'; * * class AppState { * * @state({ storage: SessionStorage, key: 'my-property' }) * myProperty = 'Hello World'; * * @state({ storage: LocalStorage, key: 'settings' }) * appSettings = new ObservableProperty(); * } * ``` * * @returns The decorator property descriptor (Babel Standard) or nothing (TypeScript and Babel Legacy). */ export declare function stateExperimental({ storage, key }: { storage: SyncStorage | AsyncStorage; key: string; }): (target: any, propertyKey: string) => void; //# sourceMappingURL=stateExperimental.d.ts.map