afnm-types 0.6.55-injecttest → 0.6.55-injecttest2

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 (2) hide show
  1. package/dist/mod.d.ts +11 -9
  2. package/package.json +1 -1
package/dist/mod.d.ts CHANGED
@@ -2462,20 +2462,22 @@ export interface ModAPI {
2462
2462
  /**
2463
2463
  * Inject UI into a named slot (dialog title or screen name).
2464
2464
  *
2465
- * The generator receives (api, element, inject):
2465
+ * The generator receives (api, inject):
2466
2466
  * - api: full ModReduxAPI with game state, actions, and components
2467
- * - element: root DOM element of the slot; use querySelector to find children
2468
- * - inject(selector, content, placement?): helper to portal content relative to the element
2469
- * matched by selector. placement controls where content appears (see InjectPlacement).
2470
- * Defaults to 'after' (sibling inserted after the target).
2467
+ * - inject(selector, content, placement?): places content relative to the matched element.
2468
+ * selector can be:
2469
+ * '' the slot root itself
2470
+ * '#my-id' find by id
2471
+ * '.a .b > .c' find by path (searched within the slot root)
2472
+ * someElement a direct HTMLElement reference
2473
+ * placement controls where content appears (see InjectPlacement). Defaults to 'after'.
2471
2474
  *
2472
2475
  * Slot names for dialogs are the id (e.g. 'combat-victory'). You can find these by inspecting the DOM in dev mode.
2473
2476
  * Slot names for screens match the ScreenType value (e.g. 'combat').
2474
2477
  *
2475
2478
  * @example
2476
- * // Add a button after an element in the combat victory dialog
2477
- * modAPI.ui.injectUI('combat-victory', (api, element, inject) => {
2478
- * return inject('[aria-live="assertive"]',
2479
+ * modAPI.ui.injectUI('combat-victory', (api, inject) => {
2480
+ * inject('[aria-live="assertive"]',
2479
2481
  * <api.components.GameButton onClick={() => api.actions.changeQi(100)}>
2480
2482
  * Absorb Qi
2481
2483
  * </api.components.GameButton>,
@@ -2483,7 +2485,7 @@ export interface ModAPI {
2483
2485
  * );
2484
2486
  * });
2485
2487
  */
2486
- injectUI: (slotName: string, generator: (api: ModReduxAPI, element: HTMLElement | null, inject: (selector: string, content: React.ReactNode, placement?: InjectPlacement) => React.ReactNode) => React.ReactNode) => void;
2488
+ injectUI: (slotName: string, generator: (api: ModReduxAPI, inject: (selector: string | HTMLElement, content: React.ReactNode, placement?: InjectPlacement) => void) => void) => void;
2487
2489
  /**
2488
2490
  * Subscribe to any Redux state changes. The callback receives the new state.
2489
2491
  * Returns an unsubscribe function.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "afnm-types",
3
- "version": "0.6.55-injecttest",
3
+ "version": "0.6.55-injecttest2",
4
4
  "description": "Type definitions for Ascend From Nine Mountains",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",