@taterboom/shiteki 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,48 @@
1
+ import React from 'react';
2
+
3
+ interface ShitekiConfig {
4
+ mode: "endpoint" | "direct";
5
+ endpoint: string;
6
+ githubToken: string;
7
+ owner: string;
8
+ repo: string;
9
+ labels?: string[];
10
+ }
11
+ interface ElementInfo {
12
+ selector: string;
13
+ tagName: string;
14
+ textContent: string;
15
+ rect: {
16
+ top: number;
17
+ left: number;
18
+ width: number;
19
+ height: number;
20
+ };
21
+ attributes: Record<string, string>;
22
+ }
23
+ interface Annotation {
24
+ id: number;
25
+ elementInfo: ElementInfo;
26
+ comment: string;
27
+ createdAt: number;
28
+ }
29
+ type WidgetMode = "idle" | "picking" | "annotating";
30
+ interface SubmitResult {
31
+ issueUrl: string;
32
+ issueNumber: number;
33
+ }
34
+ type SubmitState = {
35
+ status: "idle";
36
+ } | {
37
+ status: "loading";
38
+ } | {
39
+ status: "success";
40
+ result: SubmitResult;
41
+ } | {
42
+ status: "error";
43
+ error: string;
44
+ };
45
+
46
+ declare function ShitekiWidget(props: ShitekiConfig): React.ReactPortal;
47
+
48
+ export { type Annotation, type ElementInfo, type ShitekiConfig, ShitekiWidget, type SubmitResult, type SubmitState, type WidgetMode };
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+
3
+ interface ShitekiConfig {
4
+ mode: "endpoint" | "direct";
5
+ endpoint: string;
6
+ githubToken: string;
7
+ owner: string;
8
+ repo: string;
9
+ labels?: string[];
10
+ }
11
+ interface ElementInfo {
12
+ selector: string;
13
+ tagName: string;
14
+ textContent: string;
15
+ rect: {
16
+ top: number;
17
+ left: number;
18
+ width: number;
19
+ height: number;
20
+ };
21
+ attributes: Record<string, string>;
22
+ }
23
+ interface Annotation {
24
+ id: number;
25
+ elementInfo: ElementInfo;
26
+ comment: string;
27
+ createdAt: number;
28
+ }
29
+ type WidgetMode = "idle" | "picking" | "annotating";
30
+ interface SubmitResult {
31
+ issueUrl: string;
32
+ issueNumber: number;
33
+ }
34
+ type SubmitState = {
35
+ status: "idle";
36
+ } | {
37
+ status: "loading";
38
+ } | {
39
+ status: "success";
40
+ result: SubmitResult;
41
+ } | {
42
+ status: "error";
43
+ error: string;
44
+ };
45
+
46
+ declare function ShitekiWidget(props: ShitekiConfig): React.ReactPortal;
47
+
48
+ export { type Annotation, type ElementInfo, type ShitekiConfig, ShitekiWidget, type SubmitResult, type SubmitState, type WidgetMode };