-1

How can I reuse the type of someMethod ?

Interface Foo {
  someMethod: // want to reuse this type without copy pasting
}

const myValue: // I want it to be of type Foo.someMethod
0

1 Answer 1

1

You can do it like this:

interface Foo {
  someMethod: {
    foo: string;
    bar: number;
  };
}

const myValue: Foo['someMethod'] = { bar: 0, foo: '' };
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.