@kermank/slots
Version:
A TypeScript library for handling time slots, scheduling, and timezone operations
29 lines (28 loc) • 1.42 kB
TypeScript
import { Slot, SlotOperationOptions, SlotOperationResult } from '../types';
type SlotInput = Slot | Slot[];
/**
* Returns the intersection of slots
* Works with both single slots and arrays of slots
*/
export declare function intersectSlots(a: SlotInput, b: SlotInput, options: SlotOperationOptions): SlotOperationResult;
/**
* Returns the union of slots
* Works with both single slots and arrays of slots
*/
export declare function unionSlots(a: SlotInput, b: SlotInput, options: SlotOperationOptions): SlotOperationResult;
/**
* Returns slots from A with any overlapping portions from B removed
* Will split slots that partially overlap and keep non-overlapping portions
*/
export declare const removeOverlappingSlots: (slots: SlotInput, slotsToRemove: SlotInput, options: SlotOperationOptions) => SlotOperationResult;
/**
* Returns the symmetric difference between slots (parts that belong to only one input)
* Works with both single slots and arrays of slots
*/
export declare function symmetricDifferenceSlots(a: SlotInput, b: SlotInput, options: SlotOperationOptions): SlotOperationResult;
/**
* Applies a set operation to slots
* Works with both single slots and arrays of slots
*/
export declare function applySetOperation(operation: 'union' | 'intersection' | 'difference' | 'symmetric_difference', a: SlotInput, b: SlotInput, options: SlotOperationOptions): SlotOperationResult;
export {};