forked from keithamus/sort-package-json
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
26 lines (24 loc) · 915 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* eslint-disable @typescript-eslint/no-explicit-any */
/**
Sort packageJson.
@param packageJson - A packageJson object or string.
@param options
@returns Sorted packageJson object or string.
*/
declare function sortPackageJsonCore<T extends Record<any, any>>(packageJson: T, options?: sortPackageJsonCore.Options): T;
declare namespace sortPackageJsonCore {
var sortPackageJson: <T extends Record<any, any>>(packageJson: T, options?: sortPackageJsonCore.Options) => T;
// @ts-ignore
var default: <T extends Record<any, any>>(packageJson: T, options?: sortPackageJsonCore.Options) => T;
}
declare namespace sortPackageJsonCore {
type ComparatorFunction = (left: string, right: string) => number;
interface Options {
readonly sortOrder?: readonly string[] | ComparatorFunction;
}
/**
Default sort order.
*/
const sortOrder: readonly string[];
}
export = sortPackageJsonCore;