mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
22 lines
508 B
TypeScript
22 lines
508 B
TypeScript
// Tests for ViewabilityHelper API
|
|
|
|
import {ViewabilityHelper, Options} from 'viewability-helper';
|
|
|
|
let d: Element = document.createElement('DIV');
|
|
let vh: ViewabilityHelper = new ViewabilityHelper(d, () => {});
|
|
vh.observe();
|
|
|
|
// Test with options
|
|
|
|
let options: Options = {
|
|
callbackParams: [1, 'a', null],
|
|
rootMargin: '0px',
|
|
intersectionPercentage: 0,
|
|
scrollDimmer: 200,
|
|
unobserve: true,
|
|
threshold: [0]
|
|
};
|
|
|
|
let vh2: ViewabilityHelper = new ViewabilityHelper(d, () => {}, options);
|
|
vh2.observe();
|