Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing props of Data to typescript declarations #655

Merged
merged 2 commits into from Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/popper/index.d.ts
Expand Up @@ -35,6 +35,11 @@ declare namespace Popper {

export type ModifierFn = (data: Data, options: Object) => Data;

export interface Attributes {
'x-out-of-boundaries': '' | false;
'x-placement': Placement;
}

export interface BaseModifier {
order?: number;
enabled?: boolean;
Expand Down Expand Up @@ -92,6 +97,7 @@ declare namespace Popper {
arrowElement: Element;
styles: CSSStyleDeclaration;
arrowStyles: CSSStyleDeclaration;
attributes: Attributes;
boundaries: Object;
offsets: {
popper: Offset,
Expand Down
2 changes: 2 additions & 0 deletions packages/popper/tests/types/type-tests.ts
Expand Up @@ -50,6 +50,8 @@ const options: Popper.PopperOptions = {
console.log(data);
},
onUpdate(data) {
console.log('x-out-of-boundaries', data.attributes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used to test the type?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap

console.log('x-placement', data.attributes['x-placement']);
data.styles.alignContent = 'flex-start';
}
};
Expand Down