@pi-oxide/extension-js 0.1.0 → 0.2.1
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/content-script.d.ts +44 -0
- package/extension_js.js +99 -161
- package/extension_js_bg.wasm.d.ts +55 -0
- package/generated.d.ts +208 -0
- package/index.d.ts +92 -0
- package/index.js +5646 -0
- package/logger.d.ts +16 -0
- package/package.json +14 -5
- package/runner.d.ts +16 -0
- package/schemas.d.ts +505 -0
- package/tool-registry.d.ts +58 -0
- package/worker-Dt6N4Sxn.js +3 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare const __LOG_LEVELS: {
|
|
2
|
+
readonly debug: 0;
|
|
3
|
+
readonly info: 1;
|
|
4
|
+
readonly warn: 2;
|
|
5
|
+
readonly error: 3;
|
|
6
|
+
readonly none: 4;
|
|
7
|
+
};
|
|
8
|
+
declare let __logLevel: number;
|
|
9
|
+
declare function __formatMeta(meta: Record<string, unknown> | undefined): string;
|
|
10
|
+
declare function __log(level: number, event: string, meta?: Record<string, unknown>): void;
|
|
11
|
+
declare const logger: {
|
|
12
|
+
debug: (event: string, meta?: Record<string, unknown>) => void;
|
|
13
|
+
info: (event: string, meta?: Record<string, unknown>) => void;
|
|
14
|
+
warn: (event: string, meta?: Record<string, unknown>) => void;
|
|
15
|
+
error: (event: string, meta?: Record<string, unknown>) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function getElementByRefId(refId: string | number): Element | null;
|
|
18
|
+
declare function findElementByLabel(query: string): Element | null;
|
|
19
|
+
declare function findCandidateLabels(query: string): string[];
|
|
20
|
+
declare function asRecord(obj: unknown): Record<string, unknown>;
|
|
21
|
+
declare function getStringParam(params: unknown, key: string): string;
|
|
22
|
+
declare function getNumberParam(params: unknown, key: string, fallback: number): number;
|
|
23
|
+
declare function getAccessibleRole(el: Element): string;
|
|
24
|
+
declare function getAccessibleName(el: Element): string;
|
|
25
|
+
declare function shouldInclude(el: Element): boolean;
|
|
26
|
+
interface SnapshotNode {
|
|
27
|
+
refId: number;
|
|
28
|
+
role: string;
|
|
29
|
+
tag: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
}
|
|
32
|
+
interface SnapshotResult {
|
|
33
|
+
text: string;
|
|
34
|
+
nodes: SnapshotNode[];
|
|
35
|
+
url: string;
|
|
36
|
+
title: string;
|
|
37
|
+
viewport: {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
declare function inlineSnapshot(maxNodes: number): SnapshotResult;
|
|
43
|
+
type Handler<T = unknown, R = unknown> = (params: T) => R | Promise<R>;
|
|
44
|
+
declare const handlers: Record<string, Handler>;
|