I try to follow the doc to add a layer as custom source for the Search widget: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources
But I get:

The full error is -
Type '{ layer: FeatureLayer; }' is not assignable to type 'SearchSourceProperties'.
Object literal may only specify known properties, and 'layer' does not exist in type 'SearchSourceProperties'.ts(2322)
How should I add a FeatureLayer as source to the Search widget? I am using 4.25.5 ES module version.