Options
All
  • Public
  • Public/Protected
  • All
Menu

slot-calculator

Index

Type Aliases

Day: "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday"
ISOSlot: { from: string; to: string }

Type declaration

  • from: string

    ISO string.

  • to: string

    ISO string.

InputSlot: (WeekdaySlot | ISOSlot) & { metadata?: Record<any, any> }
OutputSlot: ISOSlot & { available: boolean; metadataAvailable?: Record<any, any>[]; metadataUnavailable?: Record<any, any>[] }
WeekdaySlot: { day: Day | string & {} | { locale: string; text: string } } & { from: string; timezone?: string; to: string }

Variables

default: { getSlots: ((config: { availability?: InputSlot[]; defaultAvailable?: boolean; duration: number; from?: string; outputTimezone?: string; to?: string; unavailability?: InputSlot[] }) => { allDates: string[]; allSlots: OutputSlot[]; allSlotsByDay: Record<string, OutputSlot[]>; availableDates: string[]; availableSlots: OutputSlot[]; availableSlotsByDay: Record<string, OutputSlot[]>; timeTaken: string }) }

Type declaration

  • getSlots: ((config: { availability?: InputSlot[]; defaultAvailable?: boolean; duration: number; from?: string; outputTimezone?: string; to?: string; unavailability?: InputSlot[] }) => { allDates: string[]; allSlots: OutputSlot[]; allSlotsByDay: Record<string, OutputSlot[]>; availableDates: string[]; availableSlots: OutputSlot[]; availableSlotsByDay: Record<string, OutputSlot[]>; timeTaken: string })
      • (config: { availability?: InputSlot[]; defaultAvailable?: boolean; duration: number; from?: string; outputTimezone?: string; to?: string; unavailability?: InputSlot[] }): { allDates: string[]; allSlots: OutputSlot[]; allSlotsByDay: Record<string, OutputSlot[]>; availableDates: string[]; availableSlots: OutputSlot[]; availableSlotsByDay: Record<string, OutputSlot[]>; timeTaken: string }
      • Parameters

        • config: { availability?: InputSlot[]; defaultAvailable?: boolean; duration: number; from?: string; outputTimezone?: string; to?: string; unavailability?: InputSlot[] }
          • Optional availability?: InputSlot[]

            List of available input slots.

          • Optional defaultAvailable?: boolean

            If true, all times within bounds are available by default. Defaults to true if availability is not set. Defaults to false otherwise.

          • duration: number

            Duration of each output slot in minutes.

          • Optional from?: string

            ISO string. Input slots outside of this will be ignored.

          • Optional outputTimezone?: string

            IANA zone (e.g. Europe/Paris). Defaults to local.

          • Optional to?: string

            ISO string. Input slots outside of this will be ignored.

          • Optional unavailability?: InputSlot[]

            List of unavailable input slots.

        Returns { allDates: string[]; allSlots: OutputSlot[]; allSlotsByDay: Record<string, OutputSlot[]>; availableDates: string[]; availableSlots: OutputSlot[]; availableSlotsByDay: Record<string, OutputSlot[]>; timeTaken: string }

        • allDates: string[]
        • allSlots: OutputSlot[]
        • allSlotsByDay: Record<string, OutputSlot[]>
        • availableDates: string[]
        • availableSlots: OutputSlot[]
        • availableSlotsByDay: Record<string, OutputSlot[]>
        • timeTaken: string

Functions

  • getSlots(config: { availability?: InputSlot[]; defaultAvailable?: boolean; duration: number; from?: string; outputTimezone?: string; to?: string; unavailability?: InputSlot[] }): { allDates: string[]; allSlots: OutputSlot[]; allSlotsByDay: Record<string, OutputSlot[]>; availableDates: string[]; availableSlots: OutputSlot[]; availableSlotsByDay: Record<string, OutputSlot[]>; timeTaken: string }
  • Parameters

    • config: { availability?: InputSlot[]; defaultAvailable?: boolean; duration: number; from?: string; outputTimezone?: string; to?: string; unavailability?: InputSlot[] }
      • Optional availability?: InputSlot[]

        List of available input slots.

      • Optional defaultAvailable?: boolean

        If true, all times within bounds are available by default. Defaults to true if availability is not set. Defaults to false otherwise.

      • duration: number

        Duration of each output slot in minutes.

      • Optional from?: string

        ISO string. Input slots outside of this will be ignored.

      • Optional outputTimezone?: string

        IANA zone (e.g. Europe/Paris). Defaults to local.

      • Optional to?: string

        ISO string. Input slots outside of this will be ignored.

      • Optional unavailability?: InputSlot[]

        List of unavailable input slots.

    Returns { allDates: string[]; allSlots: OutputSlot[]; allSlotsByDay: Record<string, OutputSlot[]>; availableDates: string[]; availableSlots: OutputSlot[]; availableSlotsByDay: Record<string, OutputSlot[]>; timeTaken: string }

    • allDates: string[]
    • allSlots: OutputSlot[]
    • allSlotsByDay: Record<string, OutputSlot[]>
    • availableDates: string[]
    • availableSlots: OutputSlot[]
    • availableSlotsByDay: Record<string, OutputSlot[]>
    • timeTaken: string

Generated using TypeDoc