@teselagen/range-utils 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/adjustRangeToDeletionOfAnotherRange.d.ts +1 -0
  2. package/adjustRangeToInsert.d.ts +1 -0
  3. package/adjustRangeToRotation.d.ts +1 -0
  4. package/checkIfNonCircularRangesOverlap.d.ts +1 -0
  5. package/checkIfPotentiallyCircularRangesOverlap.d.ts +1 -0
  6. package/collapseOverlapsGeneratedFromRangeComparisonIfPossible.d.ts +1 -0
  7. package/convertRangeIndices.d.ts +1 -0
  8. package/convertRangeTo0Based.d.ts +1 -0
  9. package/convertRangeTo1Based.d.ts +1 -0
  10. package/doesRangeSpanEntireSequence.d.ts +1 -0
  11. package/doesRangeSpanOrigin.d.ts +1 -0
  12. package/expandOrContractCircularRangeToPosition.d.ts +4 -0
  13. package/expandOrContractNonCircularRangeToPosition.d.ts +4 -0
  14. package/expandOrContractRangeByLength.d.ts +1 -0
  15. package/expandOrContractRangeToPosition.d.ts +4 -0
  16. package/flipContainedRange.d.ts +1 -0
  17. package/generateRandomRange.d.ts +4 -0
  18. package/getAnnotationRangeType.d.ts +1 -0
  19. package/getEachPositionInRangeAsArray.d.ts +1 -0
  20. package/getLengthOfOverlappingRegionsBetweenTwoRanges.d.ts +1 -0
  21. package/getMiddleOfRange.d.ts +1 -0
  22. package/getOverlapOfNonCircularRanges.d.ts +4 -0
  23. package/getOverlapsOfPotentiallyCircularRanges.d.ts +1 -0
  24. package/getPositionFromAngle.d.ts +1 -0
  25. package/getRangeAngles.d.ts +7 -0
  26. package/getRangeLength.d.ts +2 -0
  27. package/getRangesBetweenTwoRanges.d.ts +1 -0
  28. package/getSequenceWithinRange.d.ts +1 -0
  29. package/getShortestDistanceBetweenTwoPositions.d.ts +1 -0
  30. package/getYOffsetForPotentiallyCircularRange.d.ts +1 -0
  31. package/getYOffsetsForPotentiallyCircularRanges.d.ts +4 -0
  32. package/getZeroedRangeOverlaps.d.ts +1 -0
  33. package/index.d.ts +51 -0
  34. package/index.js +27 -0
  35. package/index.mjs +4211 -0
  36. package/invertRange.d.ts +2 -0
  37. package/isPositionCloserToRangeStartThanRangeEnd.d.ts +1 -0
  38. package/isPositionWithinRange.d.ts +9 -0
  39. package/isRangeOrPositionWithinRange.d.ts +1 -0
  40. package/isRangeWithinRange.d.ts +1 -0
  41. package/loopEachPositionInRange.d.ts +1 -0
  42. package/modulatePositionByRange.d.ts +1 -0
  43. package/modulateRangeBySequenceLength.d.ts +2 -0
  44. package/normalizePositionByRangeLength.d.ts +1 -0
  45. package/normalizePositionByRangeLength1Based.d.ts +1 -0
  46. package/normalizeRange.d.ts +1 -0
  47. package/package.json +8 -0
  48. package/provideInclusiveOptions.d.ts +1 -0
  49. package/reversePositionInRange.d.ts +1 -0
  50. package/splitRangeIntoTwoPartsIfItIsCircular.d.ts +5 -0
  51. package/translateRange.d.ts +1 -0
  52. package/trimNonCicularRangeByAnotherNonCircularRange.d.ts +4 -0
  53. package/trimNumberToFitWithin0ToAnotherNumber.d.ts +1 -0
  54. package/trimRangeByAnotherRange.d.ts +15 -0
  55. package/zeroSubrangeByContainerRange.d.ts +15 -0
