Skip to content

Commit 93a4672

Browse files
Create the initial public api
1 parent 4e17b60 commit 93a4672

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

.npmignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ bin/nativescript
1818
bin/*.cmd
1919

2020
lib/**/*.ts
21+
!lib/**/*.d.ts
2122
lib/**/*.js.map
2223

2324
test/
@@ -27,4 +28,6 @@ scratch/
2728
*.suo
2829
.travis.yml
2930
docs/html/
30-
dev/
31+
dev/
32+
33+
tscommand*.tmp.txt

lib/index.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
// Entry point
1+
import * as Promise from "bluebird";
2+
import { ChildProcess } from "./wrappers/child-process";
3+
import { SysInfo } from "./sys-info";
24

5+
let childProcess = new ChildProcess();
6+
let sysInfo = new SysInfo(childProcess);
7+
8+
function getJavaVersion(): Promise<string> {
9+
return sysInfo.getJavaVersion();
10+
};
11+
12+
function getJavaCompilerVersion(): Promise<string> {
13+
return sysInfo.getJavaCompilerVersion();
14+
};
15+
16+
export {
17+
getJavaVersion,
18+
getJavaCompilerVersion
19+
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.1",
44
"description": "Library that helps identifying if the environment can be used for development of {N} apps.",
55
"main": "lib/index.js",
6+
"types": "./typings/nativescript-doctor.d.ts",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"
89
},

typings/nativescript-doctor.d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/// <reference path="../lib/definitions/bluebird.d.ts" />
2+
3+
import * as Promise from "bluebird";
4+
5+
declare namespace NativeScriptDoctor {
6+
export function getJavaVersion(): Promise<string>;
7+
export function getJavaCompilerVersion(): Promise<string>;
8+
}
9+
10+
export = NativeScriptDoctor;

0 commit comments

Comments
 (0)