@empathyco/x-components
Version:
Empathy X Components
29 lines (18 loc) • 728 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [PropsWithType](./x-components.propswithtype.md)
## PropsWithType type
Extracts the name of the properties of an object that match a type.
**Signature:**
```typescript
export type PropsWithType<SomeObject, TargetItem> = keyof SomeObject & keyof SubObject<SomeObject, TargetItem>;
```
**References:** [SubObject](./x-components.subobject.md)
## Example
```typescript
interface Person {
name: string,
surname: string,
age: number
}
type StringPersonProperties = PropsWithType<Person, string>; // "name" | "surname";
```