 FieldTypes } from &quot;@pnp/sp/fields/types&quot;;
import &quot;@pnp/sp/webs&quot;;
import &quot;@pnp/sp/lists&quot;;
import &quot;@pnp/sp/fields&quot;;

const sp = spfi(...);

// create a new image field called 'My Field' in web.
const field: IFieldAddResult = await sp.web.fields.addImageField(&quot;My Field&quot;);
// create a new image field called 'My Field' in the list 'My List'.
const field2: IFieldAddResult = await sp.web.lists.getByTitle(&quot;My List&quot;).fields.addImageField(&quot;My Field&quo