shinkom 1.1.0 → 1.1.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.
Files changed (84) hide show
  1. package/dist/bundles/_virtual/_rolldown/runtime.js +14 -14
  2. package/dist/bundles/core/constants.d.ts +15 -15
  3. package/dist/bundles/core/constants.js +23 -23
  4. package/dist/bundles/core/elements/compat-view-element.d.ts +99 -99
  5. package/dist/bundles/core/elements/compat-view-element.js +440 -440
  6. package/dist/bundles/core/elements/control-panel-element.d.ts +44 -44
  7. package/dist/bundles/core/elements/control-panel-element.js +99 -99
  8. package/dist/bundles/core/elements/index.d.ts +12 -12
  9. package/dist/bundles/core/elements/index.js +13 -13
  10. package/dist/bundles/core/elements/inspector-element.d.ts +26 -26
  11. package/dist/bundles/core/elements/inspector-element.js +58 -58
  12. package/dist/bundles/core/elements/recent-result-item.js +46 -46
  13. package/dist/bundles/core/elements/results-history-item.js +46 -46
  14. package/dist/bundles/core/elements/templates/compat-view.templates.js +462 -462
  15. package/dist/bundles/core/elements/templates/control-panel.templates.js +335 -335
  16. package/dist/bundles/core/elements/templates/root-styles.template.js +40 -40
  17. package/dist/bundles/core/event-bus.d.ts +46 -46
  18. package/dist/bundles/core/event-bus.js +49 -49
  19. package/dist/bundles/core/helpers.js +47 -47
  20. package/dist/bundles/core/index.d.ts +14 -14
  21. package/dist/bundles/core/index.js +16 -16
  22. package/dist/bundles/core/state-service.d.ts +56 -56
  23. package/dist/bundles/core/state-service.js +80 -80
  24. package/dist/bundles/core/ui-component.d.ts +63 -63
  25. package/dist/bundles/core/ui-component.js +71 -71
  26. package/dist/bundles/engine/engine.d.ts +108 -108
  27. package/dist/bundles/engine/engine.js +238 -238
  28. package/dist/bundles/engine/index.js +8 -8
  29. package/dist/bundles/gen/index.js +14 -14
  30. package/dist/bundles/index.d.ts +19 -19
  31. package/dist/bundles/index.js +23 -23
  32. package/dist/bundles/pkg/shinkore.d.ts +50 -50
  33. package/dist/bundles/pkg/shinkore.js +465 -465
  34. package/dist/bundles/pkg/shinkore_bg.wasm +0 -0
  35. package/dist/bundles/shinkom.d.ts +41 -41
  36. package/dist/bundles/shinkom.js +80 -80
  37. package/dist/bundles/ui/compat-ui/compat-ui.d.ts +42 -42
  38. package/dist/bundles/ui/compat-ui/compat-ui.js +59 -59
  39. package/dist/bundles/ui/compat-ui/index.js +8 -8
  40. package/dist/bundles/ui/compatibility-view/compatibility-view.d.ts +41 -41
  41. package/dist/bundles/ui/compatibility-view/compatibility-view.js +229 -229
  42. package/dist/bundles/ui/compatibility-view/index.js +8 -8
  43. package/dist/bundles/ui/control-panel/control-panel.d.ts +52 -52
  44. package/dist/bundles/ui/control-panel/control-panel.js +320 -320
  45. package/dist/bundles/ui/control-panel/index.js +8 -8
  46. package/dist/bundles/ui/index.d.ts +11 -11
  47. package/dist/bundles/ui/index.js +16 -16
  48. package/dist/bundles/ui/inspector/index.js +8 -8
  49. package/dist/bundles/ui/inspector/inspector.d.ts +97 -97
  50. package/dist/bundles/ui/inspector/inspector.js +394 -394
  51. package/dist/modules/core/constants.cjs +17 -17
  52. package/dist/modules/core/elements/compat-view-element.cjs +434 -434
  53. package/dist/modules/core/elements/control-panel-element.cjs +93 -93
  54. package/dist/modules/core/elements/index.cjs +11 -11
  55. package/dist/modules/core/elements/inspector-element.cjs +52 -52
  56. package/dist/modules/core/elements/recent-result-item.cjs +39 -39
  57. package/dist/modules/core/elements/results-history-item.cjs +39 -39
  58. package/dist/modules/core/elements/templates/compat-view.templates.cjs +458 -458
  59. package/dist/modules/core/elements/templates/control-panel.templates.cjs +332 -332
  60. package/dist/modules/core/elements/templates/root-styles.template.cjs +33 -33
  61. package/dist/modules/core/event-bus.cjs +43 -43
  62. package/dist/modules/core/helpers.cjs +41 -41
  63. package/dist/modules/core/index.cjs +16 -16
  64. package/dist/modules/core/state-service.cjs +74 -74
  65. package/dist/modules/core/ui-component.cjs +65 -65
  66. package/dist/modules/engine/engine.cjs +232 -232
  67. package/dist/modules/gen/browser-data.cjs +100 -100
  68. package/dist/modules/gen/browser-usage-data.cjs +675 -675
  69. package/dist/modules/gen/compat-data.cjs +31015 -31015
  70. package/dist/modules/gen/index.cjs +7 -7
  71. package/dist/modules/index.cjs +27 -27
  72. package/dist/modules/pkg/shinkore.cjs +459 -459
  73. package/dist/modules/pkg/shinkore_bg.wasm +0 -0
  74. package/dist/modules/shinkom.cjs +73 -73
  75. package/dist/modules/ui/compat-ui/compat-ui.cjs +53 -53
  76. package/dist/modules/ui/compat-ui/index.cjs +1 -1
  77. package/dist/modules/ui/compatibility-view/compatibility-view.cjs +223 -223
  78. package/dist/modules/ui/compatibility-view/index.cjs +1 -1
  79. package/dist/modules/ui/control-panel/control-panel.cjs +314 -314
  80. package/dist/modules/ui/control-panel/index.cjs +1 -1
  81. package/dist/modules/ui/index.cjs +13 -13
  82. package/dist/modules/ui/inspector/index.cjs +1 -1
  83. package/dist/modules/ui/inspector/inspector.cjs +388 -388
  84. package/package.json +1 -1
