-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: overloads * feat: overloads * feat: support optional properties * refactor: remove barrel files * chore: changeset Co-authored-by: 0xRaiden <[email protected]> * chore: cleanup * test(examples): update --------- Co-authored-by: 0xRaiden <[email protected]>
- Loading branch information
1 parent
43d3a9d
commit ba21aae
Showing
56 changed files
with
1,501 additions
and
1,453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"abitype": patch | ||
--- | ||
|
||
Removed internal barrel exports. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { type Abi } from 'abitype' | ||
import type { wagmiMintExampleAbi } from 'abitype/test' | ||
|
||
import type { | ||
ContractParameters, | ||
ContractReturnType, | ||
DeepPartial, | ||
} from './types.js' | ||
|
||
export declare function read< | ||
const abi extends Abi | readonly unknown[], // `readonly unknown[]` allows for non-const asserted types | ||
functionName extends string, | ||
const args extends readonly unknown[] | undefined, | ||
>( | ||
parameters: ReadParameters<abi, functionName, args>, | ||
): ReadReturnType<abi, functionName, args> | ||
|
||
export declare function readWagmiMintExample< | ||
functionName extends string, | ||
const args extends readonly unknown[] | undefined, | ||
>( | ||
parameters: Omit< | ||
ReadParameters<typeof wagmiMintExampleAbi, functionName, args>, | ||
'abi' | ||
>, | ||
): ReadReturnType<typeof wagmiMintExampleAbi, functionName, args> | ||
|
||
export declare function useRead< | ||
const abi extends Abi | readonly unknown[], // `readonly unknown[]` allows for non-const asserted types | ||
const functionName extends string, | ||
const args extends readonly unknown[] | undefined, | ||
>( | ||
parameters: DeepPartial<ReadParameters<abi, functionName, args>, 1>, | ||
): ReadReturnType<abi, functionName, args> | ||
|
||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
export type ReadParameters< | ||
abi extends Abi | readonly unknown[], | ||
functionName extends string, | ||
args extends readonly unknown[] | undefined = readonly unknown[] | undefined, | ||
> = { abi: abi } & ContractParameters<abi, functionName, 'pure' | 'view', args> | ||
|
||
export type ReadReturnType< | ||
abi extends Abi | readonly unknown[], | ||
functionName extends string, | ||
args extends readonly unknown[] | undefined, | ||
> = ContractReturnType<abi, functionName, args> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
ba21aae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
abitype – ./
abitype.vercel.app
abitype-wagmi-dev.vercel.app
abitype-git-main-wagmi-dev.vercel.app
abitype.dev