Skip to content

Commit 121e3cc

Browse files
fix(@clayui/shared): fix error export type from root in package distribution
As we have the explicit return from the `domAlign` method it will also return `IConfig` which is a private type in the package dos types generation. We need to find a way to test this to avoid problems in the future.
1 parent 986bb1a commit 121e3cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/clay-shared/src/doAlign.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55

66
import domAlign from 'dom-align';
77

8-
type AlignProps<T, K> = {
8+
type AlignBase = {
99
offset?: readonly [number, number];
1010
overflow?: {adjustX: boolean; adjustY: boolean};
1111
points?: readonly [string, string];
12+
targetOffset?: readonly [string, string];
13+
};
14+
15+
type AlignProps<T, K> = AlignBase & {
1216
sourceElement: K;
1317
targetElement: T;
14-
targetOffset?: readonly [string, string];
1518
};
1619

1720
function isRtl<T extends HTMLElement>(element: T) {
@@ -22,7 +25,7 @@ export function doAlign<T extends HTMLElement, K extends HTMLElement>({
2225
sourceElement,
2326
targetElement,
2427
...config
25-
}: AlignProps<T, K>) {
28+
}: AlignProps<T, K>): Required<AlignBase> {
2629
return domAlign(sourceElement, targetElement, {
2730
...config,
2831
useCssRight: isRtl(sourceElement),

0 commit comments

Comments
 (0)