import type { Abi } from '../abi.js'; import type { Error, Filter } from '../types.js'; import type { Signatures } from './types/signatures.js'; import type { ParseStructs } from './types/structs.js'; import type { ParseSignature } from './types/utils.js'; /** * Parses human-readable ABI into JSON {@link Abi} * * @param signatures - Human-readable ABI * @returns Parsed {@link Abi} * * @deprecated Human-readable ABI utilities are moving to Ox. * Install [`ox`](https://oxlib.sh) and use [`Abi.from.ReturnType`](https://oxlib.sh/api/Abi/from#return-type) instead: * `import { Abi } from 'ox'`. * * @example * type Result = ParseAbi< * // ^? type Result = readonly [{ name: "balanceOf"; type: "function"; stateMutability:... * [ * 'function balanceOf(address owner) view returns (uint256)', * 'event Transfer(address indexed from, address indexed to, uint256 amount)', * ] * > */ export type ParseAbi = string[] extends signatures ? Abi : signatures extends readonly string[] ? signatures extends Signatures ? ParseStructs extends infer structs ? { [key in keyof signatures]: signatures[key] extends string ? ParseSignature : never; } extends infer mapped extends readonly unknown[] ? Filter extends infer result ? result extends readonly [] ? never : result : never : never : never : never : never; /** * Parses human-readable ABI into JSON {@link Abi} * * @param signatures - Human-Readable ABI * @returns Parsed {@link Abi} * * @deprecated Human-readable ABI utilities are moving to Ox. * Install [`ox`](https://oxlib.sh) and use [`Abi.from`](https://oxlib.sh/api/Abi/from) instead: * `import { Abi } from 'ox'`. * * @example * const abi = parseAbi([ * // ^? const abi: readonly [{ name: "balanceOf"; type: "function"; stateMutability:... * 'function balanceOf(address owner) view returns (uint256)', * 'event Transfer(address indexed from, address indexed to, uint256 amount)', * ]) */ export declare function parseAbi(signatures: signatures['length'] extends 0 ? Error<'At least one signature required'> : Signatures extends signatures ? signatures : Signatures): ParseAbi; //# sourceMappingURL=parseAbi.d.ts.map