import { CancelledError, RestateError, RetryableError, RetryableErrorOptions, TerminalError, TimeoutError } from "./types/errors.js";
import { Client, ClientCallOptions, ClientSendOptions, InferArg, ObjectHandlerOpts, ObjectOptions, ObjectOpts, Opts, RemoveVoidArgument, RetryPolicy, SendClient, SendOpts, ServiceHandlerOpts, ServiceOptions, ServiceOpts, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, handlers, object, rpc, service, workflow } from "./types/rpc.js";
import { Context, ContextDate, DurablePromise, GenericCall, GenericSend, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, KeyValueStore, ObjectContext, ObjectSharedContext, Rand, Request, RestatePromise, RunAction, RunOptions, SendOptions, TypedState, UntypedState, WorkflowContext, WorkflowSharedContext } from "./context.js";
import { LogMetadata, LogSource, LoggerContext, LoggerTransport, RestateLogLevel } from "./logging/logger_transport.js";
import { DefaultServiceOptions, RestateEndpoint, RestateEndpointBase } from "./endpoint.js";
import { EndpointOptions } from "./endpoint/types.js";
import { CombineablePromise, Duration, JournalValueCodec, ObjectHandler, RestateContext, RestateObjectContext, RestateObjectSharedContext, RestateWorkflowContext, RestateWorkflowSharedContext, Serde, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceHandler, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowHandler, WorkflowSharedHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, serde } from "./common_api.js";
import * as http20 from "http2";

//#region src/node.d.ts
/**
 * Create a new {@link RestateEndpoint}.
 * @deprecated Please use {@link createEndpointHandler}
 */
declare function endpoint(): RestateEndpoint;
/**
 * Creates an HTTP/2 request handler for the provided services.
 *
 * @example
 * ```
 * const httpServer = http2.createServer(createEndpointHandler({ services: [myService] }));
 * httpServer.listen(port);
 * ```
 * @param {EndpointOptions} options - Configuration options for the endpoint handler.
 * @returns An HTTP/2 request handler function.
 */
declare function createEndpointHandler(options: EndpointOptions): (request: http20.Http2ServerRequest, response: http20.Http2ServerResponse) => void;
interface ServeOptions extends EndpointOptions {
  port?: number;
}
/**
 * Serves this Restate services as HTTP2 server, listening to the given port.
 *
 * If the port is undefined, this method will use the port set in the `PORT`
 * environment variable. If that variable is undefined as well, the method will
 * default to port 9080.
 *
 * The returned promise resolves with the bound port when the server starts listening, or rejects with a failure otherwise.
 *
 * If you need to manually control the server lifecycle, we suggest to manually instantiate the http2 server and use {@link createEndpointHandler}.
 *
 * @param {ServeOptions} options - Configuration options for the endpoint handler.
 * @returns a Promise that resolves with the bound port, or rejects with a failure otherwise.
 */
declare function serve({
  port,
  ...options
}: ServeOptions): Promise<number>;
//#endregion
export { CancelledError, Client, ClientCallOptions, ClientSendOptions, CombineablePromise, Context, ContextDate, DefaultServiceOptions, DurablePromise, Duration, EndpointOptions, GenericCall, GenericSend, InferArg, InvocationHandle, InvocationId, InvocationIdParser, InvocationPromise, JournalValueCodec, KeyValueStore, LogMetadata, LogSource, LoggerContext, LoggerTransport, ObjectContext, ObjectHandler, ObjectHandlerOpts, ObjectOptions, ObjectOpts, ObjectSharedContext, Opts, Rand, RemoveVoidArgument, Request, RestateContext, RestateEndpoint, RestateEndpointBase, RestateError, RestateLogLevel, RestateObjectContext, RestateObjectSharedContext, RestatePromise, RestateWorkflowContext, RestateWorkflowSharedContext, RetryPolicy, RetryableError, RetryableErrorOptions, RunAction, RunOptions, SendClient, SendOptions, SendOpts, Serde, ServeOptions, Service, ServiceDefinition, ServiceDefinitionFrom, ServiceHandler, ServiceHandlerOpts, ServiceOptions, ServiceOpts, TerminalError, TimeoutError, TypedState, UntypedState, VirtualObject, VirtualObjectDefinition, VirtualObjectDefinitionFrom, Workflow, WorkflowContext, WorkflowDefinition, WorkflowDefinitionFrom, WorkflowHandler, WorkflowHandlerOpts, WorkflowOptions, WorkflowOpts, WorkflowSharedContext, WorkflowSharedHandler, createEndpointHandler, createObjectHandler, createObjectSharedHandler, createServiceHandler, createWorkflowHandler, createWorkflowSharedHandler, endpoint, handlers, object, rpc, serde, serve, service, workflow };
//# sourceMappingURL=node.d.ts.map