motion-plus-vue
Version:
Motion Plus Vue
27 lines (26 loc) • 855 B
TypeScript
export interface ItemPosition {
start: number;
end: number;
}
export type ItemSize = 'auto' | 'fill' | 'manual';
export type Direction = 'ltr' | 'rtl';
export interface LayoutStrategy {
sign: 1 | -1;
direction: 'left' | 'top' | 'right' | 'bottom';
lengthProp: 'offsetWidth' | 'offsetHeight';
viewportLengthProp: 'innerWidth' | 'innerHeight';
paddingStartProp: 'paddingLeft' | 'paddingTop' | 'paddingRight';
measureItem: (item: HTMLElement, container: HTMLElement) => ItemPosition;
getCumulativeInset: (element: HTMLElement) => number;
}
export interface TickerState {
direction: Direction;
visibleLength: number;
inset: number;
totalItemLength: number;
containerLength: number;
itemPositions: ItemPosition[];
isMeasured: boolean;
maxInset: number | null;
}
export type Axis = 'x' | 'y';