UNPKG

@mulutime/plugin-types

Version:

TypeScript types for the MuluTime plugin system

128 lines (91 loc) 2.78 kB
# @mulutime/plugin-types TypeScript types for the MuluTime plugin system. This package provides comprehensive type definitions for building plugins that integrate with the MuluTime platform. ## Installation ```bash npm install @mulutime/plugin-types ``` ## Usage ```typescript import { Plugin, PluginConfig, PluginContext, Integration, SystemEvent } from '@mulutime/plugin-types'; // Define your plugin const myPlugin: Plugin = { id: 'my-plugin', name: 'My Plugin', version: '1.0.0', // ... other plugin properties }; // Use integration types const integration: Integration = { // ... integration configuration }; ``` ## Type Definitions This package exports types for: - **Plugin System**: Core plugin interfaces and configurations - **Integrations**: Third-party service integration definitions - **System Events**: Event types and handlers for the plugin system - **Core Types**: Base types and utilities used throughout the system ## API Reference ### Core Types The main types exported by this package include: - `Plugin` - Main plugin interface - `PluginConfig` - Plugin configuration options - `PluginContext` - Runtime context provided to plugins - `Integration` - Third-party integration definitions - `SystemEvent` - System event types and payloads ### Usage Examples #### Creating a Plugin ```typescript import { Plugin, PluginConfig } from '@mulutime/plugin-types'; const config: PluginConfig = { // Plugin configuration }; const plugin: Plugin = { id: 'example-plugin', name: 'Example Plugin', version: '1.0.0', config, // Implementation details }; ``` #### Handling System Events ```typescript import { SystemEvent } from '@mulutime/plugin-types'; function handleEvent(event: SystemEvent) { // Handle different event types switch (event.type) { case 'plugin-loaded': // Handle plugin loaded event break; case 'integration-connected': // Handle integration connected event break; } } ``` ## Development This package is built with TypeScript and provides full type safety for MuluTime plugin development. ### Building ```bash npm run build ``` ### Type Checking ```bash npm test ``` ## Contributing We welcome contributions! Please see our [contributing guidelines](../../CONTRIBUTING.md) for details. ## License MIT License - see [LICENSE](LICENSE) file for details. ## Support For issues and questions: - [GitHub Issues](https://github.com/YOUR_USERNAME/mulutime-plugin-system/issues) - [Documentation](https://github.com/YOUR_USERNAME/mulutime-plugin-system) --- **Fara Technology AB** - Building the future of plugin systems