UNPKG

simple-fs-rotator

Version:
23 lines (22 loc) 815 B
import { AuditEntry, DateComponents, RotationSettings } from "./types"; export default class Rotator { settings: RotationSettings; private currentSize; private lastDate; private fileIndx; constructor(settings: RotationSettings, lastEntry?: AuditEntry); private getSizeForFile; hasMaxSizeReached(): boolean; hasMaxFilesReached(): boolean; shouldRotate(): boolean; private isFormatValidForDaily; private isFormatValidForHour; private isFormatValidForMinutes; getDateString(date?: Date): string; private getFilename; getNewFilename(): string; addBytes(bytes: number): void; rotate(force?: boolean): void; static getDateComponents(date: Date, utc: boolean): DateComponents; static createDate(components: DateComponents, utc: boolean): Date; }