<commit_before>import {
    Page,
    NavigationEntry,
    BackstackEntry,
} from '@nativescript/core'
import { ItemEventData } from '@nativescript/core'
import { View } from '@nativescript/core'
import { ShowModalOptions } from '@nativescript/core'
import { Vue, VueConstructor } from 'vue/types/vue'

// ListView ItemEventData with the addition of the item property
export type NativeScriptVueItemEventData<T> = ItemEventData & { item: T }

// TODO: define fully.
type TargetFrame = any;

export interface NavigationEntryVue extends NavigationEntry {
    props?: Record<string, any>,
    frame?: TargetFrame,
    resolveOnEvent?: Page.navigatingToEvent | Page.navigatedToEvent
}

export type navigateTo = (
    component: VueConstructor,
    options?: NavigationEntryVue,
    cb?: () => Page,
) => Promise<Page>

export type navigateBack = (
    options?: {
        frame?: TargetFrame
    },
    backstackEntry?: BackstackEntry,
) => void

export interface ModalOptions extends Partial<ShowModalOptions> {
    target?: any; // optional Vue target to open the modal from
    props?: Record<string, any>;
}

// create a nativescript vue class that extends vue.js
export interface NativeScriptVue<V = View> extends Vue {
    nativeView: V

    $navigateTo: navigateTo
    $navigateBack: navigateBack

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

    /**
     * Open a modal using a component
     * @param {typeof Vue} component
     * @param {ModalOptions} options
     * @returns {any}
     */
    $showModal: (component: typeof Vue, options?: ModalOptions) => Promise<any>;

    /**
     * starts the nativescript application
     */
    $start: () => void
}

export interface NativeScriptVueConstructor extends VueConstructor<NativeScriptVue>
{
    navigateTo: navigateTo
    navigateBack: navigateBack
    /**
     * Registers NativeScript Plugin.
     * @param elementName Name of the element to use in your template
     * @param resolver  function to register the element
     * @param meta meta associated with the element
     */
    registerElement: (elementName: string, resolver: Function, meta?: any) => void
}

export const NativeScriptVue: NativeScriptVueConstructor

// export as namespace NativeScriptVue;
export default NativeScriptVue;
<commit_msg>fix(types): fix TS2702 can't use static class members<commit_after>import {
    Page,
    NavigationEntry,
    BackstackEntry,
} from '@nativescript/core'
import { ItemEventData } from '@nativescript/core'
import { View } from '@nativescript/core'
import { ShowModalOptions } from '@nativescript/core'
import { Vue, VueConstructor } from 'vue/types/vue'

// ListView ItemEventData with the addition of the item property
export type NativeScriptVueItemEventData<T> = ItemEventData & { item: T }

// TODO: define fully.
type TargetFrame = any;

export interface NavigationEntryVue extends NavigationEntry {
    props?: Record<string, any>,
    frame?: TargetFrame,
    resolveOnEvent?: "navigatingTo" | "navigatedTo" | string
    // Page.navigatingToEvent | Page.navigatedToEvent
}

export type navigateTo = (
    component: VueConstructor,
    options?: NavigationEntryVue,
    cb?: () => Page,
) => Promise<Page>

export type navigateBack = (
    options?: {
        frame?: TargetFrame
    },
    backstackEntry?: BackstackEntry,
) => void

export interface ModalOptions extends Partial<ShowModalOptions> {
    target?: any; // optional Vue target to open the modal from
    props?: Record<string, any>;
}

// create a nativescript vue class that extends vue.js
export interface NativeScriptVue<V = View> extends Vue {
    nativeView: V

    $navigateTo: navigateTo
    $navigateBack: navigateBack

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

    /**
     * Open a modal using a component
     * @param {typeof Vue} component
     * @param {ModalOptions} options
     * @returns {any}
     */
    $showModal: (component: typeof Vue, options?: ModalOptions) => Promise<any>;

    /**
     * starts the nativescript application
     */
    $start: () => void
}

export interface NativeScriptVueConstructor extends VueConstructor<NativeScriptVue>
{
    navigateTo: navigateTo
    navigateBack: navigateBack
    /**
     * Registers NativeScript Plugin.
     * @param elementName Name of the element to use in your template
     * @param resolver  function to register the element
     * @param meta meta associated with the element
     */
    registerElement: (elementName: string, resolver: Function, meta?: any) => void
}

export const NativeScriptVue: NativeScriptVueConstructor

// export as namespace NativeScriptVue;
export default NativeScriptVue;

{'fraction_non_alphanumeric': 0.09830435715818846, 'fraction_numerical': 0.0008585533376261, 'mean_word_length': 3.7357723577235773, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1908884', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1301, 'n_words': 418}