Skip to content

Commit

Permalink
chore(nav): code cleanup (#24730)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb authored Feb 9, 2022
1 parent bae49ec commit c40ff12
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 151 deletions.
11 changes: 11 additions & 0 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,9 @@ export namespace Components {
* @param view The view to get.
*/
"getPrevious": (view?: ViewController | undefined) => Promise<ViewController | undefined>;
/**
* Called by <ion-router> to retrieve the current component.
*/
"getRouteId": () => Promise<RouteID | undefined>;
/**
* Inserts a component into the navigation stack at the specified index. This is useful to add a component at any point in the navigation stack.
Expand Down Expand Up @@ -1692,6 +1695,14 @@ export namespace Components {
* @param done The transition complete function.
*/
"setRoot": <T extends NavComponent>(component: T, componentProps?: ComponentProps<T> | null | undefined, opts?: NavOptions | null | undefined, done?: TransitionDoneFn | undefined) => Promise<boolean>;
/**
* Called by the router to update the view.
* @param id The component tag.
* @param params The component params.
* @param direction A direction hint.
* @param animation an AnimationBuilder.
* @return the status.
*/
"setRouteId": (id: string, params: ComponentProps | undefined, direction: RouterDirection, animation?: AnimationBuilder | undefined) => Promise<RouteWrite>;
/**
* If the nav component should allow for swipe-to-go-back.
Expand Down
3 changes: 3 additions & 0 deletions core/src/components/nav/nav-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ export type TransitionDoneFn = (hasCompleted: boolean, requiresTransition: boole

export interface TransitionInstruction {
opts: NavOptions | undefined | null;
/** The index where to insert views. A negative number means at the end */
insertStart?: number;
insertViews?: any[];
removeView?: ViewController;
/** The index of the first view to remove. A negative number means the last view */
removeStart?: number;
/** The number of view to remove. A negative number means all views from removeStart */
removeCount?: number;
resolve?: (hasCompleted: boolean) => void;
reject?: (rejectReason: string) => void;
Expand Down
Loading

0 comments on commit c40ff12

Please sign in to comment.