From fbf3c7a091b51e5596364501bb9cc22f44514cf9 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Thu, 6 Oct 2022 16:17:12 +0200 Subject: [PATCH] explain usage for higher kinded T --- src/story.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/story.ts b/src/story.ts index 0bcab95..069a2d5 100644 --- a/src/story.ts +++ b/src/story.ts @@ -50,8 +50,12 @@ export type StrictGlobalTypes = { [name: string]: StrictInputType }; export type AnyFramework = { component: unknown; - T: unknown; storyResult: unknown; + // A generic type T that can be used in the definition of the component like this: + // component: (args: this['T']) => string; + // This generic type will eventually be filled in with TArgs + // Credits to Michael Arnaldi. + T: unknown; }; export type StoryContextForEnhancers< @@ -267,7 +271,7 @@ export interface ComponentAnnotations