UNPKG

apply-hooks

Version:

A high-quality & reliable JavaScript Hooks library.

29 lines (28 loc) 725 B
/** * enqueue 队尾添加一个值 * dequeue 移除队首的第一个值 并返回该值 * front 返回队列中第一个元素 队列的结构不做任何修改 * isEmpty 判断队列是否为空 * size 表示队列中个数多少 * toString 表示队列中的内容以字符串形式返回 */ interface IEnqueue<T> { (value: T): boolean; } interface IDequeue<T> { (): boolean | T; } interface IFront<T> { (): boolean | T; } interface IIsEmpty { (): boolean; } interface IGetSize { (): number; } interface IToString { (splitSign?: string): string; } declare const useQueue: <T>(type?: number) => [IEnqueue<T>, IDequeue<T>, IFront<T>, IIsEmpty, IGetSize, IToString]; export default useQueue;