I'm looking for a spec / library or standard that allows me to specify an interface for instance:
interface Customer {
firstName: string,
lastName: string,
createdAt: Date,
age: number,
}
type CustomerQuery = Query<Customer>
Where this would be valid:
const customerQuery:CustomerQuery = {
age: {
greaterThan: '29'
}
}
This query would be valid because all properties would be optional ? and Query would see the types of the incoming interface and allow number to queryable with greaterThen, greaterThenEqual, lessThen, lessThenEqual, or a value itself, etc.
Querytype to transform the interface, as to the library recommendation, not sure if there is onetype CustomerQuery = Query<Partial<Customer>>>,<, properties, strings could have regexes possibly.