Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typing): 给与getStorageSync泛型默认值any #7824

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/taro/types/api/storage/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare namespace Taro {
/** 本地缓存中指定的 key */
key: string,
/** 需要存储的内容。只支持原生类型、Date、及能够通过`JSON.stringify`序列化的对象。 */
data: any,
data: any
): void

namespace setStorage {
Expand Down Expand Up @@ -93,7 +93,7 @@ declare namespace Taro {
*/
function removeStorageSync(
/** 本地缓存中指定的 key */
key: string,
key: string
): void

namespace removeStorage {
Expand Down Expand Up @@ -155,9 +155,9 @@ declare namespace Taro {
* ```
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageSync.html
*/
function getStorageSync<T>(
function getStorageSync<T = any>(
/** 本地缓存中指定的 key */
key: string,
key: string
): T

namespace getStorageInfoSync {
Expand Down