// Extracts the names of properties that are functions type FunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]; // Extracts the names of properties that are NOT functions type NonFunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]; interface MyService { id: string; name: string; version: number; getData(): Promise; saveData(data: any): void; config: { url: string }; } type ServiceMethods = FunctionPropertyNames; // 'getData' | 'saveData' type ServiceProperties = NonFunctionPropertyNames; // 'id' | 'name' | 'version' | 'config' // Example usage with Pick type ServiceAPI = Pick; // { getData(): Promise; saveData(data: any): void; } type ServiceData = Pick; // { id: string; name: string; version: number; config: { url: string }; } const api: ServiceAPI = { getData: async () => 'some data', saveData: (data) => console.log('saving', data) }; const data: ServiceData = { id: 'svc-001', name: 'My Awesome Service', version: 1.0, config: { url: 'http://localhost:3000' } }; // console.log(api); // console.log(data);