OiO.lk Blog javascript Able to use interface as generic before interface is declared
javascript

Able to use interface as generic before interface is declared


Why does this work? I would expect SomeInterface to not be defined in time to be passed as an argument:

interface SomeInterface
  extends Model<
    InferAttributes<SomeInterface>,
    InferCreationAttributes<SomeInterface>
  >
{ ...

(example from https://sequelize.org/api/v7/types/_sequelize_core.index.inferattributes)



You need to sign in to view this answers

Exit mobile version