angular-cn/tools/public_api_guard/common
cexbrayat 95830ee584 feat(common): stricter types for SlicePipe (#30156)
Adds overloads to the `transform` methods of `SlicePipe`,
to have better types than `any` for `value` and `any` as a return.
With this commit, using `slice` in an `ngFor` still allow to type-check the content of the `ngFor`
with `fullTemplateTypeCheck` enabled in Ivy:

    <div *ngFor="let user of users | slice:0:2">{{ user.typo }}</div>
                                                        |
                                                        `typo` does not exist on type `UserModel`

whereas it is currently not catched (as the return of `slice` is `any`) neither in VE nor in Ivy.

BREAKING CHANGE
`SlicePipe` now only accepts an array of values, a string, null or undefined.
This was already the case in practice, and it still throws at runtime if another type is given.
But it is now a compilation error to try to call it with an unsupported type.

PR Close #30156
2019-05-17 14:21:36 -07:00
..
http docs: remove all deprecated `@stable` jsdoc tags (#23210) 2018-04-10 21:49:32 -07:00
common.d.ts feat(common): stricter types for SlicePipe (#30156) 2019-05-17 14:21:36 -07:00
http.d.ts feat: add support for TypeScript 3.1 (#26151) 2018-09-28 09:34:51 -07:00
testing.d.ts fix(common): add upgrade sub-package to ng_package rule for @angular/common (#30117) 2019-04-25 15:01:17 -07:00
upgrade.d.ts docs(docs-infra): add common/upgrade to API package sources (#30331) 2019-05-16 11:47:16 -07:00