Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LocalStorage

表示全局本地缓存容器。

static
class
version

1.0.0

Hierarchy

  • LocalStorage

Index

Constructors

Properties

Accessors

Methods

Constructors

Private constructor

Properties

Static Private _proxy

_proxy: any

Accessors

Static proxy

  • get proxy(): any
  • set proxy(value: any): void

Static size

  • get size(): number
  • 获取本地缓存容器的存储数量。

    static
    property

    Returns number

    number

Methods

Static clear

  • clear(): void

Static Private deserialize

  • deserialize(str: string): any
  • 将指定的字符串反序列化为一个对象。

    static

    Parameters

    • str: string

      待反序列化的字符串。

    Returns any

    any 反序列化后的实例,如果反序列化失败则返回 undefined。

Static get

  • get<T>(key: string): T
  • 从缓存中获取指定键名的值。

    static

    Type parameters

    • T

    Parameters

    • key: string

      缓存键。

    Returns T

    T

Static remove

  • remove(key: string): void
  • 从缓存中移除指定键名的值。

    static

    Parameters

    • key: string

      缓存键。

    Returns void

    void

Static Private serialize

  • serialize(obj: any): string
  • 将指定的字符串序列化为一个字符串。

    static

    Parameters

    • obj: any

      待序列化的对象。

    Returns string

    string 序列化的字符串。

Static set

  • set(key: string, value: any): void
  • 将指定的键值对加入缓存中。

    static

    Parameters

    • key: string

      缓存键。

    • value: any

    Returns void

    void

Generated using TypeDoc