md-curcuma
Version:
A Typescript library for transporting and converting markdown and other data.
31 lines (30 loc) • 1.18 kB
TypeScript
import { Data_Interface } from "../io/types";
export type Observer_Command_Type = "perform-tasks" | "tasks-finished" | "do-io-write" | "do-not-io-write";
export type Observer_Type = "runner";
export type Observable_Type = "markdown-io" | "md-splitter-task" | "json-io" | "xlsx-io" | "csv-io";
export interface Observer_Props<D> {
from: Observable_Type;
to: Observer_Type;
command: Observer_Command_Type;
dao: Data_Interface<D>;
}
export interface Observable<D> {
add_observer(observer: Observer_Interface<D>, id: Observer_Type): void;
notify_all(props: Observer_Props<D>): void;
notify(props: Observer_Props<D>): void;
}
export declare class Observer_Item<D> {
observer_id: Observer_Type;
observer_obj: Observer_Interface<D>;
}
export interface Observer_Interface<D> {
do_command(props: Observer_Props<D>): void;
get_observer_id(): Observer_Type;
}
export declare class Observer_Subject<D> {
protected observers: Array<Observer_Item<D>>;
constructor();
add_observer(observer: Observer_Interface<D>, id: Observer_Type): void;
notify_all(props: Observer_Props<D>): void;
notify(props: Observer_Props<D>): void;
}