npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tudada-sdk-types

v0.0.1-3

Published

TypeScript type definitions for TudadaSDK - H5 web game SDK for Tudada platform

Readme

tudada-sdk-types

TypeScript type definitions for TudadaSDK - H5 web game SDK for Tudada platform.

Installation

npm install tudada-sdk-types

Usage

Global Types (Recommended)

After installing tudada-sdk-types, global types are automatically available without any import:

// No import needed! Types are automatically recognized
TudadaSDK.login({
  success: (res) => console.log('Login code:', res.code),
  fail: (err) => console.error('Login failed:', err.errMsg),
});

const systemInfo = TudadaSDK.getSystemInfoSync();
console.log('Platform:', systemInfo.platform);

This works because the package includes global.d.ts which declares the global TudadaSDK and tudadaSDK variables.

Import Types

You can also import types directly:

import type {
  LoginOption,
  LoginSuccessResult,
  SystemInfo,
  UserInfo,
  RewardedVideoAd,
} from 'tudada-sdk-types';

// Use types in your code
const handleLogin = (options: LoginOption) => {
  TudadaSDK.login(options);
};

const systemInfo: SystemInfo = TudadaSDK.getSystemInfoSync();

Available Types

Auth API

  • LoginOption, LoginSuccessResult
  • CheckSessionOption
  • GetUserInfoOption, GetUserInfoSuccessResult, UserInfo

Storage API

  • SetStorageOption, GetStorageOption, GetStorageSuccessResult
  • RemoveStorageOption, ClearStorageOption
  • StorageInfo
  • TudadaStore, TudadaStoreGetOption, TudadaStoreSaveOption

System API

  • SystemInfo, GetSystemInfoOption
  • WindowInfo, GetWindowInfoOption
  • AppBaseInfo, GetAppBaseInfoOption
  • DeviceInfo, GetDeviceInfoOption
  • Platform, SafeArea

UI API

  • MenuButtonBoundingClientRect

Device API

  • VibrateShortOption, VibrateLongOption, VibrateType
  • ShowKeyboardOption, HideKeyboardOption
  • OnKeyboardInputCallback, OnKeyboardConfirmCallback, OnKeyboardCompleteCallback

Clipboard API

  • SetClipboardDataOption
  • GetClipboardDataOption, GetClipboardDataSuccessResult

Ad API

  • CreateRewardedVideoAdOption
  • RewardedVideoAd

Lifecycle API

  • OnShowCallback, OnShowCallbackResult
  • OnHideCallback, OnHideCallbackResult
  • ExitMiniProgramOption, RestartMiniProgramOption

SDK Interface

  • ITudadaSDK - Main SDK interface

Common Types

  • GeneralCallbackResult
  • Mock<T>

Global Variables

When TudadaSDK is loaded via script tag, the following global variables are available:

  • TudadaSDK / tudadaSDK - Main SDK instance
  • window.TudadaSDK / window.tudadaSDK

Example

import type { SystemInfo, UserInfo, RewardedVideoAd } from 'tudada-sdk-types';

// Get system info
const systemInfo: SystemInfo = TudadaSDK.getSystemInfoSync();
console.log('Platform:', systemInfo.platform);
console.log('Screen size:', systemInfo.screenWidth, 'x', systemInfo.screenHeight);

// Login
TudadaSDK.login({
  success: (res) => {
    console.log('Login code:', res.code);

    // Get user info
    TudadaSDK.getUserInfo({
      success: (userRes) => {
        const user: UserInfo = userRes.userInfo;
        console.log('Nickname:', user.nickName);
        console.log('Avatar:', user.avatarUrl);
      },
    });
  },
});

// Create rewarded video ad
const ad: RewardedVideoAd = TudadaSDK.createRewardedVideoAd({
  adUnitId: 'your-ad-unit-id',
});

ad.onLoad(() => console.log('Ad loaded'));
ad.onError((err) => console.error('Ad error:', err.errMsg));
ad.onClose((res) => {
  if (res.isEnded) {
    console.log('Ad completed - give reward!');
  }
});

ad.load().then(() => ad.show());

License

MIT