react-navigation-shared-element
Version:
react-native-shared-element bindings for React Navigation
65 lines (64 loc) • 2.38 kB
TypeScript
/// <reference types="react" />
import { SharedElementNode, SharedElementAnimation, SharedElementResize, SharedElementAlign, SharedElementTransitionProps } from "react-native-shared-element";
export { SharedElementNode, SharedElementAnimation, SharedElementTransitionProps };
export declare type Route = {
key: string;
routeName: string;
};
export declare type NavigationEventName = "willFocus" | "didFocus" | "willBlur" | "didBlur";
export declare type NavigationState = {
key: string;
index: number;
routes: Route[];
routeName: string;
transitions: {
pushing: string[];
popping: string[];
};
params?: {
[key: string]: unknown;
};
};
export declare type NavigationProp<RouteName = string, Params = object> = {
navigate(routeName: RouteName): void;
goBack(): void;
goBack(key: string | null): void;
addListener: (event: NavigationEventName, callback: () => void) => {
remove: () => void;
};
isFocused(): boolean;
state: NavigationState;
setParams(params: Params): void;
getParam(): Params;
dispatch(action: {
type: string;
}): void;
isFirstRouteInParent(): boolean;
dangerouslyGetParent(): NavigationProp | undefined;
};
export declare type SharedElementEventSubscription = {
remove(): void;
};
export declare type SharedElementStrictConfig = {
readonly id: string;
readonly otherId: string;
readonly animation: SharedElementAnimation;
readonly resize?: SharedElementResize;
readonly align?: SharedElementAlign;
readonly debug?: boolean;
};
export declare type SharedElementsStrictConfig = SharedElementStrictConfig[];
export declare type SharedElementConfig = {
readonly id: string;
readonly otherId?: string;
readonly animation?: SharedElementAnimation;
readonly resize?: SharedElementResize;
readonly align?: SharedElementAlign;
readonly debug?: boolean;
} | string;
export declare type SharedElementsConfig = SharedElementConfig[];
export declare type SharedElementAnimatedValue = any;
export declare type SharedElementsComponentConfig = (navigation: NavigationProp, otherNavigation: NavigationProp, showing: boolean) => SharedElementsConfig | undefined;
export declare type SharedElementSceneComponent = React.ComponentType<any> & {
sharedElements: SharedElementsComponentConfig;
};