New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@deskforge/runtime

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deskforge/runtime

DeskForge runtime utilities for Tauri applications

latest
npmnpm
Version
0.1.0
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

@deskforge/runtime

Runtime utilities and helpers for DeskForge Tauri applications.

Installation

npm install @deskforge/runtime

Features

  • Window Management - Control window size, fullscreen, minimize, maximize
  • App Utilities - Get app version, name, exit, and relaunch
  • IPC Communication - Type-safe communication with Tauri backend
  • Event System - Listen and emit events between frontend and backend

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 Reference

Window Management

  • initWindow(config) - Initialize window with configuration
  • minimizeWindow() - Minimize the window
  • maximizeWindow() - Maximize the window
  • closeWindow() - Close the window
  • toggleFullscreen() - Toggle fullscreen mode
  • showWindow() - Show the window
  • hideWindow() - Hide the window

App Utilities

  • initApp(config) - Initialize app with configuration
  • getAppVersion() - Get app version
  • getAppName() - Get app name
  • exitApp(code) - Exit the application
  • relaunchApp() - Relaunch the application

IPC Communication

  • sendCommand<T>(command, payload) - Send command to backend
  • onEvent(event, callback) - Listen for events
  • emitEvent(event, payload) - Emit event to backend
  • createIPCHandler<T>(command) - Create typed IPC handler

Types

interface WindowConfig {
  title?: string;
  width?: number;
  height?: number;
  minWidth?: number;
  minHeight?: number;
  resizable?: boolean;
  fullscreen?: boolean;
}

interface AppConfig {
  name: string;
  version: string;
  author?: string;
}

interface IPCMessage {
  command: string;
  payload?: any;
}

interface IPCResponse {
  success: boolean;
  data?: any;
  error?: string;
}

License

MIT

Keywords

tauri

FAQs

Package last updated on 22 Nov 2025

Related posts