You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using @findify/sdk (version 2.2.3) it is not possible to use the included typescript types since most "Request" definitions depend on enums which are not exported in the distributed code.
importtype{Search}from'@findify/sdk/types/request'import{init}from'@findify/sdk'constclient=init({/* configuration */})constsearch=(query: Search.Params['q'])=>{constrequest: Search.Request={type: 'search',// Type '"search"' is not assignable to type 'Type.Search'.ts(2322)params: {q: query}}returnclient.send(request)}
We cannot import Type and use as replacement for the search string since it's an enum. We need to either able to import a js file with a separate type declaration for the enum OR type is specified with a const string instead for the different requests
The text was updated successfully, but these errors were encountered:
@simonlovesyou Hey, thanks for discovering this!
We've released new SDK version: @findify/[email protected] where you'll be able to import RequestType:
Thanks for the fix @timaramazanov ! I can see in my editor that typescript is satisfied, the added docs looks great too! Unfortunately I can't run our application and test it because we're blocked from upgrading by #796 :/
When using @findify/sdk (version 2.2.3) it is not possible to use the included typescript types since most "
Request
" definitions depend on enums which are not exported in the distributed code.We cannot import
Type
and use as replacement for thesearch
string since it's anenum
. We need to either able to import ajs
file with a separate type declaration for theenum
ORtype
is specified with aconst
string instead for the different requestsThe text was updated successfully, but these errors were encountered: