// Package: com.lightningkite.lightningdb // Generated by Khrysalis, then edited import { path } from './ConditionBuilder' import { DataClassPath } from './DataClassPath' import { SortPart } from './SortPart' import { also } from '@lightningkite/khrysalis-runtime' //! Declares com.lightningkite.lightningdb.sort export function sort(setup: ((a: SortBuilder, b: DataClassPath) => void)): Array> { return also(new SortBuilder(), (this_: SortBuilder): void => { setup(this_, path()); }).build(); } //! Declares com.lightningkite.lightningdb.SortBuilder export class SortBuilder { public constructor() { this.sortParts = ([] as Array>); } public readonly sortParts: Array>; public add(sort: SortPart): void { this.sortParts.push(sort); } public build(): Array> { return Array.from(this.sortParts); } public ascending(this_: DataClassPath): SortPart { return new SortPart(this_, true, undefined); } public descending(this_: DataClassPath): SortPart { return new SortPart(this_, false, undefined); } public ascendingString(this_: DataClassPath, ignoreCase: boolean): SortPart { return new SortPart(this_, true, ignoreCase); } public descendingString(this_: DataClassPath, ignoreCase: boolean): SortPart { return new SortPart(this_, false, ignoreCase); } }