From 3cab23c3ce732147f88a62c8e8f4d295a823bcae Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 19 Apr 2016 16:18:19 -0700 Subject: [PATCH] Convert chai-datetime --- chai-datetime/chai-datetime.d.ts | 59 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/chai-datetime/chai-datetime.d.ts b/chai-datetime/chai-datetime.d.ts index 16dd6b8856..ed74a8978c 100644 --- a/chai-datetime/chai-datetime.d.ts +++ b/chai-datetime/chai-datetime.d.ts @@ -5,38 +5,37 @@ /// -declare namespace Chai { +declare function chaiDateTime(chai: any, utils: any): void; +export = chaiDateTime; - interface Assertion { - afterDate(date: Date): Assertion; - beforeDate(date: Date): Assertion; - equalDate(date: Date): Assertion; - afterTime(date: Date): Assertion; - beforeTime(date: Date): Assertion; - equalTime(date: Date): Assertion; +declare global { + namespace Chai { + interface Assertion { + afterDate(date: Date): Assertion; + beforeDate(date: Date): Assertion; + equalDate(date: Date): Assertion; + afterTime(date: Date): Assertion; + beforeTime(date: Date): Assertion; + equalTime(date: Date): Assertion; + } + + interface Assert { + equalTime(val: Date, exp: Date, msg?: string): void; + notEqualTime(val: Date, exp: Date, msg?: string): void; + beforeTime(val: Date, exp: Date, msg?: string): void; + notBeforeTime(val: Date, exp: Date, msg?: string): void; + afterTime(val: Date, exp: Date, msg?: string): void; + notAfterTime(val: Date, exp: Date, msg?: string): void; + equalDate(val: Date, exp: Date, msg?: string): void; + notEqualDate(val: Date, exp: Date, msg?: string): void; + beforeDate(val: Date, exp: Date, msg?: string): void; + notBeforeDate(val: Date, exp: Date, msg?: string): void; + afterDate(val: Date, exp: Date, msg?: string): void; + notAfterDate(val: Date, exp: Date, msg?: string): void; + } } - interface Assert { - equalTime(val: Date, exp: Date, msg?: string): void; - notEqualTime(val: Date, exp: Date, msg?: string): void; - beforeTime(val: Date, exp: Date, msg?: string): void; - notBeforeTime(val: Date, exp: Date, msg?: string): void; - afterTime(val: Date, exp: Date, msg?: string): void; - notAfterTime(val: Date, exp: Date, msg?: string): void; - equalDate(val: Date, exp: Date, msg?: string): void; - notEqualDate(val: Date, exp: Date, msg?: string): void; - beforeDate(val: Date, exp: Date, msg?: string): void; - notBeforeDate(val: Date, exp: Date, msg?: string): void; - afterDate(val: Date, exp: Date, msg?: string): void; - notAfterDate(val: Date, exp: Date, msg?: string): void; + interface Date { + should: Chai.Assertion; } } - -interface Date { - should: Chai.Assertion; -} - -declare module "chai-datetime" { - function chaiDateTime(chai: any, utils: any): void; - export = chaiDateTime; -}