Runtime SDK
Runtime SDK
The DeskForge Runtime SDK (@deskforge/runtime) provides utilities and helpers for building Tauri-based desktop applications with type-safe APIs.
Key Features
Window Management
Control window size, fullscreen, minimize, maximize, and visibility
App Utilities
Get app version, name, exit, and relaunch functionality
IPC Communication
Type-safe communication between frontend and Tauri backend
Event System
Listen and emit events between frontend and backend
Installation
Install the runtime SDK in your DeskForge project:
npm install @deskforge/runtime
# or
pnpm add @deskforge/runtime
# or
yarn add @deskforge/runtimePeer Dependency: Requires @tauri-apps/api ^1.5.0
Quick Start
import {
initWindow,
minimizeWindow,
closeWindow,
sendCommand,
onEvent
} from '@deskforge/runtime';
// Initialize window
await initWindow({
title: 'My App',
width: 1200,
height: 800,
resizable: true,
});
// Control window
await minimizeWindow();
await closeWindow();
// Send commands to backend
const result = await sendCommand('my_command', { data: 'value' });
// Listen for events
const unlisten = await onEvent('my_event', (payload) => {
console.log('Event received:', payload);
});API Modules
TypeScript Support
The runtime SDK is written in TypeScript and provides full type definitions out of the box:
import type { WindowConfig, AppConfig, IPCResponse } from '@deskforge/runtime';
const config: WindowConfig = {
title: 'My App',
width: 1200,
height: 800,
resizable: true,
};
// Full IntelliSense and type checking
await initWindow(config);Latest Runtime version: 0.1.0
View on npm: @deskforge/runtime
GitHub: Source Code