import { type BaseComponent } from '../../base_component.js'; import { type Constructor } from '../../types.js'; /** * Mixin that adds `this.stream(name, content, mode?)` to Component. * * Calling `stream()` writes an NDJSON frame straight to the raw HTTP * response, immediately — not buffered until the action finishes. This is * what makes it actually progressive: a slow action that calls `stream()` * three times, 1 second apart, delivers each chunk to the browser as it * happens, the same way PHP Livewire's `ob_flush()`-per-call does. * * The client already handles this protocol: it detects the * `X-Livewire-Stream` header, reads the response body as a stream, * extracts JSON objects matching `{"stream":true,...,"endStream":true}`, * and applies each chunk to the matching `wire:stream="name"` element. * * IMPORTANT: the target element's content must ALSO come from real * component state that `render()` outputs — Livewire's post-action morph * doesn't special-case `wire:stream` elements (only `wire:ignore`), so if * nothing in real state reflects what was streamed, morph wipes it back * out the moment the action completes. See wire_stream.md. */ export declare function HandlesStream>(Base: T): { new (...args: any[]): { /** * Push an incremental HTML update to the client, right now. * * @param name - The `wire:stream="name"` target element's name * @param content - HTML content to send * @param mode - `'append'` (default) adds to the element; `'replace'` replaces its innerHTML */ stream(name: string, content: string, mode?: "replace" | "append"): void; "__#170@#id": string; "__#170@#name": string; "__#170@#viewPath": string; "__#170@#view": ReturnType; "__#170@#viewData": Record; "__#170@#router": import("@adonisjs/core/types").HttpRouterService; bindings: any; app: import("@adonisjs/core/types").ApplicationService; ctx: import("@adonisjs/http-server").HttpContext; __setRouter(router: import("@adonisjs/core/types").HttpRouterService): void; __getRouter(): import("@adonisjs/core/types").HttpRouterService; __id: string; __name: string; viewPath: string; view: ReturnType; viewData: Record; setId(id: string): void; getId(): string; setName(name: string): void; setViewPath(view: string): void; getName(): string; render(): Promise; skipRender(html?: string): void; transition(type?: string): void; skipTransition(): void; shouldSkipRender(): boolean; skipMount(): void; skipHydrate(): void; }; } & T;