UNPKG

@nativescript-community/ui-persistent-bottomsheet

Version:

NativeScript plugin that allows you to easily add a persistent bottomsheet to your projects.

83 lines (82 loc) 3.04 kB
import { PanGestureHandlerOptions } from '@nativescript-community/gesturehandler'; import { AbsoluteLayout, AnimationDefinition, Color, EventData, Property, ScrollView, View } from '@nativescript/core'; export declare let PAN_GESTURE_TAG: number; export interface BottomSheetEventData extends EventData { duration?: number; } export declare const scrollViewProperty: Property<PersistentBottomSheet, string>; export declare const bottomSheetProperty: Property<PersistentBottomSheet, View>; export declare const gestureEnabledProperty: Property<PersistentBottomSheet, boolean>; export declare const stepsProperty: Property<PersistentBottomSheet, number[]>; export declare const stepIndexProperty: Property<PersistentBottomSheet, number>; export declare const backdropColorProperty: Property<PersistentBottomSheet, Color>; export declare const translationFunctionProperty: Property<PersistentBottomSheet, Function>; export declare class PersistentBottomSheet extends AbsoluteLayout { bottomSheet: View; scrollViewId: string; backdropColor: any; stepIndex: number; panGestureOptions: PanGestureHandlerOptions & { gestureId?: number; }; private backDrop; private panGestureHandler; private _steps; private isAnimating; private prevDeltaY; private viewHeight; private lastScrollY; private lastTouchY; private scrollViewTouched; private _translationY; gestureEnabled: boolean; private _scrollView; private _isScrollEnabled; private scrollViewAtTop; private animation; constructor(); get steps(): number[]; set steps(value: number[]); translationFunction?: (delta: number, max: number, progress: number) => { bottomSheet?: AnimationDefinition; backDrop?: AnimationDefinition; }; protected initGestures(): void; protected shouldStartGesture(data: any): boolean; get translationY(): number; set translationY(value: number); get translationMaxOffset(): number; initNativeView(): void; disposeNativeView(): void; protected addBackdropView(index: number): void; get scrollView(): ScrollView; set scrollView(value: ScrollView); private _onScrollViewIdChanged; _onBottomSheetChanged(oldValue: View, newValue: View): void; computeTranslationData(): { bottomSheet?: AnimationDefinition; backDrop?: AnimationDefinition; } | { bottomSheet: { translateY: number; }; backDrop: { opacity: number; }; }; private onLayoutChange; private get scrollViewVerticalOffset(); private set scrollViewVerticalOffset(value); get isScrollEnabled(): boolean; set isScrollEnabled(value: boolean); private onTouch; private onScroll; private onGestureState; private computeAndAnimateEndGestureAnimation; private onGestureTouch; private applyTrData; private constrainY; animating: boolean; private animateToPosition; } export declare function install(): void;