diff --git a/.changeset/quick-forks-rush.md b/.changeset/quick-forks-rush.md new file mode 100644 index 0000000..509fe76 --- /dev/null +++ b/.changeset/quick-forks-rush.md @@ -0,0 +1,5 @@ +--- +"mipd": patch +--- + +Always set loose autocomplete on `rdns` type. diff --git a/README.md b/README.md index c432783..164f68f 100644 --- a/README.md +++ b/README.md @@ -424,7 +424,7 @@ In some cases you might want to tune the global types (e.g. the `EIP1193Provider | Type | Default | Description | | ------------------- | -------------------------------------------------------------- | ---------------------- | | `provider` | `import('viem').EIP1193Provider` | The EIP-1193 Provider. | -| `rdns` | `'com.coinbase' | 'com.enkrypt' | 'io.metamask' | 'io.zerion'` | Deterministic identifier for the Provider in the form of an rDNS (Reverse Domain Name Notation) | +| `rdns` | `'com.coinbase' \| 'com.enkrypt' \| 'io.metamask' \| 'io.zerion'` | Deterministic identifier for the Provider in the form of an rDNS (Reverse Domain Name Notation) | Configuration options are customizable using [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html). Extend the `Register` interface either directly in your code or in a `d.ts` file (e.g. `eip6963.d.ts`): diff --git a/src/register.ts b/src/register.ts index 0f48134..943c016 100644 --- a/src/register.ts +++ b/src/register.ts @@ -28,9 +28,11 @@ export type ResolvedRegister = { ? provider : DefaultRegister['provider'] /** Reverse Domain Name Notation (rDNS) of the Wallet Provider. */ - rdns: Register extends { rdns: infer rdns extends string } - ? rdns - : DefaultRegister['rdns'] | (string & {}) // loose autocomplete + rdns: + | (Register extends { rdns: infer rdns extends string } + ? rdns + : DefaultRegister['rdns']) + | (string & {}) // loose autocomplete } export type EIP1193Provider = ResolvedRegister['provider']