mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
fix(core): Added ObservableArray constructor declarations to allow setting multiple arguments (#9980)
This commit is contained in:

committed by
GitHub

parent
f9b52b9aac
commit
d82f3d990d
@ -50,10 +50,22 @@ export class ObservableArray<T> extends Observable {
|
||||
private _addArgs: ChangedData<T>;
|
||||
private _deleteArgs: ChangedData<T>;
|
||||
|
||||
/**
|
||||
* Create ObservableArray<T> with specified length.
|
||||
*/
|
||||
constructor(arrayLength?: number);
|
||||
|
||||
/**
|
||||
* Create ObservableArray<T> from source Array<T>.
|
||||
*/
|
||||
constructor(args?: T[] | number) {
|
||||
constructor(items: T[]);
|
||||
|
||||
/**
|
||||
* Create ObservableArray<T> from T items.
|
||||
*/
|
||||
constructor(...items: T[]);
|
||||
|
||||
constructor(_args?: any) {
|
||||
super();
|
||||
|
||||
if (arguments.length === 1 && Array.isArray(arguments[0])) {
|
||||
|
Reference in New Issue
Block a user