diff --git a/index.d.ts b/index.d.ts index 5830793..561d8ff 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,49 +1,33 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -declare namespace sortPackageJson { - interface SortPackageJsonFn { - /** - * Sort packageJson object. - * - * @param packageJson - A packageJson - * @param options - An options object - * @returns Sorted packageJson object - */ - >(packageJson: T, options?: Options): T +type ComparatorFunction = (left: string, right: string) => number - /** - * Sort packageJson string. - * - * @param packageJson - A packageJson string. - * @param options - An options object - * @returns Sorted packageJson string. - */ - (packageJson: string, options?: Options): string - } - - type ComparatorFunction = (left: string, right: string) => number - - function sortObjectBy>( - comparator?: string[], - deep?: boolean, - ): (x: T) => T - - interface Field { - readonly key: string - over?>(x: T): T - } - - interface Options { - readonly sortOrder?: readonly string[] | ComparatorFunction - } +interface Options { + readonly sortOrder?: readonly string[] | ComparatorFunction } -interface sortPackageJsonExports extends sortPackageJson.SortPackageJsonFn { - readonly default: sortPackageJson.SortPackageJsonFn - readonly sortPackageJson: sortPackageJson.SortPackageJsonFn - readonly sortOrder: string[] +interface SortPackageJson { + /** + * Sort packageJson object. + * + * @param packageJson - A packageJson + * @param options - An options object + * @returns Sorted packageJson object + */ + >(packageJson: T, options?: Options): T + + /** + * Sort packageJson string. + * + * @param packageJson - A packageJson string. + * @param options - An options object + * @returns Sorted packageJson string. + */ + (packageJson: string, options?: Options): string } -declare const sortPackageJsonExports: sortPackageJsonExports +declare const sortPackageJsonDefault: SortPackageJson +export default sortPackageJsonDefault -export = sortPackageJsonExports +export const sortPackageJson: SortPackageJson +export const sortOrder: string[]