Skip to content

chore: dep updates #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ demo/platforms
node_modules
demo/hooks/
publish/package/
report/
report/
package-lock.json
3 changes: 2 additions & 1 deletion src/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
*.ts
!*.d.ts
tsconfig.json
references.d.ts
references.d.ts
*.tgz
7 changes: 3 additions & 4 deletions src/directions.android.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DirectionsApi, DirectionsCommon, NavigateToOptions } from "./directions.common";
import * as application from "tns-core-modules/application";
import * as utils from "tns-core-modules/utils/utils";
import { Application, Utils } from "@nativescript/core";

let com: any;

Expand Down Expand Up @@ -32,7 +31,7 @@ export class Directions extends DirectionsCommon implements DirectionsApi {

if (!this.isPackageInstalled()) {
// fall back to web
utils.openUrl("http://maps.google.com/maps" + fromToQs);
Utils.openUrl("http://maps.google.com/maps" + fromToQs);
} else {
const intent = new android.content.Intent(
android.content.Intent.ACTION_VIEW,
Expand All @@ -42,7 +41,7 @@ export class Directions extends DirectionsCommon implements DirectionsApi {
intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
}

(application.android.foregroundActivity || application.android.startActivity).startActivityForResult(intent, 0);
(Application.android.foregroundActivity || Application.android.startActivity).startActivityForResult(intent, 0);
}

resolve();
Expand Down
8 changes: 4 additions & 4 deletions src/directions.ios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { openUrl } from "tns-core-modules/utils/utils";
import { Utils } from "@nativescript/core";
import { DirectionsApi, DirectionsCommon, NavigateToOptions } from "./directions.common";

const isAppAvailable = require("nativescript-appavailability").availableSync;
Expand All @@ -17,11 +17,11 @@ export class Directions extends DirectionsCommon implements DirectionsApi {
if ((options.ios === undefined || options.ios.preferGoogleMaps !== false) && isAppAvailable("comgooglemaps://")) {
// if Google maps is installed, use that, otherwise use Apple maps (which doesn't support waypoints.. so nav to the first destination if that's used)
// url = `http://maps.google.com/maps?${fromToQs}+to:${encodeURIComponent("Weerdestein 144, Dordrecht, Netherlands")}`;
openUrl("comgooglemaps://" + fromToQs);
Utils.openUrl("comgooglemaps://" + fromToQs);
} else if (options.ios && options.ios.allowGoogleMapsWeb && options.to instanceof Array && options.to.length > 1) {
openUrl("http://maps.google.com/maps" + fromToQs);
Utils.openUrl("http://maps.google.com/maps" + fromToQs);
} else {
openUrl("http://maps.apple.com/maps" + fromToQs);
Utils.openUrl("http://maps.apple.com/maps" + fromToQs);
}
resolve();
} catch (e) {
Expand Down
12 changes: 6 additions & 6 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-directions",
"version": "1.4.0",
"name": "@nativescript/directions",
"version": "2.0.0",
"description": "Leverage the native Maps app to show directions from and to anywhere you like.",
"main": "directions",
"typings": "index.d.ts",
Expand Down Expand Up @@ -52,9 +52,9 @@
"nativescript-appavailability": "~1.3.1"
},
"devDependencies": {
"tns-core-modules": "~6.0.1",
"tns-platform-declarations": "~6.0.1",
"typescript": "~3.4.5",
"tslint": "~5.0.0"
"@nativescript/core": "rc",
"@nativescript/types": "rc",
"typescript": "~3.9.0",
"tslint": "~6.1.3"
}
}
4 changes: 2 additions & 2 deletions src/references.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
/// <reference path="./node_modules/@nativescript/types/ios.d.ts" />
/// <reference path="./node_modules/@nativescript/types/android.d.ts" />
13 changes: 4 additions & 9 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"target": "es2017",
"module": "esnext",
"moduleResolution": "node",
"declaration": true,
"removeComments": true,
"noLib": false,
Expand All @@ -16,13 +17,7 @@
"noImplicitAny": false,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"typeRoots": [
"./node_modules/@types",
"./node_modules"
],
"types": [
]
"noFallthroughCasesInSwitch": true
},
"exclude": [
"demo",
Expand Down