Open tommedema opened 3 years ago
@tommedema, I haven't found any so I'm going to see what the API surface area looks like and try writing some if it's not too big. Feel free to tag me here if you want to check on them.
Our team is also looking for the official typings for this. Thanks.
@randalvance @tommedema I'm no longer working on the Typings for this - the API was going to make it hard and the benefit to me wasn't that big. Good luck!
@randalvance any update on this?
at bubbles we worked around this by creating a custom typings definition tailored to our use case:
typings/clearbit/index.d.ts
declare function clearbit(apiKey: string): Clearbit.IClearbitClient
/**
* @see https://stackoverflow.com/a/33392782/45974
*/
declare namespace Clearbit {
interface IPerson {
setVersion: (version: '2019-12-19') => void,
}
interface IEnrichment {
find: ({email: string, stream: boolean}) => Promise<Clearbit.IEnrichmentResult>
}
interface IEnrichmentResult {
person: object | null
company: object | null
}
interface IClearbitClient {
Person: Clearbit.IPerson,
Enrichment: Clearbit.IEnrichment
}
}
export = clearbit
Would love to see some official typings from the Clearbit team, especially since the docs have this note about Person and Company:
No attributes are guaranteed to be present
The difference between no key defined, null, empty string, and empty array can be really important! I could do a few responses and guess at what the shape and assurances are of data availability, but having something more dependable would be great.
Are there typescript typings?