From 3e44d5bfdfebd581f791dcda76580b99b852fc1f Mon Sep 17 00:00:00 2001 From: Halil Durak Date: Fri, 21 Nov 2025 14:22:52 +0300 Subject: [PATCH] move `Blob` out of `files/` + provide subclasses of `Blob` in `_type` --- src/browser/webapi/{file => }/Blob.zig | 6 ++++++ 1 file changed, 6 insertions(+) rename src/browser/webapi/{file => }/Blob.zig (99%) diff --git a/src/browser/webapi/file/Blob.zig b/src/browser/webapi/Blob.zig similarity index 99% rename from src/browser/webapi/file/Blob.zig rename to src/browser/webapi/Blob.zig index c4e38725..5e2f2e9d 100644 --- a/src/browser/webapi/file/Blob.zig +++ b/src/browser/webapi/Blob.zig @@ -26,6 +26,7 @@ const Page = @import("../../Page.zig"); /// https://developer.mozilla.org/en-US/docs/Web/API/Blob const Blob = @This(); +_type: Type, /// Immutable slice of blob. /// Note that another blob may hold a pointer/slice to this, /// so its better to leave the deallocation of it to arena allocator. @@ -33,6 +34,11 @@ slice: []const u8, /// MIME attached to blob. Can be an empty string. mime: []const u8, +const Type = union(enum) { + generic, + file: *@import("File.zig"), +}; + const InitOptions = struct { /// MIME type. type: []const u8 = "",