UNPKG

@promptbook/remote-server

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

18 lines (17 loc) 691 B
import { BehaviorSubject } from 'rxjs'; /** * A type that represents a value that can be updated over time: * * 1) It can be a static value of type `TValue` * 2) Or a `BehaviorSubject` that emits values of type `TValue` * 3) Or pair of `[getValue, setValue]` functions for getting and setting the value */ export type Updatable<TValue> = TValue | BehaviorSubject<TValue> | [TValue, (value: TValue) => void]; /** * Restricts an Updatable to a (2) BehaviorSubject variant * * @see Updatable * * @private internal utility <- TODO: [🧠] Maybe export from `@promptbook/types` */ export declare function asUpdatableSubject<TValue>(value: Updatable<TValue>): BehaviorSubject<TValue>;