jshemas / openGraphScraper

Node.js scraper service for Open Graph Info and More!
MIT License
643 stars 102 forks source link

It is better to export SuccessResult and ErrorResult types #196

Closed ageofrage closed 9 months ago

ageofrage commented 9 months ago

I much love this library. But I have small request.

Is your feature request related to a problem? Please describe. I am developing with TS. I want to use SuccessResult and ErrorResult directly. For example, when Ogs catches an error, I want to typedef the argument to ErrorResult.

Describe the solution you'd like Just export SuccessResult and ErrorResult type.

Describe alternatives you've considered

type OgsResult = ReturnType<typeof ogs> extends Promise<infer T> ? T : never;

But this solution cannot extract single SuccessResult or ErrorResult type.

Additional context Add any other context or screenshots about the feature request here.

jshemas commented 9 months ago

Good idea. Added in open-graph-scraper@6.3.0

ageofrage commented 9 months ago

Thanks!☺️