firelordjs
Version:
🔥 High Precision Typescript Wrapper for Firestore Web, Providing Unparalleled Type Safe and Dev Experience
10 lines (9 loc) • 560 B
TypeScript
import { OrderByDirection, QueryOrderByConstraint } from '../alias';
import { MetaType, GetAllCompareKeys } from '../metaTypeCreator';
import { __name__ } from '../fieldPath';
export type OrderByConstraint<FieldPath extends string> = {
type: 'orderBy';
fieldPath: FieldPath;
ref: QueryOrderByConstraint;
};
export type OrderBy = <T extends MetaType, FieldPath extends GetAllCompareKeys<T> | __name__, DirectionStr extends OrderByDirection | undefined = undefined>(fieldPath: FieldPath, directionStr?: DirectionStr) => OrderByConstraint<FieldPath>;