feat(common): stricter types for DatePipe (#37447)
Make typing of DatePipe stricter to catch some misuses (such as passing an Observable or an array) at compile time. BREAKING CHANGE: The signature of the `date` pipe now explicitly states which types are accepted. This should only cause issues in corner cases, as any other values would result in runtime exceptions. PR Close #37447
This commit is contained in:

committed by
Alex Rickabaugh

parent
5f815c0565
commit
daf8b7f100
4
goldens/public-api/common/common.d.ts
vendored
4
goldens/public-api/common/common.d.ts
vendored
@ -18,7 +18,9 @@ export declare class CurrencyPipe implements PipeTransform {
|
||||
|
||||
export declare class DatePipe implements PipeTransform {
|
||||
constructor(locale: string);
|
||||
transform(value: any, format?: string, timezone?: string, locale?: string): string | null;
|
||||
transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string | null;
|
||||
transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null;
|
||||
transform(value: Date | string | number | null | undefined, format?: string, timezone?: string, locale?: string): string | null;
|
||||
}
|
||||
|
||||
export declare class DecimalPipe implements PipeTransform {
|
||||
|
Reference in New Issue
Block a user