UNPKG

@yoyo-org/progressive-json

Version:

Stream and render JSON data as it arrives - perfect for AI responses, large datasets, and real-time updates

27 lines (26 loc) 718 B
import type { Plugin, PlaceholderStore } from "../resolve-placeholder"; /** * Server-side message creator for increment plugin */ export declare function increment(key: string, value?: number): { type: string; key: string; value: number | undefined; }; export type IncrementMessage = { type: "increment"; key: string; value: number | undefined; }; /** * Increment Plugin * * Handles "increment" message type that increments a numeric value. * * Example server usage: * ```ts * writer(increment(counterRef)); // Increments by 1 * writer(increment(counterRef, 5)); // Increments by 5 * ``` */ export declare const incrementPlugin: Plugin<IncrementMessage, PlaceholderStore<unknown>>;