UNPKG

@rschedule/rschedule

Version:

A typescript library for working with recurring dates and events.

39 lines 2.05 kB
import { DateAdapter } from '../date-adapter'; import { IDataContainer, IOccurrenceGenerator, OccurrenceGenerator } from '../interfaces'; import { CollectionIterator, ICollectionsArgs, IOccurrencesArgs, OccurrenceIterator } from '../iterators'; import { OccurrenceStream, OperatorFnOutput } from '../operators'; declare const CALENDAR_ID: unique symbol; export declare class Calendar<T extends typeof DateAdapter, D = any> extends OccurrenceGenerator<T> implements IDataContainer<D> { /** * Similar to `Array.isArray()`, `isCalendar()` provides a surefire method * of determining if an object is a `Calendar` by checking against the * global symbol registry. */ static isCalendar(object: unknown): object is Calendar<any>; readonly schedules: ReadonlyArray<IOccurrenceGenerator<T>>; /** * Convenience property for holding arbitrary data. Accessible on individual DateAdapters * generated by this `Calendar` object via the `DateAdapter#generators` property. Unlike * the rest of the `Calendar` object, the data property is mutable. */ data: D; pipe: (...operatorFns: OperatorFnOutput<T>[]) => OccurrenceStream<T>; readonly isInfinite: boolean; readonly hasDuration: boolean; protected readonly [CALENDAR_ID] = true; constructor(args?: { schedules?: ReadonlyArray<IOccurrenceGenerator<T>> | IOccurrenceGenerator<T>; data?: D; dateAdapter?: T; timezone?: string | null; maxDuration?: number; }); occurrences(args?: IOccurrencesArgs<T>): OccurrenceIterator<T, [this, ...IOccurrenceGenerator<T>[]]>; collections(args?: ICollectionsArgs<T>): CollectionIterator<T, [this, ...IOccurrenceGenerator<T>[]]>; set(prop: 'timezone', value: string | null, options?: { keepLocalTime?: boolean; }): Calendar<T, D>; set(prop: 'schedules', value: ReadonlyArray<IOccurrenceGenerator<T>> | IOccurrenceGenerator<T>): Calendar<T, D>; } export {}; //# sourceMappingURL=calendar.d.ts.map