File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ import { getStoryFactory } from "./getStory";
44import { assert } from "tsafe/assert" ;
55import type { Equals } from "tsafe" ;
66
7- const { meta, getStory } = getStoryFactory ( {
7+ const { meta, getStory } = getStoryFactory <
8+ SelectProps < GenericOption < string | number | MyFakeValue > [ ] >
9+ > ( {
810 sectionName,
911 "wrappedComponent" : { Select } ,
1012 "description" : `
@@ -100,7 +102,7 @@ function MyComponent(){
100102 assert <
101103 Equals <
102104 typeof options [ number ] ,
103- NonNullable < SelectProps < typeof options [ number ] > [ "state" ] >
105+ NonNullable < SelectProps < GenericOption < typeof options [ number ] > [ ] > [ "state" ] >
104106 >
105107 > ( ) ;
106108
@@ -140,12 +142,12 @@ const myFakeValueSet = [
140142 "66a9d7ac-9b25-4e52-9de3-4b7238135b39"
141143] as const ;
142144
143- const optionsWithTypedValues : GenericOption < typeof myFakeValueSet [ number ] > [ ] = myFakeValueSet . map (
144- fakeValue => ( {
145- value : fakeValue ,
146- label : fakeValue
147- } )
148- ) ;
145+ type MyFakeValue = typeof myFakeValueSet [ number ] ;
146+
147+ const optionsWithTypedValues : GenericOption < MyFakeValue > [ ] = myFakeValueSet . map ( fakeValue => ( {
148+ value : fakeValue ,
149+ label : fakeValue
150+ } ) ) ;
149151
150152export const Default = getStory ( {
151153 "label" : "Label pour liste déroulante" ,
You can’t perform that action at this time.
0 commit comments