mesurer 0.0.8 → 0.0.9

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.
package/dist/index.d.cts CHANGED
@@ -6,7 +6,44 @@ type MeasurerProps = {
6
6
  hoverHighlightEnabled?: boolean;
7
7
  persistOnReload?: boolean;
8
8
  portalTarget?: HTMLElement | ShadowRoot;
9
+ persistKey?: string;
9
10
  };
10
- declare function Measurer({ highlightColor, guideColor, hoverHighlightEnabled, persistOnReload, portalTarget, }: MeasurerProps): react_jsx_runtime.JSX.Element | null;
11
+ declare function Measurer({ highlightColor, guideColor, hoverHighlightEnabled, persistOnReload, portalTarget, persistKey, }: MeasurerProps): react_jsx_runtime.JSX.Element | null;
11
12
 
12
- export { Measurer };
13
+ type TypographyRow = {
14
+ label: string;
15
+ value: string;
16
+ varName: string | null;
17
+ };
18
+ type TypographyInfo = {
19
+ rows: TypographyRow[];
20
+ tagName: string;
21
+ textSnippet: string;
22
+ };
23
+
24
+ type TextInspectorAPI = {
25
+ enable: () => void;
26
+ disable: () => void;
27
+ undo: () => boolean;
28
+ redo: () => boolean;
29
+ isEnabled: () => boolean;
30
+ cleanup: () => void;
31
+ destroy: () => void;
32
+ clear: () => void;
33
+ inspect: (element: HTMLElement) => boolean;
34
+ canUndo: () => boolean;
35
+ canRedo: () => boolean;
36
+ };
37
+ type TextInspectorOptions = {
38
+ id?: string;
39
+ ignoredTags?: readonly string[];
40
+ maxPinned?: number;
41
+ portalTarget?: HTMLElement | ShadowRoot;
42
+ onInspect?: (element: HTMLElement, info: TypographyInfo) => void;
43
+ onPin?: (element: HTMLElement, info: TypographyInfo) => void;
44
+ onUnpin?: (element: HTMLElement) => void;
45
+ };
46
+ declare const createTextInspector: (options?: TextInspectorOptions, legacy?: boolean) => TextInspectorAPI;
47
+ declare const TextInspector: TextInspectorAPI;
48
+
49
+ export { Measurer, TextInspector, type TextInspectorAPI, type TextInspectorOptions, type TypographyInfo, type TypographyRow, createTextInspector };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,44 @@ type MeasurerProps = {
6
6
  hoverHighlightEnabled?: boolean;
7
7
  persistOnReload?: boolean;
8
8
  portalTarget?: HTMLElement | ShadowRoot;
9
+ persistKey?: string;
9
10
  };
10
- declare function Measurer({ highlightColor, guideColor, hoverHighlightEnabled, persistOnReload, portalTarget, }: MeasurerProps): react_jsx_runtime.JSX.Element | null;
11
+ declare function Measurer({ highlightColor, guideColor, hoverHighlightEnabled, persistOnReload, portalTarget, persistKey, }: MeasurerProps): react_jsx_runtime.JSX.Element | null;
11
12
 
12
- export { Measurer };
13
+ type TypographyRow = {
14
+ label: string;
15
+ value: string;
16
+ varName: string | null;
17
+ };
18
+ type TypographyInfo = {
19
+ rows: TypographyRow[];
20
+ tagName: string;
21
+ textSnippet: string;
22
+ };
23
+
24
+ type TextInspectorAPI = {
25
+ enable: () => void;
26
+ disable: () => void;
27
+ undo: () => boolean;
28
+ redo: () => boolean;
29
+ isEnabled: () => boolean;
30
+ cleanup: () => void;
31
+ destroy: () => void;
32
+ clear: () => void;
33
+ inspect: (element: HTMLElement) => boolean;
34
+ canUndo: () => boolean;
35
+ canRedo: () => boolean;
36
+ };
37
+ type TextInspectorOptions = {
38
+ id?: string;
39
+ ignoredTags?: readonly string[];
40
+ maxPinned?: number;
41
+ portalTarget?: HTMLElement | ShadowRoot;
42
+ onInspect?: (element: HTMLElement, info: TypographyInfo) => void;
43
+ onPin?: (element: HTMLElement, info: TypographyInfo) => void;
44
+ onUnpin?: (element: HTMLElement) => void;
45
+ };
46
+ declare const createTextInspector: (options?: TextInspectorOptions, legacy?: boolean) => TextInspectorAPI;
47
+ declare const TextInspector: TextInspectorAPI;
48
+
49
+ export { Measurer, TextInspector, type TextInspectorAPI, type TextInspectorOptions, type TypographyInfo, type TypographyRow, createTextInspector };