Type Alias MergeManifestMethods<Manifest, StaticMethods, InstanceMethods>

MergeManifestMethods: Manifest & (
    keyof StaticMethods extends never
        ? unknown
        : { staticMethods: StaticMethods }
) & (
    keyof InstanceMethods extends never
        ? unknown
        : { instanceMethods: InstanceMethods }
)

Merge additional static/instance methods into a manifest type.

This is used when you define methods separately from the manifest (e.g., in models/*.ts files) and need to combine them.

The conditional checks handle the case where no methods are provided (empty objects) by using unknown to avoid adding empty properties.

Uses intersection to preserve the original manifest's relations type.

Type Parameters

  • Manifest extends ModelManifest
  • StaticMethods extends object
  • InstanceMethods extends object