@@ -0,0 +1,2 @@
1
+ declare const _default: (...args: any[]) => any;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default function isPositionCloserToRangeStartThanRangeEnd(position: any, range: any, maxLength: any): boolean;
@@ -0,0 +1,9 @@
1
+ export default isPositionWithinRange;
2
+ /**
3
+ *
4
+ * @param {*} position //assumed to be a 0 based "caretPosition"
5
+ * @param {*} range //0 based inclusive range
6
+ * @param {*} sequenceLength
7
+ * @param {*} includeEdges - (default false) whether or not to say
8
+ */
9
+ declare function isPositionWithinRange(position: any, range: any, sequenceLength: any, includeStartEdge: any, includeEndEdge: any): boolean;
@@ -0,0 +1 @@
1
+ export default function isRangeOrPositionWithinRange(rangeOrPositionToCheck: any, containingRange: any, maxLength: any, includeStartEdge: any, includeEndEdge: any): boolean;
@@ -0,0 +1 @@
1
+ export default function isRangeWithinRange(rangeToCheck: any, containingRange: any, maxLength: any): boolean;
@@ -0,0 +1 @@
1
+ export default function loopEachPositionInRange(range: any, rangeMax: any, func: any): void;
@@ -0,0 +1 @@
1
+ export default function modulatePositionByRange(position: any, range: any): any;
@@ -0,0 +1,2 @@
1
+ declare const _default: (...args: any[]) => any;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default function normalizePositionByRangeLength(pPosition: any, sequenceLength: any, isInBetweenPositions: any): any;
@@ -0,0 +1 @@
1
+ export default function normalizePositionByRangeLength1Based(position: any, sequenceLength: any): any;
@@ -0,0 +1 @@
1
+ export default function normalizeRange(range: any, sequenceLength: any): any;
package/package.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@teselagen/range-utils",
3
+ "version": "0.0.2",
4
+ "type": "commonjs",
5
+ "dependencies": {
6
+ "lodash": "^4.17.21"
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export default function provideInclusiveOptions(funToWrap: any): (...args: any[]) => any;
@@ -0,0 +1 @@
1
+ export default function reversePositionInRange(position: any, rangeLength: any, isInBetweenPositions: any): number;
@@ -0,0 +1,5 @@
1
+ export default function splitRangeIntoTwoPartsIfItIsCircular(range: any, sequenceLength: any): {
2
+ start: any;
3
+ end: any;
4
+ type: string;
5
+ }[];
@@ -0,0 +1 @@
1
+ export default function translateRange(rangeToBeAdjusted: any, translateBy: any, rangeLength: any): any;
@@ -0,0 +1,4 @@
1
+ export default function trimNonCicularRangeByAnotherNonCircularRange(rangeToBeTrimmed: any, trimmingRange: any): {
2
+ start: any;
3
+ end: any;
4
+ } | undefined;
@@ -0,0 +1 @@
1
+ export default function trimNumberToFitWithin0ToAnotherNumber(numberToBeTrimmed: any, max: any): any;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * trims range, but does *not* adjust it
3
+ * returns a new range if there is one, or null, if it is trimmed completely
4
+ * @param {object} subRange {start:
5
+ * end:
6
+ * }
7
+ * @param {object} containerRange {start:
8
+ * end:
9
+ * }
10
+ * @param {int} sequenceLength
11
+ * @return {object} || null {start:
12
+ * end:
13
+ * }
14
+ */
15
+ export default function trimRangeByAnotherRange(rangeToBeTrimmed: any, trimmingRange: any, sequenceLength: int): object;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * "zeroes" a subrange of a container range by
3
+ * adjusting subRange start and end such that it is as if the container range start = 0.
4
+ * @param {object} subRange {start:
5
+ * end:
6
+ * }
7
+ * @param {object} containerRange {start:
8
+ * end:
9
+ * }
10
+ * @param {int} sequenceLength
11
+ * @return {object} {start:
12
+ * end:
13
+ * }
14
+ */
15
+ export default function zeroSubrangeByContainerRange(subRange: object, containerRange: object, sequenceLength: int): object;