import { fetchFromApi } from './api/haveibeenpwned' ; import type { Paste } from './api/haveibeenpwned/types' ; typedef Paste property { string } Id property { string } Source property { string } Title property { string } Date property { number } EmailCount param { string } email param options param { string } options . apiKey param { string } options . baseUrl param { string } options . userAgent returns { ( Promise < Paste [ ] > | Promise < null > ) } example export function pasteAccount ( email , options = { } ) { return fetchFromApi ( `/pasteaccount/${ encodeURIComponent ( email ) }` , { apiKey : options . apiKey , baseUrl : options . baseUrl , userAgent : options . userAgent , } ) as Promise < Paste [ ] | null > ; }