From 7e5daedc8ce61166a89611664a42f0eed20a139f Mon Sep 17 00:00:00 2001 From: Karl Seguin Date: Wed, 9 Jul 2025 18:10:23 +0800 Subject: [PATCH] more PerformnaceObserver placeholders --- src/browser/dom/performance_observer.zig | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/browser/dom/performance_observer.zig b/src/browser/dom/performance_observer.zig index 69ce1f11..bc290086 100644 --- a/src/browser/dom/performance_observer.zig +++ b/src/browser/dom/performance_observer.zig @@ -17,10 +17,39 @@ // along with this program. If not, see . const std = @import("std"); +const Env = @import("../env.zig").Env; + +const PerformanceEntry = @import("performance.zig").PerformanceEntry; // https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver pub const PerformanceObserver = struct { pub const _supportedEntryTypes = [0][]const u8{}; + + pub fn constructor(cbk: Env.Function) PerformanceObserver { + _ = cbk; + return .{}; + } + + pub fn _observe(self: *const PerformanceObserver, options_: ?Options) void { + _ = self; + _ = options_; + return; + } + + pub fn _disconnect(self: *PerformanceObserver) void { + _ = self; + } + + pub fn _takeRecords(_: *const PerformanceObserver) []PerformanceEntry { + return &[_]PerformanceEntry{}; + } +}; + +const Options = struct { + buffered: ?bool = null, + durationThreshold: ?f64 = null, + entryTypes: ?[]const []const u8 = null, + type: ?[]const u8 = null, }; const testing = @import("../../testing.zig");