Type Alias StaticMethodsFrom<Manifest, Methods, InstanceMethods, RelationFields>

StaticMethodsFrom: {
    [K in keyof Methods]: (
        this: ManifestTypes<Manifest, Methods, InstanceMethods, RelationFields>["Model"] & Methods,
        ...args: Parameters<Methods[K]>,
    ) => ReturnType<Methods[K]>
}

Map a methods object to include the correct this type for model statics.

This lets manifest authors describe their method signatures without manually repeating this: ModelType on every function. The returned type still exposes the fully-typed this context to callers.

Type Parameters

  • Manifest extends ModelManifest
  • Methods extends MethodRecord
  • InstanceMethods extends Record<string, InstanceMethod> = EmptyInstanceMethods
  • RelationFields extends object = Record<never, never>