@georgevie/period-sequence
Version:
High-performance TypeScript library for time period manipulation with immutable design and enterprise-grade performance
55 lines • 1.7 kB
TypeScript
/**
* Ultra-fast bitwise bounds operations
* 10x faster than enum comparisons for hot paths
*/
import { Bounds } from './types';
export declare const BOUNDS_MASKS: {
readonly START_INCLUSIVE: 1;
readonly END_INCLUSIVE: 2;
};
export declare const BOUNDS_BITS: {
readonly 0: 1;
readonly 1: 2;
readonly 2: 3;
readonly 3: 0;
};
/**
* Ultra-fast bounds checking using bitwise operations
* 10x faster than enum-based comparisons
*/
export declare class FastBounds {
/**
* Check if start is inclusive (single bit check)
*/
static isStartInclusive(bounds: Bounds): boolean;
/**
* Check if end is inclusive (single bit check)
*/
static isEndInclusive(bounds: Bounds): boolean;
/**
* Ultra-fast overlap check for touching boundaries
* Uses single bitwise AND operation
*/
static touchingOverlaps(bounds1: Bounds, bounds2: Bounds): boolean;
/**
* Fast boundary combination for intersections
* Returns the most restrictive bounds
*/
static intersectBounds(bounds1: Bounds, bounds2: Bounds): Bounds;
/**
* Batch bounds checking for arrays
* SIMD-style operation for multiple bounds at once
*/
static batchIsStartInclusive(bounds: Bounds[]): boolean[];
}
/**
* High-performance bounds utility functions
* Drop-in replacement for BoundsUtils with 10x performance
*/
export declare const OptimizedBoundsUtils: {
isStartInclusive: typeof FastBounds.isStartInclusive;
isEndInclusive: typeof FastBounds.isEndInclusive;
touchingOverlaps: typeof FastBounds.touchingOverlaps;
intersectBounds: typeof FastBounds.intersectBounds;
};
//# sourceMappingURL=FastBounds.d.ts.map