diff --git a/types/plist/index.d.ts b/types/plist/index.d.ts index b7064e55a3..f97b267df4 100644 --- a/types/plist/index.d.ts +++ b/types/plist/index.d.ts @@ -20,9 +20,9 @@ export type PlistValue = string | number | boolean | Date | Buffer | PlistObject | PlistArray; export interface PlistObject { - [x: string]: PlistValue; + readonly [x: string]: PlistValue; } -export interface PlistArray extends Array { } +export interface PlistArray extends ReadonlyArray { } // PlistBuildOptions // The instance of this type is passed to 'xmlbuilder' module as it is. diff --git a/types/plist/plist-tests.ts b/types/plist/plist-tests.ts index a94cb4cf71..00dc33b56c 100644 --- a/types/plist/plist-tests.ts +++ b/types/plist/plist-tests.ts @@ -79,3 +79,10 @@ console.log(plistString1); const plistString2 = plist.build(plistValue2, {pretty: false}); console.log(plistString2); + +function f(a: ReadonlyArray) { + plist.build(a); +} + +// $ExpectError +plist.build(() => 0);