Skip to content

Commit

Permalink
Fix type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
drzax committed May 6, 2021
1 parent 35a48f2 commit 5cfc1b0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Scrollyteller/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ type ProgressMeasurements = {
left: number;
right: number;
top: number;
overall: {
pctAboveFold: number;
pxAboveFold: number;
};
};

export interface OnProgressCallback {
Expand Down Expand Up @@ -151,7 +155,9 @@ const Scrollyteller = <T,>({
// Panel position in relation to fold
// This is done in two passes because the boundingClientRect is needed for all
// panels before the px/pct progress can be accurately measured.
const panelPositions = panelElementReferences.current
const panelPositions: (Reference<T> & {
measurements: ProgressMeasurements;
})[] = panelElementReferences.current
.map(({ data, element }) => {
const {
top,
Expand Down

0 comments on commit 5cfc1b0

Please sign in to comment.