Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tweaks so everything compiles on typescript 0.9.1-1, add watchTS scri…
…pt, add some references to attributes.ts
  • Loading branch information
gashcrumb committed Nov 15, 2013
1 parent 30da64f commit 52da5a0
Show file tree
Hide file tree
Showing 20 changed files with 335 additions and 316 deletions.
4 changes: 2 additions & 2 deletions hawtio-web/src/main/webapp/app/core/js/coreHelpers.ts
Expand Up @@ -192,7 +192,7 @@ function supportsLocalStorage() {
}


function isNumberTypeName(typeName):bool {
function isNumberTypeName(typeName):boolean {
if (typeName) {
var text = typeName.toString().toLowerCase();
var flag = numberTypeNames[text];
Expand Down Expand Up @@ -1052,7 +1052,7 @@ module Core {
var D = document;
return Math.max(
Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
Math.max(D.body.offsetHeight, (<any>D.documentElement).offsetHeight),
Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}
Expand Down
10 changes: 5 additions & 5 deletions hawtio-web/src/main/webapp/app/core/js/corePlugin.ts
Expand Up @@ -56,8 +56,8 @@ if (jolokiaUrl) {
interface IMyAppScope extends ng.IRootScopeService, ng.IScope {
lineCount: (value:any) => number;
params: ng.IRouteParamsService;
is: (type:any, value:any) => bool;
empty: (value:any) => bool;
is: (type:any, value:any) => boolean;
empty: (value:any) => boolean;
log: (variable:string) => void;
alert: (text:string) => void;
}
Expand Down Expand Up @@ -317,17 +317,17 @@ angular.module('hawtioCore', ['bootstrap', 'ngResource', 'ui', 'ui.bootstrap.dia
* @param type {string} the name of the check (casing sensitive)
* @param value {string} value to check
*/
$rootScope.is = function (type:any, value:any):bool {
$rootScope.is = function (type:any, value:any):boolean {
return angular['is' + type](value);
};

/**
* Wrapper for $.isEmptyObject()
*
* @param value {mixed} Value to be tested
* @return boolean
* @return booleanean
*/
$rootScope.empty = function (value:any):bool {
$rootScope.empty = function (value:any):boolean {
return $.isEmptyObject(value);
};

Expand Down
10 changes: 5 additions & 5 deletions hawtio-web/src/main/webapp/app/core/js/folder.ts
Expand Up @@ -16,12 +16,12 @@ interface NodeSelection {
folderNames?: string[];
children?:NodeSelection[];
parent?: NodeSelection;
isFolder?: () => bool;
isFolder?: () => boolean;

get(key:string): NodeSelection;

ancestorHasType(typeName:string): bool;
ancestorHasEntry(key:string, value): bool;
ancestorHasType(typeName:string): boolean;
ancestorHasEntry(key:string, value): boolean;
}


Expand All @@ -40,7 +40,7 @@ class Folder implements NodeSelection {
entries = {};
addClass = null;
parent: Folder = null;
isLazy: bool = false;
isLazy: boolean = false;
icon: string = null;
tooltip: string = null;
entity: any = null;
Expand Down Expand Up @@ -113,7 +113,7 @@ class Folder implements NodeSelection {
return answer;
}

public sortChildren(recursive: bool) {
public sortChildren(recursive: boolean) {
var children = this.children;
if (children) {
this.children = children.sortBy("title");
Expand Down
8 changes: 4 additions & 4 deletions hawtio-web/src/main/webapp/app/core/js/helpRegistry.ts
Expand Up @@ -52,19 +52,19 @@ module Core {

}

public addUserDoc(topic, path, isValid: () => bool = null) {
public addUserDoc(topic, path, isValid: () => boolean = null) {
this.addSubTopic(topic, 'user', path, isValid);
}

public addDevDoc(topic, path, isValid: () => bool = null) {
public addDevDoc(topic, path, isValid: () => boolean = null) {
this.addSubTopic(topic, 'developer', path, isValid);
}

public addSubTopic(topic, subtopic, path, isValid: () => bool = null) {
public addSubTopic(topic, subtopic, path, isValid: () => boolean = null) {
this.getOrCreateTopic(topic, isValid)[subtopic] = path;
}

public getOrCreateTopic(topic, isValid: () => bool = null) {
public getOrCreateTopic(topic, isValid: () => boolean = null) {
if (!angular.isDefined(this.topics[topic])) {

if (isValid === null) {
Expand Down
8 changes: 4 additions & 4 deletions hawtio-web/src/main/webapp/app/core/js/workspace.ts
Expand Up @@ -10,7 +10,7 @@ interface MenuItem {
content: string;
title?: string;
isValid?: (Workspace) => any;
isActive?: (Workspace) => bool;
isActive?: (Workspace) => boolean;
href: () => any;
}

Expand Down Expand Up @@ -396,7 +396,7 @@ class Workspace {
return pathName;
}

public linkContains(...words:String[]):bool {
public linkContains(...words:String[]):boolean {
var pathName = this.getStrippedPathName();
return words.all((word) => {
return pathName.has(word);
Expand All @@ -410,7 +410,7 @@ class Workspace {
* @param href
* @return true if the given link is active
*/
public isLinkActive(href:string):bool {
public isLinkActive(href:string):boolean {
// lets trim the leading slash
var pathName = this.getStrippedPathName();

Expand All @@ -432,7 +432,7 @@ class Workspace {
/**
* Returns true if the tab query parameter is active or the URL starts with the given path
*/
public isTopTabActive(path:string):bool {
public isTopTabActive(path:string):boolean {
var tab = this.$location.search()['tab'];
if (angular.isString(tab)) {
return tab.startsWith(path);
Expand Down
Expand Up @@ -100,7 +100,7 @@ module Dashboard {

getType:() => string;

isValid: () => bool;
isValid: () => boolean;

}

Expand Down
8 changes: 4 additions & 4 deletions hawtio-web/src/main/webapp/app/dashboard/js/editDashboards.ts
Expand Up @@ -337,14 +337,14 @@ module Dashboard {
if (routeParams) {
$scope.routeParams = decodeURIComponent(routeParams);
}
var size = $routeParams["size"];
var size:any = $routeParams["size"];
if (size) {
var size = decodeURIComponent(size);
size = decodeURIComponent(size);
$scope.preferredSize = angular.fromJson(size);
}
var title = $routeParams["title"];
var title:any = $routeParams["title"];
if (title) {
var title = decodeURIComponent(title);
title = decodeURIComponent(title);
$scope.widgetTitle = title;
}

Expand Down
Expand Up @@ -6,8 +6,6 @@

/// <reference path="../jquery/jquery.d.ts" />

declare var angular: ng.IAngularStatic;

// Support for painless dependency injection
interface Function {
$inject:string[];
Expand Down Expand Up @@ -818,3 +816,7 @@ declare module ng {
}

}

declare var angular: ng.IAngularStatic;


Expand Up @@ -9,8 +9,8 @@
// move these definitions up into ../codemirror.d.ts for now so code compiles again
/*
declare var CodeMirror: {
tagRangeFinder: (codeMirror: CodeMirrorEditor, line: number, hideEnd: bool) => number;
braceRangeFinder: (codeMirror: CodeMirrorEditor, line: number, hideEnd: bool) => number;
tagRangeFinder: (codeMirror: CodeMirrorEditor, line: number, hideEnd: boolean) => number;
braceRangeFinder: (codeMirror: CodeMirrorEditor, line: number, hideEnd: boolean) => number;
indentRangeFinder: (codeMirror: CodeMirrorEditor, line: number) => number;
newFoldFunction: (rangeFinder?:any, markText?:any, hideEnd?:any) => (codeMirror, line) => void;
}
Expand All @@ -24,7 +24,7 @@ interface IFormattingPosition {
ch: number;
}
interface CodeMirrorEditor {
commentRange: (isComment: bool, from: number, to: number) => void;
commentRange: (isComment: boolean, from: number, to: number) => void;
autoIndentRange: (from: IFormattingPosition, to: IFormattingPosition) => void;
autoFormatRange: (from: IFormattingPosition, to: IFormattingPosition) => void;
}
}
48 changes: 24 additions & 24 deletions hawtio-web/src/main/webapp/app/definitions/codemirror.d.ts
Expand Up @@ -36,8 +36,8 @@ interface CodeMirrorToken {
}

interface CodeMirrorMarkTextOptions {
inclusiveLeft: bool;
inclusiveRight: bool;
inclusiveLeft: boolean;
inclusiveRight: boolean;
startStype: string;
endStyle: string;
}
Expand Down Expand Up @@ -86,16 +86,16 @@ interface CodeMirrorViewPortChangeListener {


interface CodeMirrorStream {
eol(): bool;
sol(): bool;
eol(): boolean;
sol(): boolean;
peek(): string;
next(): string;
eat(match: any): string;
eatWhile(match: any): bool;
eatSpace(): bool;
eatWhile(match: any): boolean;
eatSpace(): boolean;
skipToEnd(): void;
skipTo(ch: string): bool;
match(pattern: RegExp, consume: bool, caseFold: bool): bool;
skipTo(ch: string): boolean;
match(pattern: RegExp, consume: boolean, caseFold: boolean): boolean;
backUp(n: number): void;
column(): number;
indentation(): number;
Expand Down Expand Up @@ -133,15 +133,15 @@ interface CodeMirrorEditor {
setOption(option: string, value: any);
getOption(option: string): any;
getMode(): CodeMirrorMode;
cursorCoords(start: bool, mode: string): CodeMirrorCoords;
cursorCoords(start: boolean, mode: string): CodeMirrorCoords;
charCoords(pos: CodeMirrorPosition, mode: string): CodeMirrorCoords;
undo(): void;
redo(): void;
historySize(): CodeMirrorHistorySize;
clearHistory(): void;
getHistory(): any;
setHistory(history: any);
indentLine(line: number, dir?: bool);
indentLine(line: number, dir?: boolean);
getTokenAt(pos: CodeMirrorPosition): CodeMirrorToken;
markText(from: CodeMirrorPosition, to: CodeMirrorPosition, className: string,
option?: CodeMirrorMarkTextOptions): CodeMirrorBookMark;
Expand All @@ -156,11 +156,11 @@ interface CodeMirrorEditor {
lineInfo(line: number): CodeMirrorLineInfo;
getLineHandler(line: number): CodeMirrorLineHandle;
getViewPort(): CodeMirrorViewPort;
addWidget(pos: CodeMirrorPosition, node: Node, scrollIntoView: bool);
addWidget(pos: CodeMirrorPosition, node: Node, scrollIntoView: boolean);
matchBrackets(): void;
lineCount(): number;
getCursor(start?: bool): CodeMirrorPosition;
somethingSelected(): bool;
getCursor(start?: boolean): CodeMirrorPosition;
somethingSelected(): boolean;
setCursor(pos: CodeMirrorPosition): void;
setSelection(start: CodeMirrorPosition, end: CodeMirrorPosition): void;
getLine(n: number): string;
Expand Down Expand Up @@ -188,18 +188,18 @@ interface CodeMirrorOptions {
indentUnit?: number;
smartIndend?: number;
tabSize?: number;
indentWithTabs?: bool;
electricsChars?: bool;
autoClearEmptyLines?: bool;
indentWithTabs?: boolean;
electricsChars?: boolean;
autoClearEmptyLines?: boolean;
keyMap?: string;
extraKeys?: any;
lineWrapping?: bool;
lineNumbers?: bool;
firstLineNumber?: bool;
lineWrapping?: boolean;
lineNumbers?: boolean;
firstLineNumber?: boolean;
lineNumberFormatter?: Function;
gutter?: bool;
fixedGutter?: bool;
readOnly?: bool;
gutter?: boolean;
fixedGutter?: boolean;
readOnly?: boolean;
onChange?: CodeMirrorChangeListener;
onCursorActivity?: Function;
onViewportChange?: CodeMirrorViewPortChangeListener;
Expand All @@ -218,8 +218,8 @@ declare var CodeMirror: {
connect(target: EventTarget, event: String, func: Function);
commands: any;

tagRangeFinder: (codeMirror: CodeMirrorEditor, line: number, hideEnd: bool) => number;
braceRangeFinder: (codeMirror: CodeMirrorEditor, line: number, hideEnd: bool) => number;
tagRangeFinder: (codeMirror: CodeMirrorEditor, line: number, hideEnd: boolean) => number;
braceRangeFinder: (codeMirror: CodeMirrorEditor, line: number, hideEnd: boolean) => number;
indentRangeFinder: (codeMirror: CodeMirrorEditor, line: number) => number;
newFoldFunction: (rangeFinder?:any, markText?:any, hideEnd?:any) => (codeMirror, line) => void;

Expand Down

0 comments on commit 52da5a0

Please sign in to comment.