@dalet-oss/lexorank
Version:
A reference implementation of a list ordering system like JIRA's Lexorank algorithm
54 lines (53 loc) • 1.99 kB
TypeScript
import { LexoDecimal } from './lexoDecimal';
import LexoRankBucket from './lexoRankBucket';
export declare class LexoRank {
static get NUMERAL_SYSTEM(): any;
private static get ZERO_DECIMAL();
private static get ONE_DECIMAL();
private static get EIGHT_DECIMAL();
private static get MIN_DECIMAL();
private static get MAX_DECIMAL();
private static get MID_DECIMAL();
private static get INITIAL_MIN_DECIMAL();
private static get INITIAL_MAX_DECIMAL();
static min(): LexoRank;
static middle(): LexoRank;
static max(bucket?: LexoRankBucket): LexoRank;
static initial(bucket: LexoRankBucket): LexoRank;
static between(oLeft: LexoDecimal, oRight: LexoDecimal): LexoDecimal;
static parse(str: string): LexoRank;
static from(bucket: LexoRankBucket, decimal: LexoDecimal): LexoRank;
private static _NUMERAL_SYSTEM;
private static _ZERO_DECIMAL;
private static _ONE_DECIMAL;
private static _EIGHT_DECIMAL;
private static _MIN_DECIMAL;
private static _MAX_DECIMAL;
private static _MID_DECIMAL;
private static _INITIAL_MIN_DECIMAL;
private static _INITIAL_MAX_DECIMAL;
private static middleInternal;
private static checkMid;
private static mid;
private static formatDecimal;
private readonly value;
private readonly bucket;
private readonly decimal;
constructor(bucket: LexoRankBucket, decimal: LexoDecimal);
genPrev(): LexoRank;
genNext(): LexoRank;
between(other: LexoRank): LexoRank;
multipleBetween(other: LexoRank, ranksToGenerate: number): LexoRank[];
private static prepareLexoRanks;
getBucket(): LexoRankBucket;
getDecimal(): LexoDecimal;
inNextBucket(): LexoRank;
inPrevBucket(): LexoRank;
isMin(): boolean;
isMax(): boolean;
format(): string;
equals(other: LexoRank): boolean;
toString(): string;
compareTo(other: LexoRank): number;
static binaryDepthToInsertRanks(noOfRanks: number): number;
}