filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 76 forks source link

"fromSources" with typescript only accept string array, how to add a custom source? #494

Open jdupont22 opened 1 year ago

jdupont22 commented 1 year ago

I'm using typescript, but the 'fromSources' definition is the following

` /**

How can I put a custom source, that is defined as an object?

Expected Behavior

Provide a Typescript type for the 'custom source' and update 'fromSources' to accept both string and this new type.

Current Behavior

Only string accepted, i can't put my custom source with Typescript

Possible Solution

Steps to Reproduce (for bugs)

I try to use the exemple in the Filestack tutorial for custom source, with Typescript

Additional Screenshots

Capture d’écran 2022-12-16 à 15 06 20

Context

Your Environment

-- EDIT -- When I force the type to "string" with "myCustomSource as unknown as string" it's working. But, it's clearly a workaround, waiting to the "fromSources" type to be enhanced.