import { Registration } from './feedback'; import { Component, Gettable, Listenable, Settable } from './mixins'; import { Listener, Path } from './types'; /** * Interface to XAPI configurations. */ export class Config extends Listenable(Settable(Gettable(Component))) { public prefix = 'Configuration'; // fake mixins public normalizePath!: (path: Path) => (string | number)[]; public on!: (path: Path, listener: Listener) => Registration; public once!: (path: Path, listener: Listener) => Registration; public off!: () => void; public get!: (path: Path) => Promise; public set!: (path: Path, value: number | string) => Promise; } /** * Interface to XAPI events. */ export class Event extends Listenable(Component) { public prefix = 'Event'; // fake mixins public normalizePath!: (path: Path) => (string | number)[]; public on!: (path: Path, listener: Listener) => Registration; public once!: (path: Path, listener: Listener) => Registration; public off!: () => void; } /** * Interface to XAPI statuses. */ export class Status extends Listenable(Gettable(Component)) { public prefix = 'Status'; // fake mixins public normalizePath!: (path: Path) => (string | number)[]; public on!: (path: Path, listener: Listener) => Registration; public once!: (path: Path, listener: Listener) => Registration; public off!: () => void; public get!: (path: Path) => Promise; }