Skip to content

Commit 4065eb8

Browse files
boazblakeebsi-bblakerigor789
authored
types: fix $navigateBack types (#663)
* fix: adding backstackentry to navigateback type * fix: adding backstackentry to navigateback type * fix: adding backstackentry to navigateback type * fix: argument order Co-authored-by: bblake <bblake@goempyrean.com> Co-authored-by: Igor Randjelovic <rigor789@gmail.com>
1 parent f694e34 commit 4065eb8

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

index.d.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { Page, NavigationEntry } from 'tns-core-modules/ui/frame/frame'
1+
import {
2+
Page,
3+
NavigationEntry,
4+
BackstackEntry,
5+
} from 'tns-core-modules/ui/frame/frame'
26
import { ItemEventData } from 'tns-core-modules/ui/list-view'
37
import { View } from 'tns-core-modules/ui/core/view'
48
import { ShowModalOptions } from 'tns-core-modules/ui/core/view-base'
@@ -17,7 +21,12 @@ export type navigateTo = (
1721
component: VueConstructor,
1822
options?: NavigationEntryVue,
1923
cb?: () => Page,
20-
) => Promise<Page>;
24+
) => Promise<Page>
25+
26+
export type navigateBack = (
27+
options?: NavigationEntryVue,
28+
backstackEntry?: BackstackEntry,
29+
) => void
2130

2231
export interface ModalOptions extends Partial<ShowModalOptions> {
2332
target?: any; // optional Vue target to open the modal from
@@ -29,7 +38,7 @@ export interface NativeScriptVue<V = View> extends Vue {
2938
nativeView: V
3039

3140
$navigateTo: navigateTo
32-
$navigateBack: () => void
41+
$navigateBack: navigateBack
3342

3443
$modal?: { close: (data?: any) => Promise<typeof data> };
3544

@@ -47,9 +56,10 @@ export interface NativeScriptVue<V = View> extends Vue {
4756
$start: () => void
4857
}
4958

50-
export interface NativeScriptVueConstructor extends VueConstructor<NativeScriptVue> {
59+
export interface NativeScriptVueConstructor extends VueConstructor<NativeScriptVue>
60+
{
5161
navigateTo: navigateTo
52-
navigateBack: () => void
62+
navigateBack: navigateBack
5363
/**
5464
* Registers NativeScript Plugin.
5565
* @param elementName Name of the element to use in your template

0 commit comments

Comments
 (0)