MetaMask / snaps

Extend the functionality of MetaMask using Snaps
https://metamask.io/snaps/
Other
724 stars 557 forks source link

fix: specify explicit type to prevent type issues at build #2410

Closed FrederikBolding closed 4 months ago

FrederikBolding commented 4 months ago

Our current declaration for getTextChildren are autogenerated since no explicit type is declared, however the generated type causes type errors since it directly reference the runtime:

export declare function getTextChildren(value: string): (string | import("@metamask/snaps-sdk/jsx-runtime").StandardFormattingElement | import("@metamask/snaps-sdk/jsx-runtime").SnapElement<import("@metamask/snaps-sdk/jsx-runtime").LinkProps, "Link"> | null)[];

We can work around this problem by specifying an explicit type declaration for the function.