import type { Nullable, Option } from '@metaplex-foundation/umi-options'; import type { PublicKey, PublicKeyInput } from '@metaplex-foundation/umi-public-keys'; import type { ArraySerializerOptions, BoolSerializerOptions, BytesSerializerOptions, DataEnumSerializerOptions, DataEnumToSerializerTuple, MapSerializerOptions, NullableSerializerOptions, NumberSerializerOptions, OptionSerializerOptions, PublicKeySerializerOptions, ScalarEnumSerializerOptions, Serializer, SetSerializerOptions, SingleByteNumberSerializerOptions, StringSerializerOptions, StructSerializerOptions, StructToSerializerTuple, TupleSerializerOptions, UnitSerializerOptions, WrapInSerializer } from '@metaplex-foundation/umi-serializers'; import { DataEnum, ScalarEnum } from './Enums'; /** * Defines the interface for a set of serializers * that can be used to serialize/deserialize any Serde types. * * @category Context and Interfaces * @deprecated This interface is deprecated. * You can now directly use `@metaplex-foundation/umi/serializers` instead. */ export interface SerializerInterface { /** * Creates a serializer for a tuple-like array. * * @param items - The serializers to use for each item in the tuple. * @param options - A set of options for the serializer. */ tuple: (items: WrapInSerializer<[...T], [...U]>, options?: TupleSerializerOptions) => Serializer; /** * Creates a serializer for an array of items. * * @param item - The serializer to use for the array's items. * @param options - A set of options for the serializer. */ array: (item: Serializer, options?: ArraySerializerOptions) => Serializer; /** * Creates a serializer for a map. * * @param key - The serializer to use for the map's keys. * @param value - The serializer to use for the map's values. * @param options - A set of options for the serializer. */ map: (key: Serializer, value: Serializer, options?: MapSerializerOptions) => Serializer, Map>; /** * Creates a serializer for a set. * * @param item - The serializer to use for the set's items. * @param options - A set of options for the serializer. */ set: (item: Serializer, options?: SetSerializerOptions) => Serializer, Set>; /** * Creates a serializer for an optional value using the {@link Option} type. * * @param item - The serializer to use for the value that may be present. * @param options - A set of options for the serializer. */ option: (item: Serializer, options?: OptionSerializerOptions) => Serializer | Nullable, Option>; /** * Creates a serializer for an optional value using `null` as the `None` value. * * @param item - The serializer to use for the value that may be present. * @param options - A set of options for the serializer. */ nullable: (item: Serializer, options?: NullableSerializerOptions) => Serializer, Nullable>; /** * Creates a serializer for a custom object. * * @param fields - The name and serializer of each field. * @param options - A set of options for the serializer. */ struct: (fields: StructToSerializerTuple, options?: StructSerializerOptions) => Serializer; /** * Creates a scalar enum serializer. * * @param constructor - The constructor of the scalar enum. * @param options - A set of options for the serializer. */ enum(constructor: ScalarEnum & {}, options?: ScalarEnumSerializerOptions): Serializer; /** * Creates a data enum serializer. * * @param variants - The variant serializers of the data enum. * @param options - A set of options for the serializer. */ dataEnum(variants: DataEnumToSerializerTuple, options?: DataEnumSerializerOptions): Serializer; /** * Creates a string serializer. * * @param options - A set of options for the serializer. */ string: (options?: StringSerializerOptions) => Serializer; /** * Creates a boolean serializer. * * @param options - A set of options for the serializer. */ bool: (options?: BoolSerializerOptions) => Serializer; /** * Creates a void serializer. * * @param options - A set of options for the serializer. */ unit: (options?: UnitSerializerOptions) => Serializer; /** * Creates a serializer for 1-byte unsigned integers. * * @param options - A set of options for the serializer. */ u8: (options?: SingleByteNumberSerializerOptions) => Serializer; /** * Creates a serializer for 2-bytes unsigned integers. * * @param options - A set of options for the serializer. */ u16: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 4-bytes unsigned integers. * * @param options - A set of options for the serializer. */ u32: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 8-bytes unsigned integers. * * @param options - A set of options for the serializer. */ u64: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 16-bytes unsigned integers. * * @param options - A set of options for the serializer. */ u128: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 1-byte signed integers. * * @param options - A set of options for the serializer. */ i8: (options?: SingleByteNumberSerializerOptions) => Serializer; /** * Creates a serializer for 2-bytes signed integers. * * @param options - A set of options for the serializer. */ i16: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 4-bytes signed integers. * * @param options - A set of options for the serializer. */ i32: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 8-bytes signed integers. * * @param options - A set of options for the serializer. */ i64: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 16-bytes signed integers. * * @param options - A set of options for the serializer. */ i128: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 4-bytes floating point numbers. * * @param options - A set of options for the serializer. */ f32: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer for 8-bytes floating point numbers. * * @param options - A set of options for the serializer. */ f64: (options?: NumberSerializerOptions) => Serializer; /** * Creates a serializer that passes the buffer as-is. * * @param options - A set of options for the serializer. */ bytes: (options?: BytesSerializerOptions) => Serializer; /** * Creates a serializer for 32-bytes public keys. * * @param options - A set of options for the serializer. */ publicKey: (options?: PublicKeySerializerOptions) => Serializer; } /** * An implementation of the {@link SerializerInterface} that throws an error when called. * @category Serializers */ export declare function createNullSerializer(): SerializerInterface;