3.0.3 • Published 6 months ago

@types/scrollbooster v3.0.3

Weekly downloads
218
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/scrollbooster

Summary

This package contains type definitions for scrollbooster (https://github.com/ilyashubin/scrollbooster).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/scrollbooster.

index.d.ts

// Type definitions for scrollbooster 2.2
// Project: https://github.com/ilyashubin/scrollbooster
// Definitions by: Chris <https://github.com/chrisneven>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export interface Position {
    x?: number | undefined;
    y?: number | undefined;
}

export interface ScrollingState {
    isMoving: boolean;
    isDragging: boolean;
    position: Required<Position>;
    dragOffset: number;
    borderCollision: {
        left: boolean;
        right: boolean;
        top: boolean;
        bottom: boolean;
    };
}

export interface ScrollBoosterOptions {
    content?: HTMLElement | null | undefined;
    viewport: HTMLElement | null;
    scrollMode?: 'transform' | 'native' | undefined;
    direction?: 'horizontal' | 'vertical' | 'all' | undefined;
    bounce?: boolean | undefined;
    textSelection?: boolean | undefined;
    inputsFocus?: boolean | undefined;
    pointerMode?: 'touch' | 'mouse' | 'all' | undefined;
    friction?: number | undefined;
    bounceForce?: number | undefined;
    emulateScroll?: boolean | undefined;
    onUpdate?: ((state: ScrollingState) => void) | undefined;
    onClick?: ((state: ScrollingState, event: Event) => void) | undefined;
    shouldScroll?: ((state: ScrollingState, event: Event) => boolean) | undefined;
}

export default class ScrollBooster {
    constructor(options: ScrollBoosterOptions);

    setPosition(position: Position): void;

    scrollTo(position: Position): void;

    updateMetrics(): void;

    updateOptions(options: Partial<ScrollBoosterOptions>): void;

    getState(): ScrollingState;

    destroy(): void;
}

Additional Details

  • Last updated: Tue, 06 Jul 2021 16:34:23 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Chris.

3.0.3

6 months ago

3.0.2

7 months ago

3.0.1

8 months ago

3.0.0

10 months ago

2.2.2

2 years ago

2.2.1

3 years ago

2.2.0

4 years ago