import { Decorator } from '../support_decorators/decorator.js'; import type ComponentContext from '../../component_context.js'; /** * PHP parity: Livewire\Attributes\Json * * Marks an action as a JSON-style endpoint: the method's return value * resolves directly on the client (`let data = await $wire.search(q)`) * instead of triggering the usual re-render/morph cycle. That return- * value plumbing (`effects.returns`, resolved by the vendored client * bundle's `resolveActionPromises()`) already exists for every action * regardless of this decorator - request_handler.ts's `callMethods()` * pushes every call's result there unconditionally. `@json()` only adds * the other two behaviors real Livewire documents for it: * * 1. Skip re-render - reuses the same store('skipRender') mechanism as * `@renderless()`, but scoped to just this method (unlike * Renderless.call(), which ignores the method name it's given and * applies to every action on the component). * 2. Run outside the request queue - same memo.async mechanism as * `@async()` (see support_async/async.ts). * 3. Isolate validation errors - when a @json action throws a validation * error, it is isolated to promise rejection via returnsMeta with * HTTP 422 errors instead of flashing to session / component error bag. */ export default class Json extends Decorator { name: string; constructor(name: string); call(method: string): Promise; dehydrate(context: ComponentContext): Promise; }