@@ -1,80 +1,80 @@
1
- /**
2
- * Shinkom - core
3
- * @version 1.1.0
4
- * @license MIT
5
- * @copyright 2026 - OneilNvM
6
- */
7
-
8
- import { DEFAULT_STATE } from "./constants.js";
9
- //#region src/core/state-service.js
10
- /**@typedef {import('../types/public').UISharedState} UISharedState */
11
- /**@typedef {import('../types/public').UISharedStateProps} UISharedStateProps */
12
- /**
13
- * ShinkomState provides shared UI state management for the application.
14
- *
15
- * It wraps a proxied state object and notifies subscribed listeners whenever
16
- * a state property changes. Components can subscribe to update events and
17
- * access the reactive state through `getState()`.
18
- */
19
- var ShinkomState = class {
20
- /**@type {UISharedState}*/
21
- #state;
22
- /**@type {function[]} */
23
- #listeners = [];
24
- /**
25
- * Initializes the shared state service.
26
- *
27
- * The returned state object is proxied so that property assignments
28
- * automatically notify listeners when values change.
29
- *
30
- * @param {UISharedState} initalState
31
- */
32
- constructor(initalState = DEFAULT_STATE) {
33
- const notify = (prop, val) => {
34
- this.#listeners.forEach((fn) => fn(prop, val));
35
- };
36
- this.#state = new Proxy(initalState, {
37
- get(obj, prop) {
38
- return obj[prop];
39
- },
40
- set(obj, prop, val) {
41
- if (obj[prop] === val) return true;
42
- notify(prop, val);
43
- /**@type {any} */ obj[prop] = val;
44
- console.log(`Setting ${prop} -> ${val}`);
45
- return true;
46
- }
47
- });
48
- }
49
- /**
50
- * @callback Listener
51
- * @param {UISharedStateProps} prop
52
- * @param {any} val
53
- */
54
- /**
55
- * Subscribes a listener to state change notifications.
56
- *
57
- * When any property on the shared state changes, the callback receives the
58
- * changed property and its new value.
59
- *
60
- * @param {Listener} callback
61
- * @returns {() => void} cleanup function
62
- */
63
- subscribe(callback) {
64
- this.#listeners.push(callback);
65
- return () => {
66
- this.#listeners = this.#listeners.filter((fn) => fn !== callback);
67
- };
68
- }
69
- /**
70
- * Returns the proxied shared state object.
71
- *
72
- * Callers can read and write state properties directly, and writes will
73
- * trigger listener notifications when values change.
74
- *
75
- * @returns {UISharedState}
76
- */
77
- getState = () => this.#state;
78
- };
79
- //#endregion
80
- export { ShinkomState };
1
+ /**
2
+ * Shinkom - core
3
+ * @version 1.1.1
4
+ * @license MIT
5
+ * @copyright 2026 - OneilNvM
6
+ */
7
+
8
+ import { DEFAULT_STATE } from "./constants.js";
9
+ //#region src/core/state-service.js
10
+ /**@typedef {import('../types/public').UISharedState} UISharedState */
11
+ /**@typedef {import('../types/public').UISharedStateProps} UISharedStateProps */
12
+ /**
13
+ * ShinkomState provides shared UI state management for the application.
14
+ *
15
+ * It wraps a proxied state object and notifies subscribed listeners whenever
16
+ * a state property changes. Components can subscribe to update events and
17
+ * access the reactive state through `getState()`.
18
+ */
19
+ var ShinkomState = class {
20
+ /**@type {UISharedState}*/
21
+ #state;
22
+ /**@type {function[]} */
23
+ #listeners = [];
24
+ /**
25
+ * Initializes the shared state service.
26
+ *
27
+ * The returned state object is proxied so that property assignments
28
+ * automatically notify listeners when values change.
29
+ *
30
+ * @param {UISharedState} initalState
31
+ */
32
+ constructor(initalState = DEFAULT_STATE) {
33
+ const notify = (prop, val) => {
34
+ this.#listeners.forEach((fn) => fn(prop, val));
35
+ };
36
+ this.#state = new Proxy(initalState, {
37
+ get(obj, prop) {
38
+ return obj[prop];
39
+ },
40
+ set(obj, prop, val) {
41
+ if (obj[prop] === val) return true;
42
+ notify(prop, val);
43
+ /**@type {any} */ obj[prop] = val;
44
+ console.log(`Setting ${prop} -> ${val}`);
45
+ return true;
46
+ }
47
+ });
48
+ }
49
+ /**
50
+ * @callback Listener
51
+ * @param {UISharedStateProps} prop
52
+ * @param {any} val
53
+ */
54
+ /**
55
+ * Subscribes a listener to state change notifications.
56
+ *
57
+ * When any property on the shared state changes, the callback receives the
58
+ * changed property and its new value.
59
+ *
60
+ * @param {Listener} callback
61
+ * @returns {() => void} cleanup function
62
+ */
63
+ subscribe(callback) {
64
+ this.#listeners.push(callback);
65
+ return () => {
66
+ this.#listeners = this.#listeners.filter((fn) => fn !== callback);
67
+ };
68
+ }
69
+ /**
70
+ * Returns the proxied shared state object.
71
+ *
72
+ * Callers can read and write state properties directly, and writes will
73
+ * trigger listener notifications when values change.
74
+ *
75
+ * @returns {UISharedState}
76
+ */
77
+ getState = () => this.#state;
78
+ };
79
+ //#endregion
80
+ export { ShinkomState };
@@ -1,64 +1,64 @@
1
- /**
2
- * Shinkom - core
3
- * @version 1.1.0
4
- * @license MIT
5
- * @copyright 2026 - OneilNvM
6
- */
7
-
8
- import { ShinkomBus } from "./event-bus.js";
9
- import { ShinkomState } from "./state-service.js";
10
- import { UISharedState as UISharedState$1, UISharedStateProps as UISharedStateProps$1 } from "../types/public.js";
11
-
12
- //#region src/core/ui-component.d.ts
13
- /**
14
- * Base UI component class for Shinkom UI modules.
15
- *
16
- * UIComponent is abstract and provides shared integration with the Shinkom
17
- * event bus and shared state service. Subclasses must implement lifecycle
18
- * methods for mounting, unmounting, binding state, and responding to state
19
- * changes.
20
- */
21
- declare class UIComponent {
22
- /**
23
- * @param {ShinkomBus} bus
24
- * @param {ShinkomState} stateService
25
- */
26
- constructor(bus: ShinkomBus, stateService: ShinkomState);
27
- bus: ShinkomBus;
28
- stateService: ShinkomState;
29
- /**
30
- * Mounts the component into the DOM.
31
- *
32
- * Subclasses must implement this method to create and attach their UI.
33
- */
34
- mount(): void;
35
- /**
36
- * Unmounts the component from the DOM.
37
- *
38
- * Subclasses must implement this method to remove their UI and cleanup.
39
- */
40
- unmount(): void;
41
- /**
42
- * Binds shared UI state to the component instance.
43
- *
44
- * Implementations should store the bound state reference and apply any
45
- * initial state values needed by the component.
46
- *
47
- * @param {UISharedState} _state
48
- */
49
- bindState(_state: UISharedState): void;
50
- /**
51
- * Called when a shared state property changes.
52
- *
53
- * Components should override this to react to updates from the shared state
54
- * service.
55
- *
56
- * @param {UISharedStateProps} _prop
57
- * @param {any} _val
58
- */
59
- onStateChange(_prop: UISharedStateProps, _val: any): void;
60
- }
61
- type UISharedState = UISharedState$1;
62
- type UISharedStateProps = UISharedStateProps$1;
63
- //#endregion
1
+ /**
2
+ * Shinkom - core
3
+ * @version 1.1.1
4
+ * @license MIT
5
+ * @copyright 2026 - OneilNvM
6
+ */
7
+
8
+ import { ShinkomBus } from "./event-bus.js";
9
+ import { ShinkomState } from "./state-service.js";
10
+ import { UISharedState as UISharedState$1, UISharedStateProps as UISharedStateProps$1 } from "../types/public.js";
11
+
12
+ //#region src/core/ui-component.d.ts
13
+ /**
14
+ * Base UI component class for Shinkom UI modules.
15
+ *
16
+ * UIComponent is abstract and provides shared integration with the Shinkom
17
+ * event bus and shared state service. Subclasses must implement lifecycle
18
+ * methods for mounting, unmounting, binding state, and responding to state
19
+ * changes.
20
+ */
21
+ declare class UIComponent {
22
+ /**
23
+ * @param {ShinkomBus} bus
24
+ * @param {ShinkomState} stateService
25
+ */
26
+ constructor(bus: ShinkomBus, stateService: ShinkomState);
27
+ bus: ShinkomBus;
28
+ stateService: ShinkomState;
29
+ /**
30
+ * Mounts the component into the DOM.
31
+ *
32
+ * Subclasses must implement this method to create and attach their UI.
33
+ */
34
+ mount(): void;
35
+ /**
36
+ * Unmounts the component from the DOM.
37
+ *
38
+ * Subclasses must implement this method to remove their UI and cleanup.
39
+ */
40
+ unmount(): void;
41
+ /**
42
+ * Binds shared UI state to the component instance.
43
+ *
44
+ * Implementations should store the bound state reference and apply any
45
+ * initial state values needed by the component.
46
+ *
47
+ * @param {UISharedState} _state
48
+ */
49
+ bindState(_state: UISharedState): void;
50
+ /**
51
+ * Called when a shared state property changes.
52
+ *
53
+ * Components should override this to react to updates from the shared state
54
+ * service.
55
+ *
56
+ * @param {UISharedStateProps} _prop
57
+ * @param {any} _val
58
+ */
59
+ onStateChange(_prop: UISharedStateProps, _val: any): void;
60
+ }
61
+ type UISharedState = UISharedState$1;
62
+ type UISharedStateProps = UISharedStateProps$1;
63
+ //#endregion
64
64
  export { UIComponent, UISharedState, UISharedStateProps };
