diff --git a/types/ts-nameof/index.d.ts b/types/ts-nameof/index.d.ts index a7850d695f..1a4daec3dd 100644 --- a/types/ts-nameof/index.d.ts +++ b/types/ts-nameof/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ts-nameof 3.2 +// Type definitions for ts-nameof 4.0 // Project: https://github.com/dsherret/ts-nameof#readme // Definitions by: David Sherret // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -15,4 +15,5 @@ declare namespace nameof { // tslint:disable-next-line no-unnecessary-generics function toArray(func: (obj: T) => any[]): string[]; function toArray(...args: any[]): string[]; + function interpolate(value: T): T; } diff --git a/types/ts-nameof/ts-nameof-tests.ts b/types/ts-nameof/ts-nameof-tests.ts index 21a53ec0f5..0b7878b3cd 100644 --- a/types/ts-nameof/ts-nameof-tests.ts +++ b/types/ts-nameof/ts-nameof-tests.ts @@ -29,6 +29,9 @@ nameof.toArray(testInstance.prop1); // $ExpectType string[] nameof.toArray(testInstance.prop1, testInstance.prop2); // $ExpectType string[] nameof.toArray(t => [t.prop1]); // $ExpectType string[] +// nameof.interpolate tests +nameof.interpolate("" as string); // $ExpectType string + // reference type test const myObj = { test: "" }; nameof(myObj); // $ExpectType string