跳至主要內容

Class: storage<CT>

muzzik小于 1 分钟

index / storage

Class: storage<CT>

存储器(类型安全)

Remarks

  • (原生/web)接口分离,获得更高的性能

Type parameters

NameType
CTextends Object

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new storage<CT>(init_)

Type parameters

NameType
CTextends Object

Parameters

NameType
init_init_config<CT>

Defined in

assets/@framework/mk_storage.ts:18open in new window

Properties

key

key: { [k in string | number | symbol]: k }

存储数据键

Defined in

assets/@framework/mk_storage.ts:29open in new window

Methods

clear

Static clear(): void

清空所有存储器数据

Returns

void

Defined in

assets/@framework/mk_storage.ts:45open in new window


set

set<T>(key_, data_): boolean

设置存储数据

Type parameters

NameType
Textends string | number | symbol

Parameters

NameTypeDescription
key_T存储键
data_any存储数据

Returns

boolean

storage.status

Defined in

assets/@framework/mk_storage.ts:60open in new window


get

get<T, T2>(key_): T2

获取数据

Type parameters

NameType
Textends string | number | symbol
T2T2

Parameters

NameTypeDescription
key_T存储键

Returns

T2

Defined in

assets/@framework/mk_storage.ts:93open in new window


del

del<T>(key_): void

删除数据

Type parameters

NameType
Textends string | number | symbol

Parameters

NameTypeDescription
key_T存储键

Returns

void

Defined in

assets/@framework/mk_storage.ts:132open in new window


clear

clear(): void

清空当前存储器数据

Returns

void

Defined in

assets/@framework/mk_storage.ts:143open in new window

📣 觉得很赞?分享给你的朋友吧!