Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T: object = object

Hierarchy

  • CookiesStatic

Index

Properties

defaults

Allows default cookie attributes to be accessed, changed, or reset

Methods

get

  • get(name: string): undefined | string
  • get(): {}
  • Read cookie

    Parameters

    • name: string

    Returns undefined | string

  • Read all available cookies

    Returns {}

    • [key: string]: string

getJSON

  • getJSON(name: string): any
  • getJSON(): {}
  • Returns the parsed representation of the string stored in the cookie according to JSON.parse

    Parameters

    • name: string

    Returns any

  • Returns the parsed representation of all cookies according to JSON.parse

    Returns {}

    • [key: string]: any

Optional noConflict

noConflict:

remove

  • Delete cookie

    Parameters

    Returns void

set

  • set(name: string, value: string | T, options?: CookieAttributes): undefined | string
  • Create a cookie

    Parameters

    Returns undefined | string

withConverter

  • Create a new instance of the api that overrides the default decoding implementation. All methods that rely in a proper decoding to work, such as Cookies.remove() and Cookies.get(), will run the converter first for each cookie. The returned string will be used as the cookie value.

    Type parameters

    • TConv: object

    Parameters

    Returns CookiesStatic<TConv>

Generated using TypeDoc