Type alias DataTypeAdapter<ModelType, DBType>

DataTypeAdapter<ModelType, DBType>: {
    dbToModel: ((data: DBType) => Promise<ModelType> | ModelType);
    generate?: (() => Promise<ModelType> | ModelType);
    modelToDB: ((data: ModelType) => Promise<DBType> | DBType);
    validate?: ((data: ModelType) => Promise<Error | true> | Error | true);
}

Type Parameters

  • ModelType

  • DBType

Type declaration

  • dbToModel: ((data: DBType) => Promise<ModelType> | ModelType)
      • (data: DBType): Promise<ModelType> | ModelType
      • Parameters

        • data: DBType

        Returns Promise<ModelType> | ModelType

  • Optional generate?: (() => Promise<ModelType> | ModelType)
      • (): Promise<ModelType> | ModelType
      • Returns Promise<ModelType> | ModelType

  • modelToDB: ((data: ModelType) => Promise<DBType> | DBType)
      • (data: ModelType): Promise<DBType> | DBType
      • Parameters

        • data: ModelType

        Returns Promise<DBType> | DBType

  • Optional validate?: ((data: ModelType) => Promise<Error | true> | Error | true)
      • (data: ModelType): Promise<Error | true> | Error | true
      • Parameters

        • data: ModelType

        Returns Promise<Error | true> | Error | true

Generated using TypeDoc