Type Inconsistency in Record.keys Method in Effect Typescript Library

I suppose this is know and there's a reason to have done it like this but Record.keys is "lying" on the type level. See this example to demonstrate (See on playground)
import { Record } from "effect"

const foo = (obj: { foo: string }) => Record.keys(obj)
type Foo = ReturnType<typeof foo> // => "foo"[]

const bar = {
  foo: "bla",
  bar: "gfddg"
}
const result = foo(bar) // type "foo"[]
console.log(result) // logs [ 'foo', 'bar' ]

This is the reason for the type of Object.keys being string[] whatever the object passed.
I find it really useful sometimes that Record.keys does not return just string[] but it's also not always true.
Any reason for this choice? Shouldn't we at least warn the users of this?
Was this page helpful?