import type { OBJECT_IDENTIFIER } from "@wildboar/asn1"; import type OrderingMatcher from "../types/OrderingMatcher.mjs"; import type { SortKey } from "../modules/DirectoryAbstractService/SortKey.ta.mjs"; import type { EntryInformation } from "../modules/DirectoryAbstractService/EntryInformation.ta.mjs"; /** * @summary Sort entries via sort keys of a paged results request. * @description * * This function implements entry sorting according to sort keys, as specified * in ITU Recommendation X.511 (2016), section 7.9, which deals with paged * results. This implementation returns >0 if A is greater, <0 if B is greater, * and 0 if they are equal so that this can be used easily with `Array.sort()`. * * This implementation does not handle reverse-sorting. This should just be * handled by `Array.reverse()`. * * The specification does not mention how to handle attribute subtyping, so this * implementation does not use attribute subtyping. * * @param {SortKey[]} keys The keys by which to sort the entries. * @param {EntryInformation} a The entry that is compared to entry B. * @param {EntryInformation} b The entry that is compared to entry A. * @param {function} getOrderingMatcher A function that takes an object * identifier of an attribute type and returns a function that sorts values of * that attribute type. * @param {boolean} onlyRDN Whether to only sort values found in the relative * distinguished name, as would be desirable when implementing the Directory * Access Protocol (DAP) `list` operation. * @returns {number} >0 if A is greater, <0 if B is greater, and 0 if they are equal. * @function */ export declare function sort(keys: SortKey[], a: EntryInformation, b: EntryInformation, getOrderingMatcher: (attributeType: OBJECT_IDENTIFIER) => OrderingMatcher | undefined, onlyRDN?: boolean): number; export default sort; //# sourceMappingURL=sort.d.mts.map