import { fetchFromApi } from './api/haveibeenpwned' ; import type { Breach } from './api/haveibeenpwned/types' ; typedef Breach property { string } Name property { string } Title property { string } Domain property { string } BreachDate property { string } AddedDate property { string } ModifiedDate property { number } PwnCount property { string } Description property { string } LogoPath property { string [ ] } DataClasses property { boolean } IsVerified property { boolean } IsFabricated property { boolean } IsSensitive property { boolean } IsRetired property { boolean } IsSpamList param { string } breachName param options param { string } options . baseUrl param { string } options . userAgent returns { ( Promise < Breach > | Promise < null > ) } example export function breach ( breachName , options = { } ) { return fetchFromApi ( `/breach/${ encodeURIComponent ( breachName ) }` , options ) as Promise < Breach | null > ; }