0.0.8 • Published 4 years ago

@byted-creative/stt-promisify v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

User Guide

@byted-dino/tt-promisify

简介

将 tt 的异步接口封装成 promise 版本

使用说明

浏览器下的支持使用 tmg-h5-sdk 实现

安装

npm安装

npm install @byted-dino/tt-promisify

yarn安装

yarn add @byted-dino/tt-promisify

使用方法

####小游戏

import stt from "@byted-dino/tt-promisify";

try {
    const res = await stt.showToast({
        title: "hello",
        icon: "none",
        duration: 6000
    });
} catch(err) {
    console.log(err);
}
 
stt.showToast({
    title: "hello",
    icon: "none",
    duration: 6000
}).then(res => {
    console.log(res);
}).catch(err => {
    console.log(err);
})

####小程序

try {
    const res = await stt.getMenuButtonBoundingClientRect({});
    console.log(res);
} catch(err) {
    console.log(err);
}

stt.getMenuButtonBoundingClientRect({}).then(res => {
    console.log(res);
}).catch(err => {
    console.log(err);
})
0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago