
Record<PropertyKey, never> makes them incompatible with each other because it specifically denies any extra keys. Record<PropertyKey, unknown> allows me to work with pages whose content and metadata is unknown, which is good for reading but horribly unsafe for writing because it allows me to write anything in pages. Only {} behaves correctly because it keeps any pages outside of the requirements inaccessible.The thing that has always irked me with the TypeScript ecosystem is that this advice is fucking wrong.{}doesn't mean an empty object, but means any types other thannullandundefined
If you want a type that means "empty object", useRecord<PropertyKey, never>instead (deno-lint ban-types)
{} sometimes does mean empty record, and there's no substitute for it. Record<PropertyKey, never> gets me an error, and Record<PropertyKey, unknown> allows too much.