mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
Leverage comptime fields to give generated Tuple a default value, allowing TupleT and Tuple to be merged. Only call generate.Tuple on the final output. This eliminates redundant deduplication, and results in a simpler API (nested types just need to expose a natural Zig tuple). generate.Union leverages the new Tuple and removes unused features.
48 lines
1.6 KiB
Zig
48 lines
1.6 KiB
Zig
// Copyright (C) 2023-2024 Lightpanda (Selecy SAS)
|
|
//
|
|
// Francis Bouvier <francis@lightpanda.io>
|
|
// Pierre Tachoire <pierre@lightpanda.io>
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License as
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
// License, or (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Affero General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
const generate = @import("generate.zig");
|
|
|
|
const Console = @import("jsruntime").Console;
|
|
|
|
const DOM = @import("dom/dom.zig");
|
|
const HTML = @import("html/html.zig");
|
|
const Events = @import("events/event.zig");
|
|
const XHR = @import("xhr/xhr.zig");
|
|
const Storage = @import("storage/storage.zig");
|
|
const URL = @import("url/url.zig");
|
|
const Iterators = @import("iterator/iterator.zig");
|
|
const XMLSerializer = @import("xmlserializer/xmlserializer.zig");
|
|
|
|
pub const HTMLDocument = @import("html/document.zig").HTMLDocument;
|
|
|
|
// Interfaces
|
|
pub const Interfaces = generate.Tuple(.{
|
|
Console,
|
|
DOM.Interfaces,
|
|
Events.Interfaces,
|
|
HTML.Interfaces,
|
|
XHR.Interfaces,
|
|
Storage.Interfaces,
|
|
URL.Interfaces,
|
|
Iterators.Interfaces,
|
|
XMLSerializer.Interfaces,
|
|
}){};
|
|
|
|
pub const UserContext = @import("user_context.zig").UserContext;
|