source: trip-planner-front/node_modules/schema-utils/declarations/util/Range.d.ts@ 84d0fbb

Last change on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.3 KB
Line 
1export = Range;
2/**
3 * @typedef {[number, boolean]} RangeValue
4 */
5/**
6 * @callback RangeValueCallback
7 * @param {RangeValue} rangeValue
8 * @returns {boolean}
9 */
10declare class Range {
11 /**
12 * @param {"left" | "right"} side
13 * @param {boolean} exclusive
14 * @returns {">" | ">=" | "<" | "<="}
15 */
16 static getOperator(
17 side: 'left' | 'right',
18 exclusive: boolean
19 ): '>' | '>=' | '<' | '<=';
20 /**
21 * @param {number} value
22 * @param {boolean} logic is not logic applied
23 * @param {boolean} exclusive is range exclusive
24 * @returns {string}
25 */
26 static formatRight(value: number, logic: boolean, exclusive: boolean): string;
27 /**
28 * @param {number} value
29 * @param {boolean} logic is not logic applied
30 * @param {boolean} exclusive is range exclusive
31 * @returns {string}
32 */
33 static formatLeft(value: number, logic: boolean, exclusive: boolean): string;
34 /**
35 * @param {number} start left side value
36 * @param {number} end right side value
37 * @param {boolean} startExclusive is range exclusive from left side
38 * @param {boolean} endExclusive is range exclusive from right side
39 * @param {boolean} logic is not logic applied
40 * @returns {string}
41 */
42 static formatRange(
43 start: number,
44 end: number,
45 startExclusive: boolean,
46 endExclusive: boolean,
47 logic: boolean
48 ): string;
49 /**
50 * @param {Array<RangeValue>} values
51 * @param {boolean} logic is not logic applied
52 * @return {RangeValue} computed value and it's exclusive flag
53 */
54 static getRangeValue(
55 values: Array<[number, boolean]>,
56 logic: boolean
57 ): [number, boolean];
58 /** @type {Array<RangeValue>} */
59 _left: Array<[number, boolean]>;
60 /** @type {Array<RangeValue>} */
61 _right: Array<[number, boolean]>;
62 /**
63 * @param {number} value
64 * @param {boolean=} exclusive
65 */
66 left(value: number, exclusive?: boolean | undefined): void;
67 /**
68 * @param {number} value
69 * @param {boolean=} exclusive
70 */
71 right(value: number, exclusive?: boolean | undefined): void;
72 /**
73 * @param {boolean} logic is not logic applied
74 * @return {string} "smart" range string representation
75 */
76 format(logic?: boolean): string;
77}
78declare namespace Range {
79 export { RangeValue, RangeValueCallback };
80}
81type RangeValue = [number, boolean];
82type RangeValueCallback = (rangeValue: [number, boolean]) => boolean;
Note: See TracBrowser for help on using the repository browser.