Skip to content

Commit

Permalink
docs: mark internal
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Nov 5, 2024
1 parent ab1401b commit 87a494f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
28 changes: 14 additions & 14 deletions scripts/docgen/render/apiFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,20 +355,20 @@ function resolveReturnTypeForOverloads(options: {
overloads: string[]
returnType: Data['returnType']
}) {
const { returnType } = options

// if (overloads.length && returnType) {
// const overload = overloads.find(
// (x) => dataLookup[x]?.returnType?.type !== returnType.type,
// )
// if (overload)
// return (
// dataLookup[overload]?.returnType?.type.replace(
// /(<.*>)$/, // remove type params from type
// '',
// ) ?? returnType.type
// )
// }
const { dataLookup, overloads, returnType } = options

if (overloads.length && returnType) {
const overload = overloads.find(
(x) => dataLookup[x]?.returnType?.type !== returnType.type,
)
if (overload)
return (
dataLookup[overload]?.returnType?.type.replace(
/(<.*>)$/, // remove type params from type
'',
) ?? returnType.type
)
}

return returnType?.type
}
Expand Down
4 changes: 4 additions & 0 deletions src/Abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type * as AbiItem_internal from './internal/abiItem.js'
/** Root type for an ABI. */
export type Abi = abitype.Abi

/** @internal */
export function format<const abi extends Abi>(abi: abi): format.ReturnType<abi>
/**
* Formats an {@link ox#Abi.Abi} into a **Human Readable ABI**.
Expand Down Expand Up @@ -42,6 +43,7 @@ export function format<const abi extends Abi>(abi: abi): format.ReturnType<abi>
* @returns The formatted ABI.
*/
export function format(abi: Abi | readonly unknown[]): readonly string[]
/** @internal */
export function format(abi: Abi | readonly unknown[]): readonly string[] {
return abitype.formatAbi(abi) as never
}
Expand All @@ -57,6 +59,7 @@ format.parseError = (error: unknown) =>
/* v8 ignore next */
error as format.ErrorType

/** @internal */
export function from<const abi extends Abi | readonly string[]>(
abi: abi &
(abi extends readonly string[]
Expand Down Expand Up @@ -141,6 +144,7 @@ export function from<const abi extends Abi | readonly string[]>(
* @returns The typed ABI.
*/
export function from(abi: Abi | readonly string[]): Abi
/** @internal */
export function from(abi: Abi | readonly string[]): Abi {
if (internal.isSignatures(abi)) return abitype.parseAbi(abi)
return abi
Expand Down

0 comments on commit 87a494f

Please sign in to comment.