now working

This commit is contained in:
Philipp Kunz
2015-11-28 22:20:24 +01:00
parent b3fc69631e
commit d203149fd2
13 changed files with 2273 additions and 0 deletions

27
ts/classes.ts Normal file
View File

@ -0,0 +1,27 @@
/// <reference path="./index.ts" />
class Check {
name:string;
result:string;
constructor(nameArg:string,resultArg:string){
this.name = nameArg;
this.result = resultArg;
}
}
class CheckStorage {
checks:Check[];
constructor() {
this.checks = [];
}
addCheck(name:string,result:string){
var localCheck = new Check(name,result);
this.checks.push(localCheck);
}
print() {
for (var check in this.checks){
var localTable = beautylog.table.new("checks");
localTable.push([this.checks[check].name,this.checks[check].result]);
localTable.print();
}
}
}

30
ts/compile/compile.js Normal file
View File

@ -0,0 +1,30 @@
// import gulp
var gulp = require("gulp")
var gulpTypescript = require("gulp-typescript");
var pr = require("pushrocks");
gulp.task('compileTS', function() {
var stream = gulp.src('../index.ts')
.pipe(gulpTypescript({
out: "index.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('compileTestTS', function() {
var stream = gulp.src('../test.ts')
.pipe(gulpTypescript({
out: "test.js"
}))
.pipe(gulp.dest("../../"));
return stream;
});
gulp.task('default',['compileTS','compileTestTS'], function() {
pr.beautylog.success('Typescript compiled');
});
//lets tell gulp to start with the default task.
pr.beautylog.log('Starting Gulp to compile TypeScript');
gulp.start.apply(gulp, ['default']);

2
ts/compile/readme.md Normal file
View File

@ -0,0 +1,2 @@
# How to compile.
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.

10
ts/index.ts Normal file
View File

@ -0,0 +1,10 @@
/// <reference path="typings/tsd.d.ts" />
/// <reference path="./classes.ts" />
var beautylog = require("beautylog")("os");
var smartcheck:any = {};
smartcheck.newStorage = function() {
return new CheckStorage;
};
module.exports = smartcheck;

11
ts/test.ts Normal file
View File

@ -0,0 +1,11 @@
/// <reference path="typings/tsd.d.ts" />
var smartcheck = require("./index.js");
var pr = require("pushrocks");
var myCheckStorage = smartcheck.newStorage();
myCheckStorage.addCheck("Check1","success");
myCheckStorage.print();
pr.beautylog.success("success");

12
ts/tsd.json Normal file
View File

@ -0,0 +1,12 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node.d.ts": {
"commit": "efa0c1196d7280640e624ac1e7fa604502e7bd63"
}
}
}

2079
ts/typings/node/node.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

1
ts/typings/tsd.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference path="node/node.d.ts" />