reeller
Version:
Flexible, powerful and modern library for creating the running horizontal blocks effect, also known as ticker or the «marquee effect».
180 lines • 5.19 kB
TypeScript
export default class Filler extends Base {
/**
* @typedef {Object} FillerOptions
* @property {string|HTMLElement|null} container Container element or selector.
* @property {string|HTMLElement|null} wrapper Inner element or selector.
* @property {string|null} itemSelector Items CSS selector.
* @property {string} [cloneClassName] Class name of the new clones.
* @property {boolean} [autoUpdate] Use ResizeObserver to auto update clones number.
* @property {boolean} [clonesOverflow] Create artificial overflow with clones.
* @property {boolean} [clonesFinish] Bring the cycle of clones to an end.
* @property {boolean} [clonesMin] Minimum number of clones.
*/
/**
* Default options.
*
* @type {FillerOptions}
*/
static defaultOptions: {
/**
* Container element or selector.
*/
container: string | HTMLElement | null;
/**
* Inner element or selector.
*/
wrapper: string | HTMLElement | null;
/**
* Items CSS selector.
*/
itemSelector: string | null;
/**
* Class name of the new clones.
*/
cloneClassName?: string;
/**
* Use ResizeObserver to auto update clones number.
*/
autoUpdate?: boolean;
/**
* Create artificial overflow with clones.
*/
clonesOverflow?: boolean;
/**
* Bring the cycle of clones to an end.
*/
clonesFinish?: boolean;
/**
* Minimum number of clones.
*/
clonesMin?: boolean;
};
/**
* Create Filler instance.
*
* @param {FillerOptions} [options] Filler options.
*/
constructor(options?: {
/**
* Container element or selector.
*/
container: string | HTMLElement | null;
/**
* Inner element or selector.
*/
wrapper: string | HTMLElement | null;
/**
* Items CSS selector.
*/
itemSelector: string | null;
/**
* Class name of the new clones.
*/
cloneClassName?: string;
/**
* Use ResizeObserver to auto update clones number.
*/
autoUpdate?: boolean;
/**
* Create artificial overflow with clones.
*/
clonesOverflow?: boolean;
/**
* Bring the cycle of clones to an end.
*/
clonesFinish?: boolean;
/**
* Minimum number of clones.
*/
clonesMin?: boolean;
});
/** @type {FillerOptions} **/
options: {
/**
* Container element or selector.
*/
container: string | HTMLElement | null;
/**
* Inner element or selector.
*/
wrapper: string | HTMLElement | null;
/**
* Items CSS selector.
*/
itemSelector: string | null;
/**
* Class name of the new clones.
*/
cloneClassName?: string;
/**
* Use ResizeObserver to auto update clones number.
*/
autoUpdate?: boolean;
/**
* Create artificial overflow with clones.
*/
clonesOverflow?: boolean;
/**
* Bring the cycle of clones to an end.
*/
clonesFinish?: boolean;
/**
* Minimum number of clones.
*/
clonesMin?: boolean;
};
container: Element;
wrapper: string | Element;
/** @type Array.<HTMLElement> **/
item: Array<HTMLElement>;
/**
* Bind ResizeObserver to container for auto update.
*/
bindResizeObserver(): void;
resizeObserver: ResizeObserver;
/**
* Creates and adds clones to end in the desired number from given offset.
*
* @param {number} [count] Number of clones to add.
* @param {number} [offset] Offset from start.
*/
addClones(count?: number, offset?: number): void;
/**
* Removes the desired number of clones from the end.
*
* @param {number} [count] Number of clones to remove.
*/
removeClones(count?: number): void;
/**
* Sets the desired number of clones.
*
* @param {number} [count] Number of clones.
*/
setClonesCount(count?: number): void;
clonesCount: any;
/**
* Get calculated data object.
*
* @return {Object} Calculated data.
*/
getCalcData(): any;
/**
* Calculates and sets the number of clones.
*/
update(): void;
calcData: any;
/**
* Fully refresh and update all clones.
*
* @param {boolean} [update] Update after refresh.
*/
refresh(update?: boolean): void;
/**
* Destroy Reeller instance.
*
* @param {boolean} [removeClones] Remove clones from DOM.
*/
destroy(removeClones?: boolean): void;
}
import Base from "./Base";
//# sourceMappingURL=Filler.d.ts.map