mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 06:29:40 +08:00
Include the notifySplices method, and also add a trivial test for the
ArraySplice function with mutable and immutable arrays.
This commit is contained in:
2
types/polymer/index.d.ts
vendored
2
types/polymer/index.d.ts
vendored
@@ -139,6 +139,8 @@ declare global {
|
||||
|
||||
unshift?(path: string, ...item: any[]): number;
|
||||
|
||||
notifySplices?(path: string, splices: ReadonlyArray<polymer.PolymerSplice>): void;
|
||||
|
||||
// ResolveUrl
|
||||
|
||||
resolveUrl?(url: string): string;
|
||||
|
||||
@@ -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]));
|
||||
|
||||
Reference in New Issue
Block a user