// Type shims for @ocap/* / @arcblock/* 1.30.x CBOR-only subpath entries.
//
// These packages ship runtime + `.d.mts` type files under the package.json
// `exports` map. tsc under `moduleResolution: node` cannot resolve `.d.mts`
// through the exports map, producing:
//   error TS2307: Cannot find module '@arcblock/did-util/cbor' or its
//     corresponding type declarations.
//
// Switching moduleResolution to `bundler`/`node16` would fix resolution but
// require matching `module: esnext`, which changes the emitted JS format for
// api/dist runtime. Not worth the blast radius.
//
// Instead: declare loose types here so tsc is satisfied. Runtime resolution
// still uses the real packages via Node/esbuild's own module loader (they
// handle .cjs + exports map correctly).

declare module '@arcblock/did-util/cbor' {
  // biome-ignore lint/suspicious/noExplicitAny: loose shim; real types live in .d.mts
  type AnyFn = (...args: any[]) => any;
  export const toAssetAddress: AnyFn;
  export const toDelegateAddress: AnyFn;
  export const toFactoryAddress: AnyFn;
  export const toItxAddress: AnyFn;
  export const toRollupAddress: AnyFn;
  export const toStakeAddress: AnyFn;
  export const toTokenAddress: AnyFn;
  export const toTokenFactoryAddress: AnyFn;
}

declare module '@ocap/asset/mint/client' {
  // biome-ignore lint/suspicious/noExplicitAny: loose shim; real types live in .d.mts
  type AnyFn = (...args: any[]) => any;
  export const formatFactoryState: AnyFn;
  export const preMintFromFactory: AnyFn;
}
