import { Subject } from 'rxjs'; import { GenericFunction, LocalObject } from './general'; /** * Parameters for registering a data source with the data service. */ export declare class RegisterDataSourceParams { /** * The unique identifier for the data source. */ id: string; /** * The message for the data source. */ message?: DataSourceMessage; /** * The initial value for the data source. */ value?: unknown; /** * Whether to emit the first value. */ emitFirstValue?: boolean; /** * Whether to emit if the value is undefined. */ emitIfUndefined?: boolean; constructor(id?: string, message?: DataSourceMessage, value?: unknown, emitFirstValue?: boolean, emitIfUndefined?: boolean); } /** * A message for a data source. */ export declare class DataSourceMessage { /** * The unique identifier for the sender. Defaults to 'root'. */ senderID: string; /** * The unique identifier for the target. Defaults to 'all'. */ targetID: string; /** * The value of the message. */ value: unknown; /** * Whether to emit the message. Defaults to true. */ emit?: boolean; constructor(value?: unknown, senderID?: string, targetID?: string); /** * Checks if the reader can read the value, and if so, calls the callback with the value. * * @param reader - The object reading the value. * @param callback - The callback to call with the value. */ readValue(reader: LocalObject, callback: GenericFunction): void; [key: string]: unknown; } /** * A data source. */ export declare class DataSource { /** * The subject for the data source. */ value$: Subject; /** * The observable for the value. */ valueObservable: import("rxjs").Observable; /** * The unique identifier for the data source. */ id: string; /** * The stored value of the data source. */ private _value?; constructor(id?: string, message?: DataSourceMessage, emitFirstValue?: boolean, emitIfUndefined?: boolean); /** * @returns The value of the data source. */ getValue(): unknown; /** * Sets the value of the data source. * * @param message - The message to set the value. */ setValue(message: Partial): void; } export type DataSourceCallback = (message: DataSourceMessage) => void;