import { InternalHologram } from "./hologram"; /** * The type of an array item. */ export type ItemType = T extends (infer U)[] ? U : undefined; /** * The type of an object entry. */ export type EntryType = T extends { [key: string]: any; } ? T[K] : undefined; /** * The type of a valid Bitnode value. */ export type ValueType = undefined | string | number | boolean | ValueIDType | ValueBytesType | ValueHologramType | ValueMapType | ValueTupleType | ValueListType; /** * The ID type. */ export type ValueIDType = string; /** * The bytes type. */ export type ValueBytesType = ArrayBuffer; /** * The hologram type. */ export type ValueHologramType = InternalHologram; /** * The map type. */ export type ValueMapType = { [_: string]: ValueType; }; /** * The tuple type. */ export type ValueTupleType = { [_: number]: ValueType; }; /** * The list type. */ export type ValueListType = ValueType[]; /** * Type of the asynchronous hologram retrieval callback. */ export type RetrieveCBAsync = (id: string) => Promise; /** * Type of the synchronous hologram retrieval callback. */ export type RetrieveCBSync = (id: string) => InternalHologram; /** * Type of the asynchronous hologram deletion callback. */ export type DeleteCBAsync = (id: string) => Promise;