Skip to content

Commit

Permalink
fix: add missing props of Data to typescript declarations (#655)
Browse files Browse the repository at this point in the history
* Add Data.arrowStyles
* Add Data.attributes
  • Loading branch information
inomdzhon authored and FezVrasta committed Aug 28, 2018
1 parent 2c1c1a7 commit 14d515b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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);
console.log('x-placement', data.attributes['x-placement']);
data.styles.alignContent = 'flex-start';
}
};
Expand Down

0 comments on commit 14d515b

Please sign in to comment.