DefinitelyTyped/types/ts-nameof/index.d.ts
David Sherret 56f0f57acf [ts-nameof] Add nameof.interpolate (#38706)
* ts-nameof: Add nameof.interpolate

* Fix old ts vs new ts difference with string literal types.
2019-10-03 14:31:28 -07:00

20 lines
916 B
TypeScript

// Type definitions for ts-nameof 4.0
// Project: https://github.com/dsherret/ts-nameof#readme
// Definitions by: David Sherret <https://github.com/dsherret>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// tslint:disable-next-line no-unnecessary-generics
declare function nameof<T>(func?: (obj: T) => void): string;
declare function nameof(obj: any): string;
declare namespace nameof {
// tslint:disable-next-line no-unnecessary-generics
function full<T>(periodIndex?: number): string;
// tslint:disable-next-line no-unnecessary-generics
function full<T>(func: (obj: T) => void, periodIndex?: number): string;
function full(obj: any, periodIndex?: number): string;
// tslint:disable-next-line no-unnecessary-generics
function toArray<T>(func: (obj: T) => any[]): string[];
function toArray(...args: any[]): string[];
function interpolate<T>(value: T): T;
}