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

kaios-types

v0.1.1

Published

TypeScript type definitions for KaiOS 2.5 Web APIs

Downloads

34

Readme

KaiOS TypeScript Type Declarations

TypeScript type definitions for KaiOS. Currently supports KaiOS v2.5, the successor to Firefox OS also known as Boot2Gecko (B2G).

npm version License

Overview

This package provides comprehensive TypeScript type definitions for the proprietary Web APIs available in KaiOS. These APIs give access to telephony, SMS, Bluetooth, WiFi, contacts, camera, and more.

Note: Most of these APIs are non-standard and proprietary to KaiOS platform. Many require specific permissions in your app's manifest (manifest.webapp) and are restricted to certain app types (i.e. privileged or certified).

Documentation

For more information on KaiOS development, see the KaiOS Developer Portal, KaiOS.dev blog, and BananaHackers website.

Installation

NPM

npm install --save-dev kaios-types

PNPM

pnpm add kaios-types --save-dev

Bun

bun add --development kaios-types

Usage

Option 1: Global Type Declarations (Recommended)

Add the types to your tsconfig.json:

{
  "compilerOptions": {
    "types": ["kaios-types"]
  }
}

Or use a triple-slash directive at the top of your TypeScript files:

/// <reference types="kaios-types" />

// Now KaiOS APIs are available with full type checking
const settings = navigator.mozSettings;
settings.createLock().set({ 'wifi.enabled': true });

Option 2: Modular Imports

You can also import specific types directly:

import { MozActivity, ActivityOptions } from 'kaios-types/apps/moz-activity';
import { BluetoothManager } from 'kaios-types/bluetooth/bluetooth-manager';

const activity = new MozActivity({
  name: 'pick',
  data: { type: 'image/jpeg' }
});

API Categories

📱 Apps & Activities

  • Applications - Install, manage, and launch apps
  • Activities - Inter-app communication and task delegation
  • Push Notifications - SimplePush for notifications
  • Downloads - File download management

📡 Connectivity

  • Telephony - Make and receive phone calls
  • SMS/MMS - Send and receive messages
  • Mobile Network - Network status, signal strength, roaming
  • WiFi - Connect to networks, WiFi Direct
  • Bluetooth - Full Bluetooth stack with GATT support
  • NFC - Near Field Communication and secure elements
  • TCP/UDP Sockets - Low-level network communication

🎬 Media & Hardware

  • Camera - Photo and video capture
  • FM Radio - FM tuner control
  • TV - TV tuner functionality
  • Volume - System volume management

💾 Data & Storage

  • Contacts - Address book management
  • DataStore - Inter-app data sharing
  • Device Storage - File system access (sdcard, pictures, music, videos)

⚙️ System

  • Settings - Read and modify system settings
  • Power - Screen brightness, power off, reboot
  • Alarms - Schedule app wake-ups
  • Wake Locks - Prevent device sleep
  • Time - Set system time
  • Permissions - Manage app permissions

Examples

Send an SMS

const sms = navigator.mozMobileMessage;
const request = sms.send('+1234567890', 'Hello from KaiOS!');

request.onsuccess = () => {
  console.log('SMS sent successfully');
};

request.onerror = () => {
  console.error('Failed to send SMS:', request.error);
};

Control WiFi

const wifi = navigator.mozWifiManager;

// Enable WiFi
wifi.setWifiEnabled(true);

// Scan for networks
const request = wifi.getNetworks();
request.onsuccess = () => {
  const networks = request.result;
  networks.forEach((network) => {
    console.log(`Found network: ${network.ssid}`);
  });
};

Access Contacts

const contacts = navigator.mozContacts;

const request = contacts.find({
  filterBy: ['givenName'],
  filterValue: 'John',
  filterOp: 'contains'
});

request.onsuccess = () => {
  const cursor = request.result;
  cursor.forEach((contact) => {
    console.log(`Contact: ${contact.givenName} ${contact.familyName}`);
  });
};

Adjust Volume

const volumeManager = navigator.volumeManager;

// Increase volume
volumeManager.requestUp();

// Decrease volume
volumeManager.requestDown();

// Show volume UI
volumeManager.requestShow();

Compatibility

  • KaiOS Version: 2.5
  • TypeScript Version: 5.0+
  • Based on: Mozilla Boot to Gecko (B2G) / Firefox OS APIs

API Documentation

For detailed API documentation and usage guidelines, see:

License

Apache License 2.0

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.