Skip to content

Commit 7e5daed

Browse files
committed
more PerformnaceObserver placeholders
1 parent bdc49a6 commit 7e5daed

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/browser/dom/performance_observer.zig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,39 @@
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

1919
const std = @import("std");
20+
const Env = @import("../env.zig").Env;
21+
22+
const PerformanceEntry = @import("performance.zig").PerformanceEntry;
2023

2124
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver
2225
pub const PerformanceObserver = struct {
2326
pub const _supportedEntryTypes = [0][]const u8{};
27+
28+
pub fn constructor(cbk: Env.Function) PerformanceObserver {
29+
_ = cbk;
30+
return .{};
31+
}
32+
33+
pub fn _observe(self: *const PerformanceObserver, options_: ?Options) void {
34+
_ = self;
35+
_ = options_;
36+
return;
37+
}
38+
39+
pub fn _disconnect(self: *PerformanceObserver) void {
40+
_ = self;
41+
}
42+
43+
pub fn _takeRecords(_: *const PerformanceObserver) []PerformanceEntry {
44+
return &[_]PerformanceEntry{};
45+
}
46+
};
47+
48+
const Options = struct {
49+
buffered: ?bool = null,
50+
durationThreshold: ?f64 = null,
51+
entryTypes: ?[]const []const u8 = null,
52+
type: ?[]const u8 = null,
2453
};
2554

2655
const testing = @import("../../testing.zig");

0 commit comments

Comments
 (0)