File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 66 * found in the LICENSE file at https://angular.io/license
77 */
88
9+
10+ // Helper type that ignores `readonly` properties. This is used in
11+ // `extendStyles` to ignore the readonly properties on CSSStyleDeclaration
12+ // since we won't be touching those anyway.
13+ type Writeable < T > = { - readonly [ P in keyof T ] -?: T [ P ] } ;
14+
915/**
1016 * Extended CSSStyleDeclaration that includes a couple of drag-related
1117 * properties that aren't in the built-in TS typings.
@@ -19,10 +25,12 @@ interface DragCSSStyleDeclaration extends CSSStyleDeclaration {
1925 * Shallow-extends a stylesheet object with another stylesheet object.
2026 * @docs -private
2127 */
22- export function extendStyles ( dest : CSSStyleDeclaration , source : Partial < DragCSSStyleDeclaration > ) {
28+ export function extendStyles (
29+ dest : Writeable < CSSStyleDeclaration > ,
30+ source : Partial < DragCSSStyleDeclaration > ) {
2331 for ( let key in source ) {
2432 if ( source . hasOwnProperty ( key ) ) {
25- dest [ key ! ] = source [ key ] ;
33+ dest [ key as keyof CSSStyleDeclaration ] = source [ key as keyof CSSStyleDeclaration ] ;
2634 }
2735 }
2836
You can’t perform that action at this time.
0 commit comments