@@ -192,27 +192,27 @@ describe('PortableText component with TypeGen types', () => {
192192 block : {
193193 normal : ( { value} ) => {
194194 expectTypeOf ( value . style ) . toEqualTypeOf < 'normal' | undefined > ( )
195- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
195+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
196196 return null
197197 } ,
198198 h2 : ( { value} ) => {
199199 expectTypeOf ( value . style ) . toEqualTypeOf < 'h2' | undefined > ( )
200- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
200+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
201201 return null
202202 } ,
203203 h3 : ( { value} ) => {
204204 expectTypeOf ( value . style ) . toEqualTypeOf < 'h3' | undefined > ( )
205- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
205+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
206206 return null
207207 } ,
208208 blockquote : ( { value} ) => {
209209 expectTypeOf ( value . style ) . toEqualTypeOf < 'blockquote' | undefined > ( )
210- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
210+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
211211 return null
212212 } ,
213213 lead : ( { value} ) => {
214214 expectTypeOf ( value . style ) . toEqualTypeOf < 'lead' | undefined > ( )
215- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
215+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
216216 return null
217217 } ,
218218 } ,
@@ -229,8 +229,8 @@ describe('PortableText component with TypeGen types', () => {
229229 type BlockType = Extract < PostContentBlock , { _type : 'block' } >
230230 type ListItemType = NonNullable < BlockType [ 'listItem' ] >
231231
232- expectTypeOf < 'checklist' > ( ) . toMatchTypeOf < ListItemType > ( )
233- expectTypeOf < 'steps' > ( ) . toMatchTypeOf < ListItemType > ( )
232+ expectTypeOf < 'checklist' > ( ) . toExtend < ListItemType > ( )
233+ expectTypeOf < 'steps' > ( ) . toExtend < ListItemType > ( )
234234
235235 // When passing TypeGen content to PortableText, `components.list` and
236236 // `components.listItem` should autocomplete with the block listItem union.
@@ -254,12 +254,12 @@ describe('PortableText component with TypeGen types', () => {
254254 listItem : {
255255 checklist : ( { value} ) => {
256256 expectTypeOf ( value . listItem ) . toEqualTypeOf < 'checklist' > ( )
257- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
257+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
258258 return null
259259 } ,
260260 steps : ( { value} ) => {
261261 expectTypeOf ( value . listItem ) . toEqualTypeOf < 'steps' > ( )
262- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
262+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
263263 return null
264264 } ,
265265 legacyList : ( { value} ) => {
@@ -346,7 +346,7 @@ describe('PortableText component with TypeGen types', () => {
346346 block : {
347347 normal : ( { value} ) => {
348348 expectTypeOf ( value . style ) . toEqualTypeOf < 'normal' | undefined > ( )
349- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
349+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
350350 return null
351351 } ,
352352 h2 : ( { value} ) => {
@@ -472,7 +472,7 @@ describe('InferStrictComponents utility type', () => {
472472 // Default block styles are handled by default, so only `lead` is required.
473473 lead : ( { value} ) => {
474474 expectTypeOf ( value . style ) . toEqualTypeOf < 'lead' | undefined > ( )
475- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
475+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
476476 return null
477477 } ,
478478 } ,
@@ -758,7 +758,7 @@ describe('InferStrictComponents utility type', () => {
758758 block : {
759759 normal : ( { value} ) => {
760760 expectTypeOf ( value . style ) . toEqualTypeOf < 'normal' | undefined > ( )
761- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
761+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
762762 return null
763763 } ,
764764 // @ts -expect-error `h1` is not in the content type union
@@ -790,29 +790,29 @@ describe('InferValue utility type', () => {
790790 type PortableTextItem = PortableTextValue [ number ]
791791 type TypeNames = PortableTextItem [ '_type' ]
792792
793- expectTypeOf < 'block' > ( ) . toMatchTypeOf < TypeNames > ( )
794- expectTypeOf < 'image' > ( ) . toMatchTypeOf < TypeNames > ( )
795- expectTypeOf < 'quote' > ( ) . toMatchTypeOf < TypeNames > ( )
796- expectTypeOf < 'code' > ( ) . toMatchTypeOf < TypeNames > ( )
797- expectTypeOf < 'featuredPost' > ( ) . toMatchTypeOf < TypeNames > ( )
793+ expectTypeOf < 'block' > ( ) . toExtend < TypeNames > ( )
794+ expectTypeOf < 'image' > ( ) . toExtend < TypeNames > ( )
795+ expectTypeOf < 'quote' > ( ) . toExtend < TypeNames > ( )
796+ expectTypeOf < 'code' > ( ) . toExtend < TypeNames > ( )
797+ expectTypeOf < 'featuredPost' > ( ) . toExtend < TypeNames > ( )
798798
799799 type CustomTypes = Exclude < PortableTextItem , { _type : 'block' } >
800800 expectTypeOf < Extract < CustomTypes , { _type : 'featuredPost' } > > ( ) . toHaveProperty ( 'post' )
801801
802802 type BlockType = Extract < PortableTextItem , { _type : 'block' } >
803803 type StyleType = NonNullable < BlockType [ 'style' ] >
804- expectTypeOf < 'normal' > ( ) . toMatchTypeOf < StyleType > ( )
805- expectTypeOf < 'lead' > ( ) . toMatchTypeOf < StyleType > ( )
804+ expectTypeOf < 'normal' > ( ) . toExtend < StyleType > ( )
805+ expectTypeOf < 'lead' > ( ) . toExtend < StyleType > ( )
806806
807807 type ListItemType = NonNullable < BlockType [ 'listItem' ] >
808- expectTypeOf < 'checklist' > ( ) . toMatchTypeOf < ListItemType > ( )
809- expectTypeOf < 'steps' > ( ) . toMatchTypeOf < ListItemType > ( )
808+ expectTypeOf < 'checklist' > ( ) . toExtend < ListItemType > ( )
809+ expectTypeOf < 'steps' > ( ) . toExtend < ListItemType > ( )
810810
811811 type MarkDefs = NonNullable < BlockType [ 'markDefs' ] >
812812 type MarkType = MarkDefs [ number ]
813813 type MarkTypeNames = MarkType [ '_type' ]
814- expectTypeOf < 'link' > ( ) . toMatchTypeOf < MarkTypeNames > ( )
815- expectTypeOf < 'glossaryTerm' > ( ) . toMatchTypeOf < MarkTypeNames > ( )
814+ expectTypeOf < 'link' > ( ) . toExtend < MarkTypeNames > ( )
815+ expectTypeOf < 'glossaryTerm' > ( ) . toExtend < MarkTypeNames > ( )
816816 } )
817817
818818 test ( 'works as input to InferStrictComponents and PortableText' , ( ) => {
@@ -867,7 +867,7 @@ describe('InferValue utility type', () => {
867867 block : {
868868 lead : ( { value} ) => {
869869 expectTypeOf ( value . style ) . toEqualTypeOf < 'lead' | undefined > ( )
870- expectTypeOf ( value ) . toMatchTypeOf < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
870+ expectTypeOf ( value ) . toExtend < PortableTextComponentProps < BlockType > [ 'value' ] > ( )
871871 return null
872872 } ,
873873 } ,
0 commit comments