Skip to content

docs(power): update createClassSerdes and createClassSerdesWithDates example to use no-arg constructor#171

Open
TrickSumo wants to merge 2 commits intoaws:mainfrom
TrickSumo:patch-1
Open

docs(power): update createClassSerdes and createClassSerdesWithDates example to use no-arg constructor#171
TrickSumo wants to merge 2 commits intoaws:mainfrom
TrickSumo:patch-1

Conversation

@TrickSumo
Copy link
Copy Markdown
Contributor

Issue

The createClassSerdes and createClassSerdesWithDates function requires a no-argument constructor (new () => T) as defined in the SDK type signature:

export declare function createClassSerdesWithDates<T extends object>(
  cls: new () => T,  // zero-argument constructor required
  dateProps: string[]
): Serdes<T>;

The JSDoc also explicitly states: "The class constructor (must have no required parameters)"

The current example uses a constructor with 3 required parameters, which causes a TypeScript compile error:

Argument of type 'typeof User' is not assignable to parameter of type 'new () => User'.
Target signature provides too few arguments. Expected 3 or more, but got 0.

Description of changes:

Updated createClassSerdesWithDates and createClassSerdesWithDates example to use no-arg constructor.

TrickSumo added 2 commits May 9, 2026 15:31
fix: update createClassSerdesWithDates example to use no-arg constructor
fix: update createClassSerdesWithDates example to use no-arg constructor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant