Skip to content

docs(power): update createClassSerdesWithDates example to use no-arg constructor#164

Merged
yaythomas merged 2 commits intoaws:mainfrom
TrickSumo:main
May 7, 2026
Merged

docs(power): update createClassSerdesWithDates example to use no-arg constructor#164
yaythomas merged 2 commits intoaws:mainfrom
TrickSumo:main

Conversation

@TrickSumo
Copy link
Copy Markdown
Contributor

Issue

The 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 example to use no-arg constructor.

TrickSumo added 2 commits May 7, 2026 17:13
fix: update createClassSerdesWithDates example to use no-arg constructor
@yaythomas yaythomas moved this from Backlog to In review in aws-durable-execution May 7, 2026
@yaythomas
Copy link
Copy Markdown
Contributor

nice, thank you so much @TrickSumo!

@yaythomas yaythomas merged commit 032bdb2 into aws:main May 7, 2026
@github-project-automation github-project-automation Bot moved this from In review to Done in aws-durable-execution May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants