/** * adowire — WireProvider * * AdonisJS v7 service provider that wires together the adowire runtime: * * register() * - Binds an `Adowire` singleton to the IoC container holding * { registry, snapshot, config } * * boot() * - Reads config/adowire.ts (with sensible defaults) * - Registers the Edge.js plugin (tags + globals) * - Registers the POST /adowire/message route * - Triggers component auto-discovery */ import type { ApplicationService } from '@adonisjs/core/types'; import { ComponentRegistry } from '../src/component_registry.js'; import { SnapshotManager } from '../src/snapshot.js'; import type { AdowireConfig } from '../src/types.js'; export declare const ADOWIRE_BINDING: "adowire"; export interface AdowireBinding { registry: ComponentRegistry; snapshot: SnapshotManager; config: AdowireConfig; } declare module '@adonisjs/core/types' { interface ContainerBindings { adowire: AdowireBinding; } } declare module '@adonisjs/http-server' { interface Router { /** * Register a GET route that renders a WireComponent as a full page. * No controller, no wrapper view needed — the component IS the page. * * Equivalent to Livewire's `Route::livewire()` in Laravel. * * Route parameters are passed directly to the component's `mount()`: * ```ts * // start/routes.ts * router.adowire('/posts/:id', 'posts.show') * * // app/adowire/posts/show.ts * async mount({ id }: Record) { * this.post = await Post.findOrFail(id) * this.$title = `Post: ${this.post.title}` * } * ``` */ adowire(path: string, componentName: string): any; } } export default class WireProvider { protected app: ApplicationService; constructor(app: ApplicationService); /** * Bind the `Adowire` singleton to the container. * * We defer the full initialisation (config read, discovery, etc.) to * boot() because other providers (e.g. the Edge provider) may not have * run yet during register(). * * The binding is created as a lazy singleton so the heavyweight * SnapshotManager / ComponentRegistry objects are only constructed once. */ register(): Promise; /** * 1. Resolve the Adowire binding (builds registry + snapshot). * 2. Register the Edge.js plugin. * 3. Register the POST /adowire/message route. * 4. Run component auto-discovery. */ boot(): Promise; }