diff --git a/index.ts b/index.ts index d22ebe5..80c96a5 100644 --- a/index.ts +++ b/index.ts @@ -38,9 +38,7 @@ export function copy(object: T): T { } /** The string property names of `T`. */ -export type StringKey = T extends Record - ? K & string - : never; +export type StringKey = T extends Record ? K & string : never; /** Returns an array of the object's own ennumerable string-keyed property names. */ // @ts-ignore duplicate identifier: This is the exported declaration, the implementation is below. @@ -50,16 +48,21 @@ export function keys(object: T): Array>; // @ts-ignore duplicate identifier: This is the actual implementation, the exported declaration is above. export const keys: (object: T) => Array> = Object.keys; +/** The string-keyed property values of `T`. */ +export type StringKeyedValue = T extends Record + ? K extends string + ? T[K] + : never + : never; + +/** Returns an array of the object's own ennumerable string-keyed property + * values. */ // @ts-ignore duplicate identifier: This is the exported declaration, the implementation is below. -export function values( - dictionary: Readonly> -): TValue[]; +export function values(object: T): Array>; /* @internal This implementation is for internal use only, the exported declaration is above. */ // @ts-ignore duplicate identifier: This is the actual implementation, the exported declaration is above. -export const values: ( - dictionary: Readonly> -) => TValue[] = Object.values; +export const values: (object: T) => Array> = Object.values; // @ts-ignore duplicate identifier: This is the exported declaration, the implementation is below. export function entries(