Skip to content

Commit

Permalink
feat: export types
Browse files Browse the repository at this point in the history
  • Loading branch information
revelt committed Aug 12, 2022
1 parent 39e4fcd commit 531a928
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/ranges-sort/src/main.ts
@@ -1,10 +1,10 @@
import { version as v } from "../package.json";

type Range =
export type Range =
| [from: number, to: number]
| [from: number, to: number, whatToInsert: string | null | undefined];

type Ranges = Range[] | null;
export type Ranges = Range[] | null;

const version: string = v;

Expand All @@ -20,9 +20,9 @@ const version: string = v;
// does this: [ [2, 5], [1, 6] ] => [ [1, 6], [2, 5] ]
// sorts first by first element, then by second. Retains possible third element.

type ProgressFn = (percentageDone: number) => void;
export type ProgressFn = (percentageDone: number) => void;

interface Opts {
export interface Opts {
strictlyTwoElementsInRangeArrays: boolean;
progressFn: undefined | null | ProgressFn;
}
Expand Down Expand Up @@ -117,4 +117,4 @@ function rSort(arrOfRanges: Ranges, originalOptions?: Partial<Opts>): Ranges {
});
}

export { rSort, defaults, version, Range, Ranges };
export { rSort, defaults, version };
2 changes: 1 addition & 1 deletion packages/ranges-sort/types/index.d.ts
Expand Up @@ -14,4 +14,4 @@ declare function rSort(
originalOptions?: Partial<Opts>
): Ranges;

export { Range, Ranges, defaults, rSort, version };
export { Opts, ProgressFn, Range, Ranges, defaults, rSort, version };

0 comments on commit 531a928

Please sign in to comment.