mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
plist: Support building from ReadonlyArray (#30119)
This commit is contained in:
Vendored
+2
-2
@@ -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<PlistValue> { }
|
||||
export interface PlistArray extends ReadonlyArray<PlistValue> { }
|
||||
|
||||
// PlistBuildOptions
|
||||
// The instance of this type is passed to 'xmlbuilder' module as it is.
|
||||
|
||||
@@ -79,3 +79,10 @@ console.log(plistString1);
|
||||
|
||||
const plistString2 = plist.build(plistValue2, {pretty: false});
|
||||
console.log(plistString2);
|
||||
|
||||
function f(a: ReadonlyArray<string>) {
|
||||
plist.build(a);
|
||||
}
|
||||
|
||||
// $ExpectError
|
||||
plist.build(() => 0);
|
||||
|
||||
Reference in New Issue
Block a user