UNPKG

@rivetkit/react

Version:

_Lightweight Libraries for Backends_

28 lines (25 loc) 1.34 kB
import * as _rivetkit_core_client from '@rivetkit/core/client'; import { Client, ExtractActorsFromRegistry } from '@rivetkit/core/client'; export { createClient } from '@rivetkit/core/client'; import { AnyActorRegistry, CreateRivetKitOptions, ActorOptions } from '@rivetkit/framework-base'; declare function createRivetKit<Registry extends AnyActorRegistry>(client: Client<Registry>, opts?: CreateRivetKitOptions<Registry>): { useActor: <ActorName extends keyof ExtractActorsFromRegistry<Registry>>(opts: ActorOptions<Registry, ActorName>) => { useEvent: (eventName: string, handler: (...args: any[]) => void) => void; hash: string; isConnected?: boolean | undefined; isConnecting?: boolean | undefined; isError?: boolean | undefined; error: Error | null; opts: { name: keyof ExtractActorsFromRegistry<Registry>; key: string | string[]; params?: Record<string, string>; createInRegion?: string; createWithInput?: unknown; enabled?: boolean; }; handle: _rivetkit_core_client.ActorHandle<ExtractActorsFromRegistry<Registry>[ActorName]> | null; connection: _rivetkit_core_client.ActorConn<ExtractActorsFromRegistry<Registry>[ActorName]> | null; }; }; export { createRivetKit };