Cloesce - v0.0.5-unstable.27
    Preparing search index...

    Type Alias DataSourceOf<T>

    DataSourceOf: (KeysOfType<T, IncludeTree<T>> | "none") & {
        __brand?: "DataSource";
    }

    Represents the name of a @DataSource available on a model type T, or "none" when no data source (no joins) should be applied.

    All instantiated model methods implicitly have a Data Source param __dataSource.

    Type Parameters

    • T extends object

      The model type for which to define the data source.

      Example:

      D1
      export class Person {
      PrimaryKey id: number;

      DataSource
      static readonly default: IncludeTree<Person> = { dogs: {} };

      POST
      foo(ds: DataSourceOf<Person>) {
      // Cloesce won't append an implicit data source param here since it's explicit
      }
      }

      // on the API client:
      async foo(ds: "default" | "none"): Promise<void> {...}