refactor: add types (#9288)

This commit is contained in:
Victor Berchet
2016-06-17 10:57:32 -07:00
committed by GitHub
parent 8879aa1df4
commit 5e3ccbcea9
14 changed files with 66 additions and 72 deletions

View File

@ -6,7 +6,7 @@ var win = typeof window !== 'undefined' && window || <any>{};
export {win as window};
export var document = win.document;
export var location = win.location;
export var gc = win['gc'] ? () => win['gc']() : (): any /** TODO #9100 */ => null;
export var gc = win['gc'] ? () => win['gc']() : (): any => null;
export var performance = win['performance'] ? win['performance'] : null;
export const Event = win['Event'];
export const MouseEvent = win['MouseEvent'];

View File

@ -127,13 +127,13 @@ function hour12Modify(
}
function digitCondition(prop: string, len: number): Intl.DateTimeFormatOptions {
var result = {};
(result as any /** TODO #9100 */)[prop] = len == 2 ? '2-digit' : 'numeric';
var result: {[k: string]: string} = {};
result[prop] = len == 2 ? '2-digit' : 'numeric';
return result;
}
function nameCondition(prop: string, len: number): Intl.DateTimeFormatOptions {
var result = {};
(result as any /** TODO #9100 */)[prop] = len < 4 ? 'short' : 'long';
var result: {[k: string]: string} = {};
result[prop] = len < 4 ? 'short' : 'long';
return result;
}