/** * ------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. * See License in the project root for license information. * ------------------------------------------------------------------------------------------- */ import type { SerializationWriter } from "./serializationWriter.js"; import type { SerializationWriterFactory } from "./serializationWriterFactory.js"; import type { Parsable } from "./parsable.js"; import type { ModelSerializerFunction } from "./serializationFunctionTypes.js"; /** This factory holds a list of all the registered factories for the various types of nodes. */ export declare class SerializationWriterFactoryRegistry implements SerializationWriterFactory { /** * The content type for JSON data. */ private readonly jsonContentType; getValidContentType(): string; /** List of factories that are registered by content type. */ contentTypeAssociatedFactories: Map; getSerializationWriter(contentType: string): SerializationWriter; /** * Registers the default serializer to the registry. * @param type the class of the factory to be registered. */ registerDefaultSerializer(type: new () => SerializationWriterFactory): void; /** * Serializes a parsable object into a buffer * @param value the value to serialize * @param serializationFunction the serialization function for the model type * @returns a buffer containing the serialized value */ serializeToJson(value: T, serializationFunction: ModelSerializerFunction): ArrayBuffer; /** * Serializes a parsable object into a string representation * @param value the value to serialize * @param serializationFunction the serialization function for the model type * @returns a string representing the serialized value */ serializeToJsonAsString(value: T, serializationFunction: ModelSerializerFunction): string; /** * Serializes a collection of parsable objects into a buffer * @param values the value to serialize * @param serializationFunction the serialization function for the model type * @returns a string representing the serialized value */ serializeCollectionToJson(values: T[], serializationFunction: ModelSerializerFunction): ArrayBuffer; /** * Serializes a collection of parsable objects into a string representation * @param values the value to serialize * @param serializationFunction the serialization function for the model type * @returns a string representing the serialized value */ serializeCollectionToJsonAsString(values: T[], serializationFunction: ModelSerializerFunction): string; /** * Serializes a parsable object into a buffer * @param contentType the content type to serialize to * @param value the value to serialize * @param serializationFunction the serialization function for the model type * @returns a buffer containing the serialized value */ serialize(contentType: string, value: T, serializationFunction: ModelSerializerFunction): ArrayBuffer; /** * Serializes a parsable object into a string representation * @param contentType the content type to serialize to * @param value the value to serialize * @param serializationFunction the serialization function for the model type * @returns a string representing the serialized value */ serializeToString(contentType: string, value: T, serializationFunction: ModelSerializerFunction): string; /** * Serializes a collection of parsable objects into a buffer * @param contentType the content type to serialize to * @param values the value to serialize * @param serializationFunction the serialization function for the model type * @returns a string representing the serialized value */ serializeCollection(contentType: string, values: T[], serializationFunction: ModelSerializerFunction): ArrayBuffer; /** * Serializes a collection of parsable objects into a string representation * @param contentType the content type to serialize to * @param values the value to serialize * @param serializationFunction the serialization function for the model type * @returns a string representing the serialized value */ serializeCollectionToString(contentType: string, values: T[], serializationFunction: ModelSerializerFunction): string; /** * Gets a serialization writer for a given content type * @param contentType the content type to serialize to * @param value the value to serialize * @param serializationFunction the serialization function for the model type * @returns the serialization writer for the given content type */ getSerializationFactoryWriter(contentType: string, value: unknown, serializationFunction: unknown): SerializationWriter; /** * Gets a string value from a buffer * @param buffer the buffer to get a string from * @returns the string representation of the buffer */ getStringValueFromBuffer(buffer: ArrayBuffer): string; } //# sourceMappingURL=serializationWriterFactoryRegistry.d.ts.map