import { GNArray, GNHashtable } from "./../common/GNData"; /** * Local alias for an instantiable class. * * Re-declared here (rather than imported from * {@link entity/GNMetadata}) so this file does not have to depend * on the metadata module just for the alias — the underlying shape * is identical. */ type Constructor = { new (...args: any[]): T; }; /** * Static facade for the SDK's typed model (de)serialisation. * * Most application code does not need to touch this directly — the * generated `*Api` wrappers and request/response models call into * it internally after {@link GNNetwork.init} runs * {@link ConverterService.init}. Reach for this class manually * only for advanced workflows: custom DTOs, unit tests that round * trip a model through the SDK encoder, or hand-built operation * requests that produce non-standard response shapes. * * Lifecycle: * - {@link init} runs from {@link GNNetwork.init} and allocates * one shared {@link DataMemberFieldInfoTypeMapper} that backs * both the serializer and the deserializer (so the metadata * cache is shared between the two directions). * - There is no `dispose()`; the singleton lives for the lifetime * of the JS realm. */ export declare class ConverterService { private static serializeConverter; private static deserializeConverter; /** * Deserialises a {@link GNHashtable} into a typed model * instance. * * The class supplied as `cls` must use the GearN * `@*DataMember` decorator family so the SDK can resolve the * field-code mapping. Classes without decorators yield an * instance with no fields populated. * * @param gnHashtable Source container; usually obtained from * `OperationResponse.getParameters()`. * @param cls Target model class. * @returns Populated `T` instance, or `null` when * `gnHashtable` is `null`. */ static deserializeObject(gnHashtable: GNHashtable, cls: Constructor): any; /** * Deserialises a {@link GNArray} into an array of typed model * instances or primitives. * * For arrays of custom objects, `cls` should be the element * class decorated with the GearN metadata. For arrays of * primitives pass the matching wrapper (`String`, `Number`, * `Boolean`). */ static deserializeArray(gnArray: GNArray, cls: Constructor): any[]; /** * Serialises a typed model instance into a {@link GNHashtable} * suitable for the wire. * * The result is the same shape that the request build pipeline * inside `*OperationRequest.build()` produces — pass it to * `OperationRequest.setParameters` if you are constructing a * raw request manually. */ static serializeObject(obj: any, cls: Constructor): GNHashtable; /** * Serialises an array of typed model instances or primitives * into a {@link GNArray}. * * For arrays of custom objects, `cls` should be the element * class decorated with GearN metadata. */ static serializeArray(objLst: [], cls: Constructor): GNArray; /** * Allocates the shared serializer / deserializer singletons. * * Run once from {@link GNNetwork.init}. Calling it again * rebuilds the singletons from scratch, which is convenient in * test setups that need to reset the SDK between cases. */ static init(): void; } export {};