@@ -1,71 +1,71 @@
1
- /**
2
- * Shinkom - core
3
- * @version 1.1.0
4
- * @license MIT
5
- * @copyright 2026 - OneilNvM
6
- */
7
-
8
- //#region src/core/ui-component.js
9
- /**
10
- * Base UI component class for Shinkom UI modules.
11
- *
12
- * UIComponent is abstract and provides shared integration with the Shinkom
13
- * event bus and shared state service. Subclasses must implement lifecycle
14
- * methods for mounting, unmounting, binding state, and responding to state
15
- * changes.
16
- */
17
- var UIComponent = class UIComponent {
18
- /**
19
- * @param {ShinkomBus} bus
20
- * @param {ShinkomState} stateService
21
- */
22
- constructor(bus, stateService) {
23
- if (this.constructor === UIComponent) throw new Error("UIComponent is an abstract class and cannot be instantiated.");
24
- this.bus = bus;
25
- this.stateService = stateService;
26
- stateService.subscribe((prop, val) => {
27
- this.onStateChange(prop, val);
28
- });
29
- }
30
- /**
31
- * Mounts the component into the DOM.
32
- *
33
- * Subclasses must implement this method to create and attach their UI.
34
- */
35
- mount() {
36
- throw new Error("mount() method must be implemented.");
37
- }
38
- /**
39
- * Unmounts the component from the DOM.
40
- *
41
- * Subclasses must implement this method to remove their UI and cleanup.
42
- */
43
- unmount() {
44
- throw new Error("unmount() method must be implemented.");
45
- }
46
- /**
47
- * Binds shared UI state to the component instance.
48
- *
49
- * Implementations should store the bound state reference and apply any
50
- * initial state values needed by the component.
51
- *
52
- * @param {UISharedState} _state
53
- */
54
- bindState(_state) {
55
- throw new Error("bindState() method must be implemented.");
56
- }
57
- /**
58
- * Called when a shared state property changes.
59
- *
60
- * Components should override this to react to updates from the shared state
61
- * service.
62
- *
63
- * @param {UISharedStateProps} _prop
64
- * @param {any} _val
65
- */
66
- onStateChange(_prop, _val) {
67
- throw new Error("onStateChange() method must be implemented.");
68
- }
69
- };
70
- //#endregion
71
- export { UIComponent };
1
+ /**
2
+ * Shinkom - core
3
+ * @version 1.1.1
4
+ * @license MIT
5
+ * @copyright 2026 - OneilNvM
6
+ */
7
+
8
+ //#region src/core/ui-component.js
9
+ /**
10
+ * Base UI component class for Shinkom UI modules.
11
+ *
12
+ * UIComponent is abstract and provides shared integration with the Shinkom
13
+ * event bus and shared state service. Subclasses must implement lifecycle
14
+ * methods for mounting, unmounting, binding state, and responding to state
15
+ * changes.
16
+ */
17
+ var UIComponent = class UIComponent {
18
+ /**
19
+ * @param {ShinkomBus} bus
20
+ * @param {ShinkomState} stateService
21
+ */
22
+ constructor(bus, stateService) {
23
+ if (this.constructor === UIComponent) throw new Error("UIComponent is an abstract class and cannot be instantiated.");
24
+ this.bus = bus;
25
+ this.stateService = stateService;
26
+ stateService.subscribe((prop, val) => {
27
+ this.onStateChange(prop, val);
28
+ });
29
+ }
30
+ /**
31
+ * Mounts the component into the DOM.
32
+ *
33
+ * Subclasses must implement this method to create and attach their UI.
34
+ */
35
+ mount() {
36
+ throw new Error("mount() method must be implemented.");
37
+ }
38
+ /**
39
+ * Unmounts the component from the DOM.
40
+ *
41
+ * Subclasses must implement this method to remove their UI and cleanup.
42
+ */
43
+ unmount() {
44
+ throw new Error("unmount() method must be implemented.");
45
+ }
46
+ /**
47
+ * Binds shared UI state to the component instance.
48
+ *
49
+ * Implementations should store the bound state reference and apply any
50
+ * initial state values needed by the component.
51
+ *
52
+ * @param {UISharedState} _state
53
+ */
54
+ bindState(_state) {
55
+ throw new Error("bindState() method must be implemented.");
56
+ }
57
+ /**
58
+ * Called when a shared state property changes.
59
+ *
60
+ * Components should override this to react to updates from the shared state
61
+ * service.
62
+ *
63
+ * @param {UISharedStateProps} _prop
64
+ * @param {any} _val
65
+ */
66
+ onStateChange(_prop, _val) {
67
+ throw new Error("onStateChange() method must be implemented.");
68
+ }
69
+ };
70
+ //#endregion
71
+ export { UIComponent };
@@ -1,109 +1,109 @@
1
- /**
2
- * Shinkom - engine
3
- * @version 1.1.0
4
- * @license MIT
5
- * @copyright 2026 - OneilNvM
6
- */
7
-
8
- import { ShinkomBus } from "../core/event-bus.js";
9
- import { CustomEventEngineDetail as CustomEventEngineDetail$1 } from "../types/types.js";
10
- import { CompatResult as CompatResult$1 } from "../types/public.js";
11
- import { CompatEngine } from "../pkg/shinkore.js";
12
-
13
- //#region src/engine/engine.d.ts
14
- /**
15
- * SKEngine wraps the Shinkom compatibility analysis engine.
16
- *
17
- * It manages WASM loading, engine initialization, and compatibility checks
18
- * for single elements, element subtrees, and full pages. When a `ShinkomBus`
19
- * instance is provided, SKEngine also emits result events and responds to
20
- * engine commands from the UI.
21
- */
22
- declare class SKEngine {
23
- /**
24
- * Clears the instance from memory.
25
- */
26
- static clearInstance(): void;
27
- /**
28
- * Initializes the compatibility engine.
29
- *
30
- * The engine optionally accepts an event bus to listen for
31
- * `engine:inspect` and `engine:full` events from UI
32
- * components.
33
- *
34
- * @param {ShinkomBus | null} bus
35
- */
36
- constructor(bus?: ShinkomBus | null);
37
- initialized: boolean | undefined;
38
- /**@type {CompatEngine | null} */
39
- compatEngine: CompatEngine | null;
40
- /**@type {ShinkomBus | null} */
41
- bus: ShinkomBus | null;
42
- /**@type {(() => void)[]} */
43
- unsubEvents: (() => void)[];
44
- /**
45
- * Gets the instance of the engine.
46
- * @returns {SKEngine} the instance
47
- */
48
- getInstance(): SKEngine;
49
- /**
50
- * Loads the WASM runtime and initializes the native Shinkom engine.
51
- *
52
- * In Node.js this resolves the module path and loads the WASM binary from
53
- * the local filesystem. In browser environments it optionally accepts a
54
- * WASM URL or falls back to the default packaged module loader.
55
- *
56
- * @param {string | undefined} wasmURL
57
- */
58
- loadWasm(wasmURL?: string | undefined): Promise<void>;
59
- /**
60
- * Initializes the Rust-based compatibility engine.
61
- *
62
- * The engine is created after the WASM runtime has been loaded and is
63
- * configured with the bundled compatibility data.
64
- *
65
- * @param {string | undefined} wasmURL
66
- */
67
- initEngine(wasmURL?: string | undefined): Promise<void>;
68
- /**
69
- * Checks compatibility for a single element HTML string.
70
- *
71
- * If a bus was provided at construction, the resulting compatibility data
72
- * is emitted on `results:ready`.
73
- *
74
- * @param {string} element
75
- * @returns {CompatResult | null}
76
- */
77
- checkElement(element: string): CompatResult | null;
78
- /**
79
- * Checks compatibility for a subtree of HTML elements.
80
- *
81
- * The `depthLevel` controls how deeply nested elements are inspected.
82
- *
83
- * @param {string} html
84
- * @param {number} depthLevel
85
- * @returns {CompatResult | null}
86
- */
87
- checkElements(html: string, depthLevel: number): CompatResult | null;
88
- /**
89
- * Checks compatibility for the current full document page.
90
- *
91
- * This method is browser-only because it depends on `document` and
92
- * inspects the serialized page HTML.
93
- *
94
- * @returns {CompatResult | null}
95
- */
96
- fullInspect(): CompatResult | null;
97
- /**
98
- * Releases WASM resources and destroys the engine instance.
99
- *
100
- * After calling this method, the engine must be reinitialized before
101
- * further compatibility checks can be performed.
102
- */
103
- destroy(): void;
104
- #private;
105
- }
106
- type CustomEventEngineDetail = CustomEventEngineDetail$1;
107
- type CompatResult = CompatResult$1;
108
- //#endregion
1
+ /**
2
+ * Shinkom - engine
3
+ * @version 1.1.1
4
+ * @license MIT
5
+ * @copyright 2026 - OneilNvM
6
+ */
7
+
8
+ import { ShinkomBus } from "../core/event-bus.js";
9
+ import { CustomEventEngineDetail as CustomEventEngineDetail$1 } from "../types/types.js";
10
+ import { CompatResult as CompatResult$1 } from "../types/public.js";
11
+ import { CompatEngine } from "../pkg/shinkore.js";
12
+
13
+ //#region src/engine/engine.d.ts
14
+ /**
15
+ * SKEngine wraps the Shinkom compatibility analysis engine.
16
+ *
17
+ * It manages WASM loading, engine initialization, and compatibility checks
18
+ * for single elements, element subtrees, and full pages. When a `ShinkomBus`
19
+ * instance is provided, SKEngine also emits result events and responds to
20
+ * engine commands from the UI.
21
+ */
22
+ declare class SKEngine {
23
+ /**
24
+ * Clears the instance from memory.
25
+ */
26
+ static clearInstance(): void;
27
+ /**
28
+ * Initializes the compatibility engine.
29
+ *
30
+ * The engine optionally accepts an event bus to listen for
31
+ * `engine:inspect` and `engine:full` events from UI
32
+ * components.
33
+ *
34
+ * @param {ShinkomBus | null} bus
35
+ */
36
+ constructor(bus?: ShinkomBus | null);
37
+ initialized: boolean | undefined;
38
+ /**@type {CompatEngine | null} */
39
+ compatEngine: CompatEngine | null;
40
+ /**@type {ShinkomBus | null} */
41
+ bus: ShinkomBus | null;
42
+ /**@type {(() => void)[]} */
43
+ unsubEvents: (() => void)[];
44
+ /**
45
+ * Gets the instance of the engine.
46
+ * @returns {SKEngine} the instance
47
+ */
48
+ getInstance(): SKEngine;
49
+ /**
50
+ * Loads the WASM runtime and initializes the native Shinkom engine.
51
+ *
52
+ * In Node.js this resolves the module path and loads the WASM binary from
53
+ * the local filesystem. In browser environments it optionally accepts a
54
+ * WASM URL or falls back to the default packaged module loader.
55
+ *
56
+ * @param {string | undefined} wasmURL
57
+ */
58
+ loadWasm(wasmURL?: string | undefined): Promise<void>;
59
+ /**
60
+ * Initializes the Rust-based compatibility engine.
61
+ *
62
+ * The engine is created after the WASM runtime has been loaded and is
63
+ * configured with the bundled compatibility data.
64
+ *
65
+ * @param {string | undefined} wasmURL
66
+ */
67
+ initEngine(wasmURL?: string | undefined): Promise<void>;
68
+ /**
69
+ * Checks compatibility for a single element HTML string.
70
+ *
71
+ * If a bus was provided at construction, the resulting compatibility data
72
+ * is emitted on `results:ready`.
73
+ *
74
+ * @param {string} element
75
+ * @returns {CompatResult | null}
76
+ */
77
+ checkElement(element: string): CompatResult | null;
78
+ /**
79
+ * Checks compatibility for a subtree of HTML elements.
80
+ *
81
+ * The `depthLevel` controls how deeply nested elements are inspected.
82
+ *
83
+ * @param {string} html
84
+ * @param {number} depthLevel
85
+ * @returns {CompatResult | null}
86
+ */
87
+ checkElements(html: string, depthLevel: number): CompatResult | null;
88
+ /**
89
+ * Checks compatibility for the current full document page.
90
+ *
91
+ * This method is browser-only because it depends on `document` and
92
+ * inspects the serialized page HTML.
93
+ *
94
+ * @returns {CompatResult | null}
95
+ */
96
+ fullInspect(): CompatResult | null;
97
+ /**
98
+ * Releases WASM resources and destroys the engine instance.
99
+ *
100
+ * After calling this method, the engine must be reinitialized before
101
+ * further compatibility checks can be performed.
102
+ */
103
+ destroy(): void;
104
+ #private;
105
+ }
106
+ type CustomEventEngineDetail = CustomEventEngineDetail$1;
107
+ type CompatResult = CompatResult$1;
108
+ //#endregion
109
109
  export { CompatResult, CustomEventEngineDetail, SKEngine };