| 44 | } |
| 45 | |
| 46 | interface WaypointProps { |
| 47 | /** |
| 48 | * Function called when waypoint enters viewport |
| 49 | * @param {CallbackArgs} args |
| 50 | */ |
| 51 | onEnter?: (args: CallbackArgs) => void; |
| 52 | |
| 53 | /** |
| 54 | * Function called when waypoint leaves viewport |
| 55 | * @param {CallbackArgs} args |
| 56 | */ |
| 57 | onLeave?: (args: CallbackArgs) => void; |
| 58 | |
| 59 | /** |
| 60 | * Function called when waypoint position changes |
| 61 | * @param {CallbackArgs} args |
| 62 | */ |
| 63 | onPositionChange?: (args: CallbackArgs) => void; |
| 64 | |
| 65 | /** |
| 66 | * Whether to activate on horizontal scrolling instead of vertical |
| 67 | */ |
| 68 | horizontal?: boolean; |
| 69 | |
| 70 | /** |
| 71 | * `topOffset` can either be a number, in which case its a distance from the |
| 72 | * top of the container in pixels, or a string value. Valid string values are |
| 73 | * of the form "20px", which is parsed as pixels, or "20%", which is parsed |
| 74 | * as a percentage of the height of the containing element. |
| 75 | * For instance, if you pass "-20%", and the containing element is 100px tall, |
| 76 | * then the waypoint will be triggered when it has been scrolled 20px beyond |
| 77 | * the top of the containing element. |
| 78 | */ |
| 79 | topOffset?: string|number; |
| 80 | |
| 81 | /** |
| 82 | * `bottomOffset` can either be a number, in which case its a distance from the |
| 83 | * bottom of the container in pixels, or a string value. Valid string values are |
| 84 | * of the form "20px", which is parsed as pixels, or "20%", which is parsed |
| 85 | * as a percentage of the height of the containing element. |
| 86 | * For instance, if you pass "20%", and the containing element is 100px tall, |
| 87 | * then the waypoint will be triggered when it has been scrolled 20px beyond |
| 88 | * the bottom of the containing element. |
| 89 | * |
| 90 | * Similar to `topOffset`, but for the bottom of the container. |
| 91 | */ |
| 92 | bottomOffset?: string|number; |
| 93 | |
| 94 | /** |
| 95 | * A custom ancestor to determine if the target is visible in it. |
| 96 | * This is useful in cases where you do not want the immediate scrollable |
| 97 | * ancestor to be the container. For example, when your target is in a div |
| 98 | * that has overflow auto but you are detecting onEnter based on the window. |
| 99 | */ |
| 100 | scrollableAncestor?: any; |
| 101 | |
| 102 | /** |
| 103 | * If the onEnter/onLeave events are to be fired on rapid scrolling. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…