Skip to content

Conversation

@erikeldridge
Copy link
Contributor

Discussion

It doesn't make sense to pass a cached template to getServerTemplate because the method loads a new template immediately.

I see a recommendation to define distinct interfaces for method options: microsoft/tsdoc#19.

So, this change splits ServerTemplateOptions into GetServerTemplateOptions and InitServerTemplateOptions.

Testing

Tested with npm test.

API Changes

Splits ServerTemplateOptions into GetServerTemplateOptions and InitServerTemplateOptions.

@erikeldridge erikeldridge self-assigned this Mar 22, 2024
@erikeldridge erikeldridge requested a review from amanda-xia March 22, 2024 23:33
Copy link
Member

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!
Left one comment

* Represents optional arguments that can be used when instantiating {@link ServerTemplate}.
*/
export interface ServerTemplateOptions {
export interface GetServerTemplateOptions {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it makes sense to create a base type and extend from it?

export interface InitServerTemplateOptions extends GetServerTemplateOptions {
      template?: ServerTemplateData,
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I'll update it.

@erikeldridge erikeldridge merged commit 69c1262 into ssrc Apr 2, 2024
@erikeldridge erikeldridge deleted the ssrc-options branch April 2, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants