import { DateAdapter } from '../date-adapter'; import { IDataContainer, OccurrenceGenerator } from '../interfaces'; import { CollectionIterator, ICollectionsArgs, IOccurrencesArgs, OccurrenceIterator } from '../iterators'; import { OccurrenceStream, OperatorFnOutput } from '../operators'; import { DateInput } from '../utilities'; declare const DATES_ID: unique symbol; export declare class Dates extends OccurrenceGenerator implements IDataContainer { /** * Similar to `Array.isArray()`, `isDates()` provides a surefire method * of determining if an object is a `Dates` by checking against the * global symbol registry. */ static isDates(object: unknown): object is Dates; readonly length: number; readonly adapters: ReadonlyArray>; /** Returns the first occurrence or, if there are no occurrences, null. */ readonly firstDate: InstanceType | null; /** Returns the last occurrence or, if there are no occurrences, null. */ readonly lastDate: InstanceType | null; readonly isInfinite = false; readonly hasDuration: boolean; readonly maxDuration: number; readonly timezone: string | null; pipe: (...operatorFns: OperatorFnOutput[]) => OccurrenceStream; /** * Convenience property for holding arbitrary data. Accessible on individual DateAdapters * generated by this `Dates` object via the `DateAdapter#generators` property. Unlike * the rest of the `Dates` object, the data property is mutable. */ data: D; protected readonly [DATES_ID] = true; private readonly datetimes; constructor(args?: { timezone?: string | null; duration?: number; dates?: ReadonlyArray>; data?: D; dateAdapter?: T; }); occurrences(args?: IOccurrencesArgs): OccurrenceIterator; collections(args?: ICollectionsArgs): CollectionIterator; add(value: DateInput): Dates; remove(value: DateInput): Dates; /** * Dates are immutable. This allows you to create a new `Dates` with the * specified property changed. * * ### Important! * * When updating `Dates#timezone`, this does not actually change the timezone of the * underlying date objects wrapped by this `Dates` instance. Instead, when this `Dates` * object is iterated and a specific date is found to be * valid, only then is that date converted to the timezone you specify here and returned to * you. * * This distinction might matter when viewing the timezone associated with * `Dates#adapters`. If you wish to update the timezone associated with the `date` objects * this `Dates` is wrapping, you must update the individual dates themselves by setting * the `dates` property. * */ set(prop: 'timezone', value: string | null, options?: { keepLocalTime?: boolean; }): Dates; /** * Dates are immutable. This allows you to create a new `Dates` with new date objects. */ set(prop: 'dates', value: DateInput[]): Dates; /** * Dates are immutable. This allows you to create a new `Dates` with all of the underlying * date objects set to have the specified `duration`. Duration is a length of time, * expressed in milliseconds. */ set(prop: 'duration', value: number | undefined): Dates; filter(fn: (date: InstanceType, index: number, array: ReadonlyArray>) => boolean): Dates; } export {}; //# sourceMappingURL=dates.d.ts.map