1 | import type { MaybePromise } from './types';
|
2 | export interface Prioritizeable<T> {
|
3 | readonly priority: number;
|
4 | readonly value: T;
|
5 | }
|
6 | export declare namespace Prioritizeable {
|
7 | type GetPriority<T> = (value: T) => MaybePromise<number>;
|
8 | type GetPrioritySync<T> = (value: T) => number;
|
9 | function toPrioritizeable<T>(rawValue: MaybePromise<T>, getPriority: GetPriority<T>): Promise<Prioritizeable<T>>;
|
10 | function toPrioritizeable<T>(rawValue: MaybePromise<T>[], getPriority: GetPriority<T>): Promise<Prioritizeable<T>[]>;
|
11 | function toPrioritizeableSync<T>(rawValue: T[], getPriority: GetPrioritySync<T>): Prioritizeable<T>[];
|
12 | function prioritizeAllSync<T>(values: T[], getPriority: GetPrioritySync<T>): Prioritizeable<T>[];
|
13 | function prioritizeAll<T>(values: MaybePromise<T>[], getPriority: GetPriority<T>): Promise<Prioritizeable<T>[]>;
|
14 | function isValid<T>(p: Prioritizeable<T>): boolean;
|
15 | function compare<T>(p: Prioritizeable<T>, p2: Prioritizeable<T>): number;
|
16 | }
|
17 |
|
\ | No newline at end of file |