kiota icon indicating copy to clipboard operation
kiota copied to clipboard

TypeScript: Consider extending model class from model interfaces

Open nikithauc opened this issue 3 years ago • 3 comments

Current design:

interface User
{
name: string
}

class User implements IUser{
name: string
}

New design:

class User {
 name:string;
}

interface IUser extends Partial<User>{}

This helps in deduplicating some code and optimizing size.

nikithauc avatar Jul 11 '22 04:07 nikithauc

closing as duplicate of #1730

baywet avatar Jul 11 '22 14:07 baywet

@baywet this is not a duplicate. Do you mind if I reopen this?

#1730 focuses on just the serialization part.

nikithauc avatar Jul 11 '22 23:07 nikithauc

@nikithauc, sure, sorry for jumping the guns here. Would you mind providing more context/details on the original post to help understand things please?

baywet avatar Jul 12 '22 13:07 baywet

As we're moving to a model of interfaces only, this is no longer required. Closing

baywet avatar Apr 05 '23 12:04 baywet