@nighthawk.hq/macro-sdk 0.2.0 → 0.3.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.
package/lib/index.d.ts CHANGED
@@ -3,8 +3,8 @@ export { Macro, OnStart, OnStop, OnTick, Action, Panel, Overlay } from './decora
3
3
  export type { ActionOptions } from './decorators';
4
4
  export { MacroBase } from './macro-base';
5
5
  export { robloxTarget } from './targets';
6
- export { region, ratio, point, color, number, string, boolean, select, pixelColor, findColor, defaultsOf, } from './settings';
7
- export type { Setting, SettingMap, RegionSetting, RatioSetting, PointSetting, ColorSetting, NumberSetting, StringSetting, BooleanSetting, SelectSetting, PixelColorSetting, PixelColorValue, FindColorSetting, FindColorValue, } from './settings';
6
+ export { region, ratio, point, color, number, string, boolean, select, pixelColor, findColor, group, defaultsOf, } from './settings';
7
+ export type { Setting, SettingMap, SettingGroup, RegionSetting, RatioSetting, PointSetting, ColorSetting, NumberSetting, StringSetting, BooleanSetting, SelectSetting, PixelColorSetting, PixelColorValue, FindColorSetting, FindColorValue, } from './settings';
8
8
  export { Group, Row, Stat, Chip, Divider, Button, Text, Meter, Image } from './widgets';
9
9
  export type { Widget, PanelDeclaration, WidgetTone, WidgetSize, WidgetAlign, WidgetWeight, } from './panel-types';
10
10
  export { Roblox, Instance } from './roblox/index';
package/lib/settings.d.ts CHANGED
@@ -1,9 +1,14 @@
1
1
  import type { Point, Region, RegionRatio } from './geometry';
2
+ export type SettingGroup = {
3
+ label: string;
4
+ collapsed?: boolean;
5
+ };
2
6
  type Base<K extends string, T> = {
3
7
  kind: K;
4
8
  label: string;
5
9
  description?: string;
6
10
  default: T;
11
+ group?: SettingGroup;
7
12
  };
8
13
  export type RegionSetting = Base<'region', Region>;
9
14
  export type RatioSetting = Base<'ratio', RegionRatio>;
@@ -48,5 +53,8 @@ export declare const boolean: (s: Omit<BooleanSetting, "kind">) => BooleanSettin
48
53
  export declare const select: <T extends string>(s: Omit<SelectSetting<T>, "kind">) => SelectSetting<T>;
49
54
  export declare const pixelColor: (s: Omit<PixelColorSetting, "kind">) => PixelColorSetting;
50
55
  export declare const findColor: (s: Omit<FindColorSetting, "kind">) => FindColorSetting;
56
+ export declare function group<M extends SettingMap>(label: string, settings: M, opts?: {
57
+ collapsed?: boolean;
58
+ }): M;
51
59
  export declare function defaultsOf<M extends SettingMap>(map: M): Record<string, unknown>;
52
60
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nighthawk.hq/macro-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "packageManager": "pnpm@10.34.1",
5
5
  "description": "Nighthawk macro author SDK — types only. Runtime is provided by the host.",
6
6
  "type": "module",
@@ -10,10 +10,18 @@
10
10
  },
11
11
  "types": "./lib/index.d.ts",
12
12
  "exports": {
13
- ".": { "types": "./lib/index.d.ts", "default": "./stub.js" },
13
+ ".": {
14
+ "types": "./lib/index.d.ts",
15
+ "default": "./stub.js"
16
+ },
14
17
  "./build": "./build/index.js"
15
18
  },
16
- "files": ["lib/**/*.d.ts", "stub.js", "build/index.js", "runtime-manifest.json"],
19
+ "files": [
20
+ "lib/**/*.d.ts",
21
+ "stub.js",
22
+ "build/index.js",
23
+ "runtime-manifest.json"
24
+ ],
17
25
  "scripts": {
18
26
  "generate": "node scripts/generate.mjs",
19
27
  "test": "node --test test/shim.test.mjs"
@@ -27,6 +27,7 @@
27
27
  "defaultsOf",
28
28
  "f",
29
29
  "findColor",
30
+ "group",
30
31
  "number",
31
32
  "offsetsFromDump",
32
33
  "pixelColor",