mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore: fix implicit-any error in drag-styling.ts (#13500)
This commit is contained in:
committed by
vivian-hu
parent
f3555f164e
commit
9cd3132607
@@ -6,6 +6,12 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
|
||||
// Helper type that ignores `readonly` properties. This is used in
|
||||
// `extendStyles` to ignore the readonly properties on CSSStyleDeclaration
|
||||
// since we won't be touching those anyway.
|
||||
type Writeable<T> = { -readonly [P in keyof T]-?: T[P] };
|
||||
|
||||
/**
|
||||
* Extended CSSStyleDeclaration that includes a couple of drag-related
|
||||
* properties that aren't in the built-in TS typings.
|
||||
@@ -19,10 +25,12 @@ interface DragCSSStyleDeclaration extends CSSStyleDeclaration {
|
||||
* Shallow-extends a stylesheet object with another stylesheet object.
|
||||
* @docs-private
|
||||
*/
|
||||
export function extendStyles(dest: CSSStyleDeclaration, source: Partial<DragCSSStyleDeclaration>) {
|
||||
export function extendStyles(
|
||||
dest: Writeable<CSSStyleDeclaration>,
|
||||
source: Partial<DragCSSStyleDeclaration>) {
|
||||
for (let key in source) {
|
||||
if (source.hasOwnProperty(key)) {
|
||||
dest[key!] = source[key];
|
||||
dest[key as keyof CSSStyleDeclaration] = source[key as keyof CSSStyleDeclaration];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user