Skip to content

Commit f760e8f

Browse files
committed
feat: make ImageSerializer internal
1 parent 34cad33 commit f760e8f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/SnapshotTesting/Plugins/ImageSerializer.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import AppKit
1313
/// The `ImageSerializer` class leverages plugins that conform to the `ImageSerialization` protocol to encode and decode images in different formats.
1414
/// It automatically retrieves all available image serialization plugins from the `PluginRegistry` and uses them based on the specified `ImageSerializationFormat`.
1515
/// If no plugin is found for the requested format, it defaults to using PNG encoding/decoding.
16-
public class ImageSerializer {
16+
class ImageSerializer {
1717

1818
/// A collection of plugins that conform to the `ImageSerialization` protocol.
19-
let plugins: [ImageSerialization]
19+
private let plugins: [ImageSerialization]
2020

21-
public init() {
21+
init() {
2222
self.plugins = PluginRegistry.allPlugins()
2323
}
2424

@@ -32,7 +32,7 @@ public class ImageSerializer {
3232
/// - image: The `SnapImage` to encode.
3333
/// - imageFormat: The format in which to encode the image.
3434
/// - Returns: The encoded image data, or `nil` if encoding fails.
35-
public func encodeImage(_ image: SnapImage, imageFormat: ImageSerializationFormat = .defaultValue) -> Data? {
35+
func encodeImage(_ image: SnapImage, imageFormat: ImageSerializationFormat = .defaultValue) -> Data? {
3636
for plugin in self.plugins {
3737
if type(of: plugin).imageFormat == imageFormat {
3838
return plugin.encodeImage(image)
@@ -52,7 +52,7 @@ public class ImageSerializer {
5252
/// - data: The image data to decode.
5353
/// - imageFormat: The format in which the image data is encoded.
5454
/// - Returns: The decoded `SnapImage`, or `nil` if decoding fails.
55-
public func decodeImage(_ data: Data, imageFormat: ImageSerializationFormat = .defaultValue) -> SnapImage? {
55+
func decodeImage(_ data: Data, imageFormat: ImageSerializationFormat = .defaultValue) -> SnapImage? {
5656
for plugin in self.plugins {
5757
if type(of: plugin).imageFormat == imageFormat {
5858
return plugin.decodeImage(data)

0 commit comments

Comments
 (0)