helene
Version:
Real-time Web Apps for Node.js
13 lines (12 loc) • 907 B
TypeScript
import { ServerMethodDefinition, ServerMethods } from '../utils';
import { z } from 'zod';
import { MethodFunction, MethodOptions } from './method';
export declare function ns<Namespace extends string | undefined = undefined, Methods extends ServerMethods = ServerMethods>(namespace?: Namespace, submodules?: Methods): {
add: {
<Name extends string, Schema extends z.ZodUndefined | z.ZodObject<any>, ResultType>(methodName: Name, fn: MethodFunction<z.input<Schema>, ResultType>, options?: MethodOptions<Schema>): ReturnType<typeof ns<Namespace, Methods & { [K in Name]: ServerMethodDefinition<Schema, ResultType>; }>>;
<Name extends string, NestedNamespace extends ServerMethods>(name: Name, nested: NestedNamespace): ReturnType<typeof ns<Namespace, Methods & { [K in Name]: NestedNamespace; }>>;
};
build: () => Methods;
submodules: Methods;
register: () => Methods;
};