gap-inspector 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,79 @@
1
+ export type GapAxis = "horizontal" | "vertical";
2
+ export type GapPoint = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export type GapContributionKind = "margin" | "padding" | "border" | "scrollbar" | "gap" | "layout" | "unknown";
7
+ export type GapElementInfo = {
8
+ selector: string;
9
+ tagName: string;
10
+ className: string;
11
+ rect: GapRect;
12
+ element?: Element;
13
+ };
14
+ export type GapContribution = {
15
+ kind: GapContributionKind;
16
+ property: string;
17
+ valuePx: number;
18
+ cssValue?: string;
19
+ selector: string;
20
+ element: GapElementInfo;
21
+ note?: string;
22
+ };
23
+ export type GapRect = {
24
+ top: number;
25
+ right: number;
26
+ bottom: number;
27
+ left: number;
28
+ width: number;
29
+ height: number;
30
+ };
31
+ export type GapMeasurement = {
32
+ axis: GapAxis;
33
+ totalPx: number;
34
+ attributedPx: number;
35
+ unattributedPx: number;
36
+ from: GapElementInfo;
37
+ to: GapElementInfo;
38
+ commonAncestor?: GapElementInfo;
39
+ internalSide?: Direction;
40
+ contributions: GapContribution[];
41
+ warnings: string[];
42
+ equation: string;
43
+ markdown: string;
44
+ };
45
+ export type PointRegion = "content" | "padding" | "border" | "margin" | "gap" | "unknown";
46
+ export type PointInspection = {
47
+ kind: "point";
48
+ axis: GapAxis;
49
+ point: GapPoint;
50
+ region: PointRegion;
51
+ totalPx?: number;
52
+ property?: string;
53
+ cssValue?: string;
54
+ element?: GapElementInfo;
55
+ from?: GapElementInfo;
56
+ to?: GapElementInfo;
57
+ rect?: GapRect;
58
+ note?: string;
59
+ markdown: string;
60
+ };
61
+ type Direction = "after" | "before";
62
+ export declare function inferAxis(start: GapPoint, end: GapPoint): GapAxis;
63
+ export declare function measureGap(options: {
64
+ axis?: GapAxis;
65
+ start: GapPoint;
66
+ end: GapPoint;
67
+ document?: Document;
68
+ ignoreElements?: Array<Element | null | undefined>;
69
+ /** Set to false to skip the full-DOM boundary scan fallback (used for cheap drag previews). */
70
+ boundaryScan?: boolean;
71
+ }): GapMeasurement | null;
72
+ export declare function inspectPoint(options: {
73
+ axis?: GapAxis;
74
+ point: GapPoint;
75
+ document?: Document;
76
+ ignoreElements?: Array<Element | null | undefined>;
77
+ }): PointInspection | null;
78
+ export declare function resolveSelector(selector: string, doc?: Document): Element | null;
79
+ export {};