Skip to content

Commit

Permalink
refactor: 🏷️ add interface for getPhysicalFlexAxes return type
Browse files Browse the repository at this point in the history
  • Loading branch information
DerZade committed Apr 18, 2023
1 parent f2017c5 commit 665b136
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,20 @@ export function getPhysicalDirection(
}
}

/**
* An object containing the physical axes corresponding to the flex-axes of an element
*/
export interface FlexAxes {
main: PhysicalAxis;
cross: PhysicalAxis;
}

/**
* Get flexbox's main- and cross-axis as physical axes.
*
* @param el HTML Element
*/
export function getPhysicalFlexAxes(el: HTMLElement): {
main: PhysicalAxis;
cross: PhysicalAxis;
} {
export function getPhysicalFlexAxes(el: HTMLElement): FlexAxes {
const { inline, block } = getElementAxes(el);

const { flexDirection: flexDirectionStr, flexWrap: flexWrapStr } =
Expand Down

0 comments on commit 665b136

Please sign in to comment.