Skip to content

Commit

Permalink
feat(typescript): Basic TypeScript setup
Browse files Browse the repository at this point in the history
see #47
  • Loading branch information
hypery2k committed Dec 15, 2017
1 parent 0ab4b1e commit 70d68ab
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"eslint.enable": false,
"java.configuration.updateBuildConfiguration": "automatic",
"editor.tabSize": 2,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
// exclude .js and .js.map files, when in a TypeScript project
"**/*.js": {
"when": "$(basename).ts"
},
"**/*.js.map": true,
"**/*.ngfactory.ts": true,
"**/*.ngsummary.json": true
},
"vsicons.presets.angular": true,
"json.format.enable": false,
"javascript.format.enable": true,
"typescript.format.enable": true
}
55 changes: 55 additions & 0 deletions core/GalenApi.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
declare interface GridSettings {
browser: string;
browserVersion: string;
platform: string;
size: string;
desiredCapabilities: { key: string, value: string }
}

declare interface WebDriver {

}

export declare function load(jsFilePath: string): void

export declare function createDriver(url: string, browserSize: string, browserType: string): WebDriver

export declare function createGridDriver(gridHubUrl: string, settings: GridSettings): WebDriver

export declare function resize(driver: WebDriver, size: string): void

export declare function checkLayout(driver: WebDriver, specFile: String, tagsToInclude?: [string], tagsToExclude?: [string]): void

export declare function checkLayout({}): void

export declare function checkPageSpecLayout(driver: WebDriver, pageSpec: String, tagsToInclude?: [string], tagsToExclude?: [string]): void

export declare function parsePageSpec({}): void

export declare function loadProperties(filePath: String): Map<string, string>

export declare function readFile(filePath: String): string

export declare function listDirectory(dirPath: String): [string]

export declare function makeDirectory(dirPath: String): void

export declare function fileExists(filePath: String): boolean

export declare function isDirectory(dirPath: String): boolean

export declare function retry(tries: number, callback: Function): void

export declare function takeScreenshot(driver: WebDriver): string

export declare function cookie(driver: WebDriver, cookieValue: string): void

export declare function inject(driver: WebDriver, script: string): void

export declare function createTestDataProvider(varableName: string): any

export declare function dumpPage({}): void

export declare function logged(text: string, callback: Function): void

export declare function loggedFunction(textExpression: string, callback: Function): void
8 changes: 7 additions & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"author": "Martin Reinhardt",
"scripts": {
"galen": "bin/galen",
"build": "npm run tsc",
"tsc": "tsc",
"postinstall": "node postinstall.js",
"test": "nodeunit --reporter=junit test/tests.js --output target",
"pretest": "jshint -c ../.jshintrc --filename *.js && jshint -c ../.jshintrc --filename lib/helper.js && jshint -c ../.jshintrc --filename test/*.js",
Expand Down Expand Up @@ -49,7 +51,11 @@
"istanbul-coveralls": "1.0.3",
"jscoverage": "0.6.0",
"jshint": "2.9.5",
"nodeunit": "0.9.1"
"nodeunit": "0.9.1",
"tsdoc": "0.0.4",
"tslint": "4.0.1",
"tslint-eslint-rules": "1.3.0",
"typescript": "2.6.1"
},
"repository": {
"type": "git",
Expand Down
23 changes: 23 additions & 0 deletions core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "es5",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"lib": [
"es2015",
"es2015.iterable",
"dom"
],
"types": [
"jasmine",
"node"
]
},
"exclude": [
"node_modules"
]
}

0 comments on commit 70d68ab

Please sign in to comment.