Skip to content

Commit

Permalink
eliminate imports to runtime files in index.d.ts, per feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
planttheidea committed Feb 19, 2023
1 parent 9c3f0d5 commit 9f4878f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,31 @@ import type {
CreateCustomComparatorConfig,
CreateState,
EqualityComparator,
InternalEqualityComparator,
} from './src/internalTypes';
import { createInternalComparator, sameValueZeroEqual } from './src/utils';
export { sameValueZeroEqual };

interface DefaultEqualCreatorOptions<Meta> {
comparator?: EqualityComparator<Meta>;
circular?: boolean;
strict?: boolean;
}

interface CustomEqualCreatorOptions<Meta>
extends DefaultEqualCreatorOptions<Meta> {
createCustomConfig?: CreateCustomComparatorConfig<Meta>;
createInternalComparator?: typeof createInternalComparator;
createInternalComparator?: <Meta>(
compare: EqualityComparator<Meta>,
) => InternalEqualityComparator<Meta>;
createState?: CreateState<Meta>;
}

export * from './src/internalTypes';

/**
* Whether the values passed are strictly equal or both NaN.
*/
export declare const sameValueZeroEqual: <A, B>(a: A, b: B) => boolean;

/**
* Whether the items passed are deeply-equal in value.
*/
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
} from './utils';

export { sameValueZeroEqual };
export * from './internalTypes';

interface DefaultEqualCreatorOptions<Meta> {
comparator?: EqualityComparator<Meta>;
Expand Down

0 comments on commit 9f4878f

Please sign in to comment.