import { Priority } from './Priority' ; export class Item { /** original business logic */ fn : Function = ( ) => { } ; label : string | undefined ; priority : number = Priority . MEDIUM ; /** wrapped `reject` of `fn` */ reject : Function = ( ) => { } ; /** wrapped `resolve` of `fn` */ resolve : Function = ( ) => { } ; /** number of remaining retries for rejecting Promises */ retry : number = Infinity ; /** time when the item has been added to the queue */ timestamp : number = 0 ; public toString ( ) { return `
    label=${ this . label },
    priority=${ this . priority },
    timestamp=${ this . timestamp },
    retry=${ this . retry },
    fn=${ this . fn . toString ( ) . replace ( /(\r\n|\n|\r|\s+)/gm , ' ' ) },` ; } }