UNPKG

apply-hooks

Version:

A high-quality & reliable JavaScript Hooks library.

24 lines (23 loc) 409 B
interface IPoll<T> { (): T | boolean; } interface IPeek<T> { (): T | boolean; } interface IOffer<T> { (value: T): boolean; } interface IIsEmpty { (): boolean; } interface ISize { (): number; } declare function useHeap<T>(data?: T[] | string, type?: string): { poll: IPoll<T>; offer: IOffer<T>; isEmpty: IIsEmpty; size: ISize; peek: IPeek<T>; }; export default useHeap;