@nativescript-community/ui-persistent-bottomsheet
Version:
NativeScript plugin that allows you to easily add a persistent bottomsheet to your projects.
94 lines (93 loc) • 3.5 kB
TypeScript
import { PanGestureHandlerOptions } from '@nativescript-community/gesturehandler';
import { AbsoluteLayout, AnimationDefinition, Color, EventData, Property, ScrollView, View } from '@nativescript/core';
import { VelocityTracker } from './VelocityTracker';
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 stepIndexProperty: Property<PersistentBottomSheet, number>;
export declare const backdropColorProperty: Property<PersistentBottomSheet, Color>;
export declare const translationFunctionProperty: Property<PersistentBottomSheet, Function>;
export declare class PersistentBottomSheet extends AbsoluteLayout {
[gestureEnabledProperty.setNative]: (value: boolean) => void;
[stepIndexProperty.setNative]: (value: number) => void;
[backdropColorProperty.setNative]: (value: Color) => void;
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 lastTouchY;
private touchStartY;
private wasDraggingPanel;
private gestureModeDecided;
private _translationY;
gestureEnabled: boolean;
private _scrollView;
private _isScrollEnabled;
private animation;
private _allowBottomSheetAdd;
dragToss: number;
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;
addChild(child: any): void;
_onBottomSheetChanged(oldValue: View, newValue: View): void;
computeTranslationData(): {
bottomSheet?: AnimationDefinition;
backDrop?: AnimationDefinition;
} | {
bottomSheet: {
translateY: number;
};
backDrop: {
opacity: number;
};
};
private alignToStepPosition;
private onLayoutChanged;
private get scrollViewVerticalOffset();
get isScrollEnabled(): boolean;
set isScrollEnabled(value: boolean);
scrollViewTouched: boolean;
private onBottomSheetTouch;
private onScrollViewTouch;
vt: VelocityTracker | null;
private onTouch;
private onGestureState;
canAnimateToStep(step: number): boolean;
private computeAndAnimateEndGestureAnimation;
animateStepIndex(stepIndex: any, duration?: number, curve?: any): void;
private onGestureTouch;
private applyTrData;
private constrainY;
animating: boolean;
private animateToPosition;
}
export declare function install(): void;