smartmirrordisplay - v1.0.0
    Preparing search index...

    Class default

    Base class for module server-side helpers.

    A helper runs in the Node process and backs a single module. Override the lifecycle hooks (init, loaded, start, stop) and socketNotificationReceived to implement module behaviour. Use sendSocketNotification and registerRoute to communicate outward.

    Index
    expressApp: Router
    name: string
    path: string
    socketio: Namespace
    • Called in the constructor — safe for synchronous field setup, no server access yet.

      Returns void

    • Called by Core after name and path are set but before start().

      Returns void

    • Registers an Express route under the module's own path prefix (/<moduleName>). Only available when the manifest grants express.route.

      Parameters

      • method: "get" | "post" | "delete" | "put" | "use"
      • path: string
      • handler: RequestHandler

      Returns void

    • Broadcasts a notification to all clients connected to this module's namespace.

      Parameters

      • notification: string
      • payload: unknown

      Returns void

    • Parameters

      • app: Router

      Returns void

    • Parameters

      • name: string

      Returns void

    • Parameters

      • path: string

      Returns void

    • Parameters

      • socketio: Namespace

      Returns void

    • Receives every socket event emitted by the module's client-side counterpart. Override this instead of wiring socketio.on directly.

      Parameters

      • notification: string
      • payload: unknown

      Returns void

    • Async setup hook — open DB connections, start timers, etc. Called once at startup.

      Returns Promise<void>

    • Teardown hook — cancel timers, close connections.

      Returns void