import type { CookieItem, CookieOptions, CookieTarget } from '../definitions/interfaces.js'; import type { KeyOf } from '../definitions/types.js'; import { Cookie } from './cookie.js'; /** * The AsyncCookie class is an abstraction to implement any asynchronous cookie API in an uniform way. * * [Aracna Reference](https://aracna.dariosechi.it/core/classes/async-cookie) */ export declare class AsyncCookie extends Cookie { constructor(name: string, clear: (options?: ClearOptions) => Promise, get: (key: string, options?: GetOptions) => Promise, has: (key: string, options?: HasOptions) => Promise, remove: (key: string, keys?: KeyOf.Shallow[], options?: RemoveOptions) => Promise, set: (key: string, item: T, options?: SetOptions) => Promise); /** * Clears all cookies. */ clear(options?: ClearOptions): Promise; /** * Retrieves an item from the cookies. */ get(key: string, options?: GetOptions): Promise; /** * Removes an item from the cookies. * Optionally you can specify the keys of the item that you want to remove, if you don't specify any key the whole item will be removed. */ remove(key: string, keys?: KeyOf.Shallow[], options?: RemoveOptions): Promise; /** * Sets an item in the cookies. * Optionally you can specify the keys of the item that you want to set, if you don't specify any key the whole item will be set. */ set(key: string, item: T, keys?: KeyOf.Deep[], options?: SetOptions): Promise; /** * Copies an item from the cookies to a target object. * Optionally you can specify the keys of the item that you want to copy, if you don't specify any key the whole item will be copied. */ copy(key: string, target: T2, keys?: KeyOf.Deep[], options?: CopyOptions): Promise; /** * Checks if an item exists in the cookies. * Optionally you can specify the keys of the item that you want to check, if you don't specify any key the whole item will be checked. */ has(key: string, keys?: KeyOf.Deep[], options?: HasOptions): Promise; }