X Tutup
Skip to content

Commit a21b9f7

Browse files
authored
Add ObjectConstructor method overrides for LuaPairsIterable types (#1314)
1 parent 92c6e0a commit a21b9f7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

language-extensions/index.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,3 +663,14 @@ declare const LuaSet: (new <T extends AnyNotNil = AnyNotNil>() => LuaSet<T>) & L
663663
declare interface ReadonlyLuaSet<T extends AnyNotNil = AnyNotNil> extends LuaPairsKeyIterable<T> {
664664
has: LuaTableHasMethod<T>;
665665
}
666+
667+
interface ObjectConstructor {
668+
/** Returns an array of keys of an object, when iterated with `pairs`. */
669+
keys<K>(o: LuaPairsIterable<K, any> | LuaPairsKeyIterable<K>): K[];
670+
671+
/** Returns an array of values of an object, when iterated with `pairs`. */
672+
values<V>(o: LuaPairsIterable<any, V>): V[];
673+
674+
/** Returns an array of key/values of an object, when iterated with `pairs`. */
675+
entries<K, V>(o: LuaPairsIterable<K, V>): Array<[K, V]>;
676+
}

0 commit comments

Comments
 (0)
X Tutup