X Tutup
Skip to content

Commit d35edc8

Browse files
committed
Add ObjectConstructor method overrides for LuaPairsIterable types
1 parent a21e655 commit d35edc8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ module.exports = {
226226
files: "language-extensions/index.d.ts",
227227
rules: {
228228
"@typescript-eslint/naming-convention": "off",
229+
"@typescript-eslint/array-type": "off",
229230
},
230231
},
231232
{

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 LuaReadonlySet<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>): [K, V][];
676+
}

0 commit comments

Comments
 (0)
X Tutup