Creates a function with an input schema.
API
export declare function createRuntimeFunction<
ArgsSchema extends s.HashbrownType ,
ResultSchema extends s.HashbrownType ,
>(cfg: {
name: string;
description: string;
args: ArgsSchema;
result: ResultSchema;
handler: (
input: s.Infer <ArgsSchema>,
abortSignal?: AbortSignal ,
) =>
| s.Infer <ResultSchema>
| Promise <
s.Infer <ResultSchema>
>;
}): RuntimeFunctionRef <
s.Infer <ArgsSchema>,
s.Infer <ResultSchema>
>;createRuntimeFunction
RuntimeFunctionRef<s.Infer<ArgsSchema>, s.Infer<ResultSchema>>@paramcfg:{
name: string;
description: string;
args: ArgsSchema;
result: ResultSchema;
handler: (input: s.Infer<ArgsSchema>, abortSignal?: AbortSignal) => s.Infer<ResultSchema> | Promise<s.Infer<ResultSchema>>;
}The configuration for the function containing:
name: The name of the functiondescription: The description of the functionargs: The input schema of the functionresult: The result schema of the functionhandler: The handler of the function
@typeArgsSchemas.HashbrownType@typeResultSchemas.HashbrownType@returnsRuntimeFunctionRef<s.Infer<ArgsSchema>, s.Infer<ResultSchema>>API
export declare function createRuntimeFunction<
ResultSchema extends s.HashbrownType ,
>(cfg: {
name: string;
description: string;
result: ResultSchema;
handler: (
abortSignal?: AbortSignal ,
) =>
| s.Infer <ResultSchema>
| Promise <
s.Infer <ResultSchema>
>;
}): RuntimeFunctionRef <
null,
s.Infer <ResultSchema>
>;createRuntimeFunction
RuntimeFunctionRef<null, s.Infer<ResultSchema>>@paramcfg:{
name: string;
description: string;
result: ResultSchema;
handler: (abortSignal?: AbortSignal) => s.Infer<ResultSchema> | Promise<s.Infer<ResultSchema>>;
}The configuration for the function containing:
name: The name of the functiondescription: The description of the functionresult: The result schema of the functionhandler: The handler of the function
@typeResultSchemas.HashbrownType@returnsRuntimeFunctionRef<null, s.Infer<ResultSchema>>API
export declare function createRuntimeFunction<
ArgsSchema extends s.HashbrownType ,
>(cfg: {
name: string;
description: string;
args: ArgsSchema;
handler: (
args: s.Infer <ArgsSchema>,
abortSignal?: AbortSignal ,
) => void | Promise <void>;
}): RuntimeFunctionRef <
s.Infer <ArgsSchema>,
void
>;createRuntimeFunction
RuntimeFunctionRef<s.Infer<ArgsSchema>, void>@paramcfg:{
name: string;
description: string;
args: ArgsSchema;
handler: (args: s.Infer<ArgsSchema>, abortSignal?: AbortSignal) => void | Promise<void>;
}The configuration for the function containing:
name: The name of the functiondescription: The description of the functionargs: The args schema of the functionhandler: The handler of the function
@typeArgsSchemas.HashbrownType@returnsRuntimeFunctionRef<s.Infer<ArgsSchema>, void>API
export declare function createRuntimeFunction(cfg: {
name: string;
description: string;
handler: (
abortSignal?: AbortSignal ,
) => void | Promise <void>;
}): RuntimeFunctionRef <null, void>;createRuntimeFunction
RuntimeFunctionRef<null, void>@paramcfg:{
name: string;
description: string;
handler: (abortSignal?: AbortSignal) => void | Promise<void>;
}The configuration for the function containing:
name: The name of the functiondescription: The description of the functionhandler: The handler of the function, which returns void or a promise thereof
@returnsRuntimeFunctionRef<null, void>