Type alias HasOneSetAssociationMixin<T, TModelPrimaryKey>

HasOneSetAssociationMixin<T, TModelPrimaryKey>: {
    (newAssociation, options?): Promise<null>;
    (newAssociation, options?): Promise<T>;
}

Type Parameters

  • T extends Model

  • TModelPrimaryKey

Type declaration

    • (newAssociation, options?): Promise<null>
    • The setAssociation mixin applied to models with hasOne. An example of usage is as follows:

      class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
      declare setRole: HasOneSetAssociationMixin<Role, Role['id']>;
      }

      User.hasOne(Role);

      Parameters

      Returns Promise<null>

      See

      Model.hasOne

    • (newAssociation, options?): Promise<T>
    • The setAssociation mixin applied to models with hasOne. An example of usage is as follows:

      class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
      declare setRole: HasOneSetAssociationMixin<Role, Role['id']>;
      }

      User.hasOne(Role);

      Parameters

      Returns Promise<T>

      See

      Model.hasOne

Generated using TypeDoc