import type { GenericMessage } from '@enbox/dwn-sdk-js';
/**
 * Builds a dependency graph from the fetched messages and returns them in
 * topological order so that dependencies are processed before dependents.
 *
 * Dependencies:
 * - ProtocolsConfigure must come before any RecordsWrite using that protocol
 * - Composed ProtocolsConfigure must come after ProtocolsConfigure messages for protocols in `uses`
 * - Parent record must come before child record (via parentId)
 * - Initial write must come before update writes (same recordId, not initial)
 * - Permission grants must come before messages that invoke them
 */
export declare function topologicalSort<T extends {
    message: GenericMessage;
}>(messages: T[]): T[];
//# sourceMappingURL=sync-topological-sort.d.ts.map