It's supposed to work through declaration merging, however, with the base Config being a type and the example extension being an interface instead of a merge a Duplicate identifier 'Config'. ts(2300) error happens. The error can be seen in starknet.js for all TypeScript v5 versions with the latest v5.5 having stricter behaviour and preventing the declaration file build step. The error doesn't stop type inference from working (as mentioned in the possibly related issue https://github.com/starknet-io/starknet.js/issues/1192#issuecomment-2262542921), it does stop ResolvedConfig from having the desired result (stackblitz example).
Changing the base Config to an interface (export interface Config<OptionT = any, ResultT = any, ErrorT = any> {}) resolves the error and the ResolvedConfig result.
There is an issue with the configuration as documented in the README.
It's supposed to work through declaration merging, however, with the base
Config
being atype
and the example extension being aninterface
instead of a merge aDuplicate identifier 'Config'. ts(2300)
error happens. The error can be seen in starknet.js for all TypeScriptv5
versions with the latestv5.5
having stricter behaviour and preventing the declaration file build step. The error doesn't stop type inference from working (as mentioned in the possibly related issue https://github.com/starknet-io/starknet.js/issues/1192#issuecomment-2262542921), it does stopResolvedConfig
from having the desired result (stackblitz example).Changing the base Config to an interface (
export interface Config<OptionT = any, ResultT = any, ErrorT = any> {}
) resolves the error and theResolvedConfig
result.