<commit_before>import { EventData, PropertyChangeData } from 'data/observable';
import { Page } from 'ui/page';
import { HelloWorldModel } from './main-view-model';
import { Pager } from "nativescript-pager";
import { Button } from "ui/button";
import { Image } from "ui/image";
import * as app from "application";
let page: Page;
// Event handler for Page "navigatingTo" event attached in main-page.xml
export function navigatingTo(args: EventData) {
  // Get the event sender
  page = <Page>args.object;
  page.bindingContext = new HelloWorldModel();
}
export function pageLoaded() {
}

export function prevPage() {
  const pager: Pager = <Pager>page.getViewById("pager");
  pager.selectedIndex = Math.max(0, pager.selectedIndex - 1);
}

export function nextPage() {
  const pager: Pager = <Pager>page.getViewById("pager");
  pager.selectedIndex = Math.min(pager.items.length -1, pager.selectedIndex + 1);
}

export function firstPage() {
  const pager: Pager = <Pager>page.getViewById("pager");
  pager.selectedIndex = 0;
}

export function lastPage() {
  const pager: Pager = <Pager>page.getViewById("pager");
  pager.selectedIndex = pager.items.length -1;
}

export function loadedImage($event: any) {
  const image: Image = $event.object;
  console.log(`onLoaded: ${image}, size: ${JSON.stringify(image.getActualSize())}}`);
}<commit_msg>chore: update demo to test selectedIndex value coercion<commit_after>import { EventData, PropertyChangeData } from 'data/observable';
import { Page } from 'ui/page';
import { HelloWorldModel } from './main-view-model';
import { Pager } from "nativescript-pager";
import { Button } from "ui/button";
import { Image } from "ui/image";
import * as app from "application";
let page: Page;
// Event handler for Page "navigatingTo" event attached in main-page.xml
export function navigatingTo(args: EventData) {
  // Get the event sender
  page = <Page>args.object;
  page.bindingContext = new HelloWorldModel();
}
export function pageLoaded() {
}

export function prevPage() {
  const pager: Pager = <Pager>page.getViewById("pager");
  --pager.selectedIndex;
}

export function nextPage() {
  const pager: Pager = <Pager>page.getViewById("pager");
  ++pager.selectedIndex;
}

export function firstPage() {
  const pager: Pager = <Pager>page.getViewById("pager");
  pager.selectedIndex = 0;
}

export function lastPage() {
  const pager: Pager = <Pager>page.getViewById("pager");
  pager.selectedIndex = pager.items.length -1;
}

export function loadedImage($event: any) {
  const image: Image = $event.object;
  console.log(`onLoaded: ${image}, size: ${JSON.stringify(image.getActualSize())}}`);
}
{'fraction_non_alphanumeric': 0.1433990895295903, 'fraction_numerical': 0.0030349013657056147, 'mean_word_length': 5.006833712984054, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3585555', 'n_tokens_mistral': 848, 'n_tokens_neox': 838, 'n_words': 224}