UNPKG

3.01 kBTypeScriptView Raw
1import type { View } from '../core/view';
2import type { BackstackEntry } from '../frame';
3export type SharedTransitionTagPropertiesToMatch = {
4 /**
5 * View related properties
6 */
7 view?: Array<string>;
8 /**
9 * For iOS, can be specific if CALayer related properties
10 */
11 layer?: Array<string>;
12};
13export type SharedElementSettings = { view: View; startFrame: any; endFrame?: any; startOpacity?: number; endOpacity?: number; scale?: { x?: number; y?: number }; zIndex?: number; startTransform?: any; snapshot?: any; propertiesToMatch?: SharedTransitionTagPropertiesToMatch };
14export type TransitionNavigationType = 'page' | 'modal';
15export interface TransitionInteractiveState {
16 started?: false;
17 added?: boolean;
18 transitionContext?: any;
19 propertyAnimator?: any;
20}
21
22export declare class Transition {
23 id: number;
24 /**
25 * (Optional) Provide a unique name to identify this transition
26 */
27 name?: string;
28 transitionController?: any;
29 interactiveController?: any;
30 presented?: any;
31 presenting?: any;
32 sharedElements?: {
33 presented?: Array<SharedElementSettings>;
34 presenting?: Array<SharedElementSettings>;
35 // independent sharedTransitionTags which are part of the shared transition but only on one page
36 independent?: Array<SharedElementSettings & { isPresented?: boolean }>;
37 };
38 static AndroidTransitionType?: { enter?: string; exit?: string; popEnter?: string; popExit?: string };
39 constructor(duration?: number, nativeCurve?: any /* UIViewAnimationCurve | string | CubicBezierAnimationCurve | android.view.animation.Interpolator | android.view.animation.LinearInterpolator */);
40 getDuration(): number;
41 setDuration(value: number): void;
42 getCurve(): any;
43 animateIOSTransition(transitionContext: any /*UIViewControllerContextTransitioning */, fromViewCtrl: any /* UIViewController */, toViewCtrl: any /* UIViewController */, operation: any /* UINavigationControllerOperation */): void;
44 createAndroidAnimator(transitionType: string): any;
45
46 setupInteractiveGesture?(startCallback: () => void, view: View): void;
47
48 iosDismissedController?(dismissed: any /* UIViewController */): any /* UIViewControllerAnimatedTransitioning */;
49
50 iosPresentedController?(presented: any /* UIViewController */, presenting: any /* UIViewController */, source: any /* UIViewController */): any /* UIViewControllerAnimatedTransitioning */;
51
52 iosInteractionDismiss?(animator: any /* UIViewControllerAnimatedTransitioning */): any /* UIViewControllerInteractiveTransitioning */;
53
54 iosInteractionPresented?(animator: any /* UIViewControllerAnimatedTransitioning */): any /* UIViewControllerInteractiveTransitioning */;
55
56 iosNavigatedController?(navigationController: any /* UINavigationController */, operation: number, fromVC: any /* UIViewController */, toVC: any /* UIViewController */): any /* UIViewControllerAnimatedTransitioning */;
57
58 androidFragmentTransactionCallback?(fragmentTransaction: any /* androidx.fragment.app.FragmentTransaction */, currentEntry: BackstackEntry, newEntry: BackstackEntry): void;
59}