@tmlmobilidade/utils
Version:
A collection of utility functions and helpers for the TML Mobilidade Go monorepo, providing common functionality for batching operations, caching, HTTP requests, object manipulation, permissions, and more.
16 lines (15 loc) • 567 B
TypeScript
import { UnixTimestamp } from '@tmlmobilidade/types';
import { DurationObjectUnits } from 'luxon';
export interface PerformInTimeChunksItem {
end: UnixTimestamp;
index: number;
start: UnixTimestamp;
total: number;
}
export interface PerformInTimeChunksOptions {
endDate?: UnixTimestamp;
onChunk: (chunk: PerformInTimeChunksItem) => Promise<void>;
splitBy: DurationObjectUnits;
startDate: UnixTimestamp;
}
export declare function performInTimeChunks({ endDate, onChunk, splitBy, startDate }: PerformInTimeChunksOptions): Promise<void>;