Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { Page, NavigationEntry } from 'tns-core-modules/ui/frame/frame'
import {
Page,
NavigationEntry,
BackstackEntry,
} from 'tns-core-modules/ui/frame/frame'
import { ItemEventData } from 'tns-core-modules/ui/list-view'
import { View } from 'tns-core-modules/ui/core/view'
import { ShowModalOptions } from 'tns-core-modules/ui/core/view-base'
Expand All @@ -17,7 +21,12 @@ export type navigateTo = (
component: VueConstructor,
options?: NavigationEntryVue,
cb?: () => Page,
) => Promise<Page>;
) => Promise<Page>

export type navigateBack = (
options?: NavigationEntryVue,
backstackEntry?: BackstackEntry,
) => void

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

$navigateTo: navigateTo
$navigateBack: () => void
$navigateBack: navigateBack

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

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

export interface NativeScriptVueConstructor extends VueConstructor<NativeScriptVue> {
export interface NativeScriptVueConstructor extends VueConstructor<NativeScriptVue>
{
navigateTo: navigateTo
navigateBack: () => void
navigateBack: navigateBack
/**
* Registers NativeScript Plugin.
* @param elementName Name of the element to use in your template
Expand Down