@wayward/types 2.12.1-beta.dev.20221019.1 → 2.12.1-beta.dev.20221020.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.
@@ -26,7 +26,6 @@ export default class UsableActionRegistrar {
26
26
  add<REQUIREMENTS extends IUsableActionRequirements>(id: string | number, action: UsableAction<REQUIREMENTS>): this;
27
27
  showContextMenu(provided: IUsableActionPossibleUsing, contextMenu?: ContextMenu<ActionId>, context?: ActionDisplayLevel, initialiser?: (contextMenu: ContextMenu<ActionId>) => any): ContextMenu<string | number | symbol>;
28
28
  createContextMenu(provided: IUsableActionPossibleUsing, contextMenu?: ContextMenu<ActionId>, context?: ActionDisplayLevel, initialiser?: (contextMenu: ContextMenu<ActionId>) => any): ContextMenu;
29
- private getTooltipLocation;
30
29
  }
31
30
  export interface IUsableActionGeneratorEvents {
32
31
  stopPersisting(): any;
@@ -60,6 +60,7 @@ export declare abstract class StatComponent extends Component {
60
60
  */
61
61
  protected getTooltipElement(): Component;
62
62
  private getTooltip;
63
+ private getTooltipLocation;
63
64
  }
64
65
  export declare abstract class StatsContainer<STAT_COMPONENT extends StatComponent> extends Component {
65
66
  private readonly entity;
@@ -46,12 +46,39 @@ export default class Tooltip extends Component {
46
46
  setSecondary(): this;
47
47
  setForceShown(forceShown?: boolean): this;
48
48
  wasForceShown(): boolean;
49
+ /**
50
+ * Set this tooltip's location by initialising a `TooltipLocationHandler` with multiple location fallbacks.
51
+ */
49
52
  setLocation(initializer: (locationHandler: TooltipLocationHandler) => any): this;
53
+ /**
54
+ * Set this tooltip's location by defining an x and y anchor on the source component.
55
+ */
50
56
  setLocation(xAnchor: TooltipAnchorStringHorizontal, yAnchor: TooltipAnchorStringVertical): this;
57
+ /**
58
+ * Set this tooltip's location by defining an x anchor on a selected ancestor component, and a y anchor on the source component.
59
+ */
51
60
  setLocation(xAnchor: TooltipAnchorStringHorizontal, xRefSelector: string, yAnchor: TooltipAnchorStringVertical): this;
61
+ /**
62
+ * Set this tooltip's location by defining an x anchor on the source component, and a y anchor on a selected ancestor component.
63
+ */
52
64
  setLocation(xAnchor: TooltipAnchorStringHorizontal, yAnchor: TooltipAnchorStringVertical, yRefSelector: string): this;
65
+ /**
66
+ * Set this tooltip's location by defining x and y anchors on selected ancestor components.
67
+ */
53
68
  setLocation(xAnchor: TooltipAnchorStringHorizontal, xRefSelector: string, yAnchor: TooltipAnchorStringVertical, yRefSelector: string): this;
69
+ /**
70
+ * Set this tooltip's location to the default, determined based on where the source component is. (IE, menu or dialog)
71
+ */
72
+ setLocation(location: "default"): this;
73
+ /**
74
+ * Set this tooltip's location to follow the mouse.
75
+ */
76
+ setLocation(location: "mouse"): this;
77
+ /**
78
+ * @deprecated This overload will be removed in 2.13.0-beta. Please update to other overloads.
79
+ */
54
80
  setLocation(location: TooltipLocation): this;
81
+ private getDefaultLocation;
55
82
  /**
56
83
  * Sets the max width of this tooltip.
57
84
  * @param maxWidth The max-width of the tooltip is this value * ui scale.
@@ -64,9 +64,21 @@ export default class TooltipLocationHandler {
64
64
  constructor(tooltip: Tooltip);
65
65
  isMouse(): boolean;
66
66
  reset(): this;
67
+ /**
68
+ * Add a location fallback by defining an x and y anchor on the source component.
69
+ */
67
70
  add(xAnchor: TooltipAnchorStringHorizontal, yAnchor: TooltipAnchorStringVertical): this;
71
+ /**
72
+ * Add a location fallback by defining an x anchor on a selected ancestor component, and a y anchor on the source component.
73
+ */
68
74
  add(xAnchor: TooltipAnchorStringHorizontal, xRefSelector: string, yAnchor: TooltipAnchorStringVertical): this;
75
+ /**
76
+ * Add a location fallback by defining an x anchor on the source component, and a y anchor on a selected ancestor component.
77
+ */
69
78
  add(xAnchor: TooltipAnchorStringHorizontal, yAnchor: TooltipAnchorStringVertical, yRefSelector: string): this;
79
+ /**
80
+ * Add a location fallback by defining x and y anchors on selected ancestor components.
81
+ */
70
82
  add(xAnchor: TooltipAnchorStringHorizontal, xRefSelector: string, yAnchor: TooltipAnchorStringVertical, yRefSelector: string): this;
71
83
  private parseAnchor;
72
84
  private location;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.12.1-beta.dev.20221019.1",
4
+ "version": "2.12.1-beta.dev.20221020.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",