@aracna/core - v1.5.0
    Preparing search index...

    Class AsyncCookie<Options, GetOptions, SetOptions, ClearOptions, CopyOptions, HasOptions, RemoveOptions>

    The AsyncCookie class is an abstraction to implement any asynchronous cookie API in an uniform way.

    Aracna Reference

    Type Parameters

    Hierarchy

    Index

    Constructors

    Properties

    _clear: Clear
    _get: Get
    _has: Has
    _remove: Remove
    _set: Set
    name: string

    The cookie instance name.

    options?: Options

    The cookie options.

    Methods

    • Parameters

      • cleared: void | Error

      Returns void | Error

    • Returns the name of the instance.

      Returns string

    • Returns the separator used to separate the cookie name from the cookie item key.

      Returns string

    • 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.

      Type Parameters

      Parameters

      • key: string
      • Optionalkeys: (keyof T)[]
      • Optionaloptions: HasOptions

      Returns Promise<boolean>

    • Type Parameters

      Parameters

      • keys: (keyof T)[] | undefined
      • item: Error | T

      Returns boolean

    • 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.

      Type Parameters

      Parameters

      Returns Promise<void | Error>

    • Parameters

      • key: string
      • removed: void | Error

      Returns void | Error

    • 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.

      Type Parameters

      Parameters

      • key: string
      • item: T
      • Optionalkeys: (keyof T)[]
      • Optionaloptions: SetOptions

      Returns Promise<void | Error>

    • Type Parameters

      Parameters

      • key: string
      • item: Error | T
      • set: void | Error

      Returns void | Error

    • Type Parameters

      Parameters

      • item: T
      • keys: (keyof T)[]
      • current: Error | T

      Returns Error | T