Add typedef tslint rule

This commit is contained in:
Daniel Imms
2017-08-05 13:56:38 -07:00
parent aee474b53e
commit f9fce53cc4
17 changed files with 230 additions and 250 deletions
+12 -12
View File
@@ -32,7 +32,7 @@ describe('Linkifier', () => {
linkifier = new TestLinkifier();
});
function addRow(html: string) {
function addRow(html: string): void {
const element = document.createElement('div');
element.innerHTML = html;
container.appendChild(element);
@@ -57,24 +57,24 @@ describe('Linkifier', () => {
document.body.appendChild(container);
});
function clickElement(element: Node) {
function clickElement(element: Node): void {
const event = document.createEvent('MouseEvent');
event.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
element.dispatchEvent(event);
}
function assertLinkifiesEntireRow(uri: string, done: MochaDone) {
addRow(uri);
linkifier.linkifyRow(0);
setTimeout(() => {
assert.equal((<HTMLElement>rows[0].firstChild).tagName, 'A');
assert.equal((<HTMLElement>rows[0].firstChild).textContent, uri);
done();
}, 0);
function assertLinkifiesEntireRow(uri: string, done: MochaDone): void {
addRow(uri);
linkifier.linkifyRow(0);
setTimeout(() => {
assert.equal((<HTMLElement>rows[0].firstChild).tagName, 'A');
assert.equal((<HTMLElement>rows[0].firstChild).textContent, uri);
done();
}, 0);
}
describe('http links', () => {
function assertLinkifiesEntireRow(uri: string, done: MochaDone) {
function assertLinkifiesEntireRow(uri: string, done: MochaDone): void {
addRow(uri);
linkifier.linkifyRow(0);
setTimeout(() => {
@@ -87,7 +87,7 @@ describe('Linkifier', () => {
});
describe('link matcher', () => {
function assertLinkifiesRow(rowText: string, linkMatcherRegex: RegExp, expectedHtml: string, done: MochaDone) {
function assertLinkifiesRow(rowText: string, linkMatcherRegex: RegExp, expectedHtml: string, done: MochaDone): void {
addRow(rowText);
linkifier.registerLinkMatcher(linkMatcherRegex, () => {});
linkifier.linkifyRow(0);