import type BN from 'bn.js'; import type { Hash } from '../interfaces/runtime'; import type { Registry } from './registry'; export declare type AnyJson = string | number | boolean | null | undefined | AnyJson[] | { [index: string]: AnyJson; }; export declare type AnyFunction = (...args: any[]) => any; export declare type AnyNumber = BN | BigInt | Uint8Array | number | string; export declare type AnyString = string | string; export declare type AnyTuple = Codec[]; export declare type AnyU8a = Uint8Array | number[] | string; export declare type ArrayElementType> = T extends ReadonlyArray ? ElementType : never; export declare type BareOpts = boolean | Record; export declare type Callback = E extends Codec ? (result: T, extra: E) => void | Promise : (result: T) => void | Promise; export declare type CodecTo = 'toHex' | 'toJSON' | 'toString' | 'toU8a'; /** * @name Codec * @description * The base Codec interface. All types implement the interface provided here. Additionally * implementors can add their own specific interfaces and helpers with getters and functions. * The Codec Base is however required for operating as an encoding/decoding layer */ export interface Codec { /** * @description The length of the value when encoded as a Uint8Array */ readonly encodedLength: number; /** * @description Returns a hash of the value */ readonly hash: Hash; /** * @description Checks if the value is an empty value */ readonly isEmpty: boolean; /** * @description The registry associated with this object */ readonly registry: Registry; /** * @description The block at which this value was retrieved/created (set to non-empty when retrieved from storage) */ createdAtHash?: Hash; /** * @description Compares the value of the input to see if there is a match */ eq(other?: unknown): boolean; /** * @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation */ toHex(isLe?: boolean): string; /** * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information */ toHuman(isExtended?: boolean): AnyJson; /** * @description Converts the Object to JSON, typically used for RPC transfers */ toJSON(): AnyJson; /** * @description Returns the base runtime type name for this instance */ toRawType(): string; /** * @description Returns the string representation of the value */ toString(): string; /** * @description Encodes the value as a Uint8Array as per the SCALE specifications * @param isBare true when the value has none of the type-specific prefixes (internal) */ toU8a(isBare?: BareOpts): Uint8Array; } export declare type CodecArg = Codec | BigInt | BN | boolean | string | Uint8Array | boolean | number | string | undefined | CodecArgArray | { [index: string]: CodecArg; }; interface CodecArgArray extends Array { } export interface Constructor { new (registry: Registry, ...value: any[]): T; } export declare type ConstructorDef = Record>; export declare type ArgsDef = Record; export {};