The transformer class to extract variant methods from
class UserResource {
toObject() { return { id: 1, name: "John" } }
toSummary() { return { id: 1 } }
invalidMethod() { return "not resource data" }
}
type Variants = ExtractTransformerVariants<UserResource> // "toObject" | "toSummary"
Extracts the variant methods of a transformer class. Any method that returns ResourceData or Promise can be picked for serialization.
This utility type filters all methods of a transformer class to only include those that return the correct data types for resource serialization.