API
@agape/types

Properties Type

All properties except methods and functions

API

type Properties<T extends object> = Pick<T, { [K: keyof T]: T[K] extends Function ? never : K }[keyof T]>

Description

All properties except methods and functions

Usage

class Foo {
  foo: string;

  bar: string;

  constructor(params: Properties<Foo>) {

  }

  baz() {

  }
}


const params: Properties<Foo> = { foo: 'foo', bar: 'bar' };