Interface KernelExperimental

The Kernel class is the core of the ecmaOS system. It manages the system's resources and provides a framework for system services.

interface Kernel {
    addEventListener: (event: KernelEvents, listener: EventCallback) => void;
    auth: Auth;
    bios?: BIOSModule;
    channel: BroadcastChannel;
    components: Components;
    devices: Map<
        string,
        { device: KernelDevice; drivers?: DeviceDriver<any>[] },
    >;
    dom: Dom;
    events: Events;
    filesystem: Filesystem;
    i18n: I18n;
    id: string;
    intervals: Intervals;
    keyboard: Keyboard;
    log: Log;
    memory: Memory;
    modules: KernelModules;
    name: string;
    options: KernelOptions;
    packages: Map<string, Module>;
    processes: ProcessManager;
    protocol: Protocol;
    removeEventListener: (event: KernelEvents, listener: EventCallback) => void;
    screensavers: Map<
        string,
        {
            default: (options: { terminal: Terminal }) => Promise<void>;
            exit: () => Promise<void>;
        },
    >;
    service: Service;
    shell: Shell;
    state: KernelState;
    storage: StorageProvider;
    terminal: Terminal;
    toast: Notyf;
    users: Users;
    version: string;
    wasm: Wasm;
    windows: Windows;
    workers: Workers;
    boot(options?: BootOptions): Promise<void>;
    configure(options: KernelOptions): Promise<void>;
    execute(options: KernelExecuteOptions): Promise<number>;
    getPackageMainExport(
        pkgData: JSONSchemaForNPMPackageJsonFiles,
    ): null | string;
    notify(title: string, options?: object): Promise<void | Notification>;
    off(event: KernelEvents, listener: EventCallback): void;
    on(event: KernelEvents, listener: EventCallback): void;
    reboot(): Promise<void>;
    shutdown(): Promise<void>;
}

Properties

addEventListener: (event: KernelEvents, listener: EventCallback) => void

Add an event listener

auth: Auth

Authentication and authorization service

bios?: BIOSModule

BIOS module providing low-level functionality

Broadcast channel for inter-kernel communication

components: Components

Web Components manager

devices: Map<string, { device: KernelDevice; drivers?: DeviceDriver<any>[] }>

Map of registered devices and their drivers

dom: Dom

DOM manipulation service

events: Events

Event management system

filesystem: Filesystem

Virtual filesystem

i18n: I18n

Internationalization service

id: string

Unique identifier for this kernel instance

intervals: Intervals

Interval management service

keyboard: Keyboard

Keyboard interface

log: Log

Logging system

memory: Memory

Memory management service

modules: KernelModules

Module management service

name: string

Name of the kernel

options: KernelOptions

Configuration options passed to the kernel

packages: Map<string, Module>

Map of loaded packages

processes: ProcessManager

Process management service

protocol: Protocol

Protocol handler service

removeEventListener: (event: KernelEvents, listener: EventCallback) => void

Remove an event listener

screensavers: Map<
    string,
    {
        default: (options: { terminal: Terminal }) => Promise<void>;
        exit: () => Promise<void>;
    },
>

Map of available screensavers

service: Service

Service management system

shell: Shell

Shell for command interpretation and execution

Current state of the kernel

Storage provider interface

terminal: Terminal

Terminal interface for user interaction

toast: Notyf

Toast notification service

users: Users

User management service

version: string

Version string of the kernel

wasm: Wasm

WebAssembly service

windows: Windows

Window management service

workers: Workers

Web Worker management service

Methods

  • Experimental

    Get the main export from a package

    Parameters

    • pkgData: JSONSchemaForNPMPackageJsonFiles

    Returns null | string