UNPKG

restate-for-dummies

Version:

Type-safe Restate SDK wrapper with simplified API

48 lines 3.37 kB
import type { Client, Context, ObjectContext, SendClient, Serde, ServiceDefinition, VirtualObjectDefinition, WorkflowContext, WorkflowDefinition, WorkflowSharedContext } from "@restatedev/restate-sdk"; /** * Creates a typed service client that automatically injects serde configuration * @param ctx The Restate context * @param service The service definition * @param serde The serialization/deserialization configuration */ export declare function createServiceClient<THandlers>(ctx: Context | ObjectContext | WorkflowContext | WorkflowSharedContext, service: ServiceDefinition<string, THandlers>, serde: Serde<unknown>): Client<THandlers>; /** * Creates a typed object client that automatically injects serde configuration * @param ctx The Restate context * @param object The virtual object definition to create a client for * @param key The unique identifier for the object instance * @param serde The serialization/deserialization configuration */ export declare function createObjectClient<THandlers>(ctx: Context | ObjectContext | WorkflowContext | WorkflowSharedContext, object: VirtualObjectDefinition<string, THandlers>, key: string, serde: Serde<unknown>): Client<THandlers>; /** * Creates a typed workflow client that automatically injects serde configuration * @param ctx The Restate context * @param workflow The workflow definition to create a client for * @param key The unique identifier for the workflow instance * @param serde The serialization/deserialization configuration */ export declare function createWorkflowClient<THandlers>(ctx: Context | ObjectContext | WorkflowContext | WorkflowSharedContext, workflow: WorkflowDefinition<string, THandlers>, key: string, serde: Serde<unknown>): Client<THandlers>; /** * Creates a typed service send client that automatically injects serde configuration * @param ctx The Restate context * @param service The service definition * @param serde The serialization/deserialization configuration */ export declare function createServiceSendClient<THandlers>(ctx: Context | ObjectContext | WorkflowContext | WorkflowSharedContext, service: ServiceDefinition<string, THandlers>, serde: Serde<unknown>): SendClient<THandlers>; /** * Creates a typed object send client that automatically injects serde configuration * @param ctx The Restate context * @param object The virtual object definition for send operations * @param key The unique identifier for the object instance * @param serde The serialization/deserialization configuration */ export declare function createObjectSendClient<THandlers>(ctx: Context | ObjectContext | WorkflowContext | WorkflowSharedContext, object: VirtualObjectDefinition<string, THandlers>, key: string, serde: Serde<unknown>): SendClient<THandlers>; /** * Creates a typed workflow send client that automatically injects serde configuration * @param ctx The Restate context * @param workflow The workflow definition for send operations * @param key The unique identifier for the workflow instance * @param serde The serialization/deserialization configuration */ export declare function createWorkflowSendClient<THandlers>(ctx: Context | ObjectContext | WorkflowContext | WorkflowSharedContext, workflow: WorkflowDefinition<string, THandlers>, key: string, serde: Serde<unknown>): SendClient<THandlers>; //# sourceMappingURL=client-wrapper.d.ts.map