/** * Serializer interface for primitive, array and struct/custom object types * @category Serialization */ export interface Serializer { serialize: (obj: any, meta?: any) => any; deserialize: (data: any, obj: any, meta?: any) => any; isType: (obj: any) => boolean; priority?: number; type?: string; } /** * Serialization class with static methods for serializing and deserializing objects. * Properties and classes can be marked serializable by adding {@link serialize} and {@link serializable} decorators. * @category Serialization */ export declare class Serialization { static TypeMap: WeakMap; static SerializableClasses: Map; /** * Serializers for primitive, array and struct/custom object types */ static Serializers: Serializer[]; static GetSerializer(obj: any): Serializer | undefined; static RegisterSerializer(...serializers: Serializer[]): void; static UnregisterSerializer(...serializers: Serializer[]): void; /** * Serialize an object * @param obj - object to serialize * @param meta - Optional object to store common meta-data/resources across the serialization process of multiple objects * @param isThis - true if called from inside the serialization function, like custom {@link IJSONSerializable.toJSON}. */ static Serialize(obj: any, meta?: Record>, isThis?: boolean): any; /** * Deserialize an object * @param data - data to deserialize * @param obj - current object that's set. If of the same class/type the data is deserialized into that instead of creating new objects. * @param meta - Optional object to retrieve common meta-data/resources across the deserialization process of multiple objects. Objects in meta must be class instances, not js objects. (like Material, Texture, Object3D etc) * @param isThis - true if called from inside the deserialization function, like custom {@link IJSONSerializable.fromJSON} */ static Deserialize(data: any, obj: any, meta?: Record, isThis?: boolean): any; } //# sourceMappingURL=serialization.d.ts.map