diff --git a/types/polymer/index.d.ts b/types/polymer/index.d.ts index c206c08927..a4eca3e70b 100644 --- a/types/polymer/index.d.ts +++ b/types/polymer/index.d.ts @@ -139,6 +139,8 @@ declare global { unshift?(path: string, ...item: any[]): number; + notifySplices?(path: string, splices: ReadonlyArray): void; + // ResolveUrl resolveUrl?(url: string): string; diff --git a/types/polymer/polymer-tests.ts b/types/polymer/polymer-tests.ts index dcad66f871..2b6631ffb7 100644 --- a/types/polymer/polymer-tests.ts +++ b/types/polymer/polymer-tests.ts @@ -82,3 +82,11 @@ class MyElement3 implements polymer.Base { } Polymer(MyElement3); + +// Test splice computation +const splices: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices( + [1,2,3], [1,2]); + +// Test that readonly arrays also work. +const splices2: polymer.PolymerSplice[] = Polymer.ArraySplice.calculateSplices( + Object.freeze([1,2,3]), Object.freeze([1,2]));