ngx-slimscroll
Version:
***ngx-slimscroll*** is a customizable scrollbar directive for Angular2+.
66 lines (65 loc) • 2.59 kB
TypeScript
import { EventEmitter, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges, ViewContainerRef } from '@angular/core';
import { Subscription } from 'rxjs';
import { ISlimScrollEvent, SlimScrollEvent } from './slimscroll-event.class';
import { ISlimScrollOptions, SlimScrollOptions } from './slimscroll-options.class';
import { ISlimScrollState } from './slimscroll-state.class';
import * as i0 from "@angular/core";
export declare const easing: {
[key: string]: (t: number) => number;
};
export declare class SlimScrollDirective implements OnInit, OnChanges, OnDestroy {
private viewContainer;
private renderer;
private document;
private optionsDefaults;
enabled: boolean;
options: SlimScrollOptions;
scrollEvents: EventEmitter<ISlimScrollEvent>;
scrollChanged: EventEmitter<ISlimScrollState>;
barVisibilityChange: EventEmitter<boolean>;
el: HTMLElement;
wrapper: HTMLElement;
grid: HTMLElement;
bar: HTMLElement;
body: HTMLElement;
pageY: number;
top: number;
dragging: boolean;
mutationThrottleTimeout: number | any;
mutationObserver: MutationObserver;
lastTouchPositionY: number;
visibleTimeout: any;
interactionSubscriptions: Subscription;
current: {
max: number;
percent: number;
};
locked: boolean;
constructor(viewContainer: ViewContainerRef, renderer: Renderer2, document: Document, optionsDefaults: ISlimScrollOptions);
ngOnInit(): void;
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
setup(): void;
handleEvent(e: SlimScrollEvent): void;
setStyle(): void;
onMutation(): void;
wrapContainer(): void;
initGrid(): void;
initBar(): void;
getBarHeight(): void;
scrollTo(y: number, duration: number, easingFunc: string): void;
scrollContent(y: number, isWheel: boolean, isJump: boolean): null | number;
updateScrollState(): void;
initWheel(): void;
initDrag(): void;
setBarTop(): void;
saveCurrent(): void;
showBarAndGrid(): void;
hideBarAndGrid(): void;
preventDefaultEvent(e: MouseEvent): void;
destroy(): void;
unwrap(wrapper: HTMLElement): void;
onResize(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<SlimScrollDirective, [null, null, null, { optional: true; }]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<SlimScrollDirective, "[slimScroll]", ["slimScroll"], { "enabled": "enabled"; "options": "options"; "scrollEvents": "scrollEvents"; }, { "scrollChanged": "scrollChanged"; "barVisibilityChange": "barVisibilityChange"; }, never>;
}