import type { Any, Merge, TryPick } from "./utils/ts.js"; import type { IocBind, IocContext, IocParams, IocParamsUserConfig, IocRegistryData, IocRegistryKey } from "@dreamkit/ioc"; import type { ExactType, InferType, MinimalObjectType, MinimalType, ObjectType, ObjectTypeProps } from "@dreamkit/schema"; export type FuncParams = MinimalType | undefined; export type FuncSelf = IocParamsUserConfig | undefined; export type FuncTitle = string | undefined; export type FuncData = { params?: TParams; self?: TSelf; title?: TTitle; }; export type FuncOptions = T & { register?: IocRegistryData; onCreate?: (func: Func) => Func; onCall?: (data: { callback: (this: any, params: any) => any; params: Record; options: FuncCallOptions; }) => any; cache?: { key?: string; }; static?: Record; }; export type MergeFuncData> = Merge; export type InferFuncParams = A extends MinimalType ? InferType : A extends ObjectTypeProps ? InferType> : undefined; export type ResolveParamsType = A extends MinimalType ? A : A extends ObjectTypeProps ? ObjectType : undefined; export type FuncMeta = { readonly params: TryPick, "props", TryPick>; readonly $self: TryPick; readonly title: TryPick; $clone: () => Func; $options: FuncOptions; bind: IocBind ? any : [T["self"]] extends [undefined] ? void : keyof T["self"] extends never ? void : IocParams, FuncBody<{ params: T["params"]; }, R>>; }; export type FuncCallOptions = { self: (unknown extends Any ? any : IocParams) | IocContext; with?: [IocRegistryKey, any][]; } & (unknown extends Any ? { params: any; } : A extends undefined ? { params?: undefined; } : { params: InferFuncParams; }); export type ResolveFuncParams = undefined extends T["params"] ? [] : [InferFuncParams]; export type ResolveFuncBody = (...data: ResolveFuncParams) => R; export type FuncBody = >(this: [T["self"]] extends [undefined] ? void : keyof T["self"] extends never ? void : IocParams, ...data: undefined extends T["params"] ? [] : [params: ExactType & {}]) => R; export type Func = FuncBody & FuncMeta; export type ResolveFunc, Meta = true> = F extends Func ? ResolveFuncBody & ([Meta] extends [true] ? FuncMeta : {}) : never; export {}; //# sourceMappingURL=types.d.ts.map