-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextensions.ts
More file actions
86 lines (72 loc) · 4.02 KB
/
Copy pathextensions.ts
File metadata and controls
86 lines (72 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░░░▄▀░█▀▄░█▀▀░█▀▀░█░█░█░░░█▀█░█▀▄░░░░░█░░░█▀█░█░█░█▀█░█░█░▀█▀░▀▄░░░░░░░░
// ░░░░░░░▀▄░░█▀▄░█▀▀░█░█░█░█░█░░░█▀█░█▀▄░▀▀▀░█░░░█▀█░░█░░█░█░█░█░░█░░░▄▀░░░░░░░
// ░░░░░░░░░▀░▀░▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░░░░░▀▀▀░▀░▀░░▀░░▀▀▀░▀▀▀░░▀░░▀░░░░░░░░░
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
// ┃ * Copyright (c) 2026, the Regular Layout Authors. This file is part * ┃
// ┃ * of the Regular Layout library, distributed under the terms of the * ┃
// ┃ * [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). * ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
import { RegularLayout } from "./regular-layout.ts";
import { RegularLayoutFrame } from "./regular-layout-frame.ts";
import type { Layout, PresizeDetail } from "./core/types.ts";
import { RegularLayoutTab } from "./regular-layout-tab.ts";
customElements.define("regular-layout", RegularLayout);
customElements.define("regular-layout-frame", RegularLayoutFrame);
customElements.define("regular-layout-tab", RegularLayoutTab);
declare global {
interface Document {
createElement(
tagName: "regular-layout",
options?: ElementCreationOptions,
): RegularLayout;
createElement(
tagName: "regular-layout-frame",
options?: ElementCreationOptions,
): RegularLayoutFrame;
createElement(
tagName: "regular-layout-tab",
options?: ElementCreationOptions,
): RegularLayoutTab;
querySelector<E extends Element = Element>(selectors: string): E | null;
querySelector(selectors: "regular-layout"): RegularLayout | null;
querySelector(selectors: "regular-layout-frame"): RegularLayoutFrame | null;
querySelector(selectors: "regular-layout-tab"): RegularLayoutTab | null;
}
interface CustomElementRegistry {
get(tagName: "regular-layout"): typeof RegularLayout;
get(tagName: "regular-layout-frame"): typeof RegularLayoutFrame;
}
interface HTMLElement {
addEventListener(
name: "regular-layout-update",
cb: (e: RegularLayoutEvent) => void,
options?: { signal: AbortSignal },
): void;
addEventListener(
name: "regular-layout-before-update",
cb: (e: RegularLayoutEvent) => void,
options?: { signal: AbortSignal },
): void;
addEventListener(
name: "regular-layout-before-resize",
cb: (e: RegularLayoutPresizeEvent) => void,
options?: { signal: AbortSignal },
): void;
removeEventListener(
name: "regular-layout-update",
cb: (e: RegularLayoutEvent) => void,
): void;
removeEventListener(
name: "regular-layout-before-update",
cb: (e: RegularLayoutEvent) => void,
): void;
removeEventListener(
name: "regular-layout-before-resize",
cb: (e: RegularLayoutPresizeEvent) => void,
): void;
}
}
export type RegularLayoutEvent = CustomEvent<Layout>;
export type RegularLayoutPresizeEvent = CustomEvent<PresizeDetail>;