File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
material-moment-adapter/adapter
tools/public_api_guard/material Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ export class MomentDateAdapter extends DateAdapter<Moment> {
235235 return super . deserialize ( value ) ;
236236 }
237237
238- isDateInstance ( obj : any ) : boolean {
238+ isDateInstance ( obj : any ) : obj is _moment . Moment {
239239 return moment . isMoment ( obj ) ;
240240 }
241241
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ export abstract class DateAdapter<D> {
188188 * @param obj The object to check
189189 * @returns Whether the object is a date instance.
190190 */
191- abstract isDateInstance ( obj : any ) : boolean ;
191+ abstract isDateInstance ( obj : any ) : obj is D ;
192192
193193 /**
194194 * Checks whether the given date is valid.
Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ export class NativeDateAdapter extends DateAdapter<Date> {
267267 return super . deserialize ( value ) ;
268268 }
269269
270- isDateInstance ( obj : any ) {
270+ isDateInstance ( obj : any ) : obj is Date {
271271 return obj instanceof Date ;
272272 }
273273
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export declare abstract class DateAdapter<D> {
7070 abstract getYear ( date : D ) : number ;
7171 abstract getYearName ( date : D ) : string ;
7272 abstract invalid ( ) : D ;
73- abstract isDateInstance ( obj : any ) : boolean ;
73+ abstract isDateInstance ( obj : any ) : obj is D ;
7474 abstract isValid ( date : D ) : boolean ;
7575 abstract parse ( value : any , parseFormat : any ) : D | null ;
7676 sameDate ( first : D | null , second : D | null ) : boolean ;
@@ -377,7 +377,7 @@ export declare class NativeDateAdapter extends DateAdapter<Date> {
377377 getYear ( date : Date ) : number ;
378378 getYearName ( date : Date ) : string ;
379379 invalid ( ) : Date ;
380- isDateInstance ( obj : any ) : boolean ;
380+ isDateInstance ( obj : any ) : obj is Date ;
381381 isValid ( date : Date ) : boolean ;
382382 parse ( value : any ) : Date | null ;
383383 toIso8601 ( date : Date ) : string ;
You can’t perform that action at this time.
0 commit comments