UNPKG

@requestnetwork/multi-format

Version:
44 lines 1.6 kB
import { MultiFormatTypes } from '@requestnetwork/types'; import { SerializableMultiFormat } from './serializable-multi-format'; /** * Class to group multi-formats to make the code more maintainable (see index.ts) */ export declare class MultiFormatGroup { /** All the format in the group */ private availableFormats; /** * Creates an instance of MultiFormatGroup. * * @param formats all the formats of this group */ constructor(formats: SerializableMultiFormat[]); /** * Checks if an object is a deserialized multi-format of this group * * @param data object to check * @returns true if the data is a deserialized multi-format of this group */ isSerializableObject(data: MultiFormatTypes.IMultiFormatDeserialized): boolean; /** * Checks if a string is a serialized multi-format of this group * * @param formatted string to check * @returns true if the data is a serialized multi-format */ isDeserializableString(formatted: string): boolean; /** * Serializes a deserialized multi-format of this group * * @param data object to serialize * @returns the data as a serialized multi-format */ serialize(data: MultiFormatTypes.IMultiFormatDeserialized): string; /** * Deserialized a multi-format string of this group * * @param data string to deserialized * @returns the data as a deserialized multi-format */ deserialize(formatted: string): MultiFormatTypes.IMultiFormatDeserialized; } //# sourceMappingURL=multi-format-group.d.ts.map