@homebound/truss 2.6.0 → 2.7.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/build/vitest.d.ts CHANGED
@@ -1,5 +1,25 @@
1
- import { S as StyleExpectation } from './toHaveStyle-Y8DGA4JF.js';
2
- export { t as toHaveStyle } from './toHaveStyle-Y8DGA4JF.js';
1
+ /** Supported style expectations for the matcher. */
2
+ type StyleExpectation = string | Record<string, string | number>;
3
+ /** Minimal subset of Vitest's matcher context used for error formatting. */
4
+ type MatcherContext = {
5
+ utils?: {
6
+ printExpected?: (value: unknown) => string;
7
+ printReceived?: (value: unknown) => string;
8
+ };
9
+ };
10
+ /** Standard matcher result shape returned to Vitest. */
11
+ type MatcherResult = {
12
+ pass: boolean;
13
+ message: () => string;
14
+ };
15
+ /**
16
+ * Assert that an element's computed style matches the provided CSS declarations.
17
+ *
18
+ * Static class-based styles are read via `getComputedStyle`, while CSS custom
19
+ * properties are read directly from the element's inline style because jsdom
20
+ * does not resolve them through computed styles.
21
+ */
22
+ declare function toHaveStyle(this: MatcherContext, received: unknown, expected: StyleExpectation): MatcherResult;
3
23
 
4
24
  declare module "vitest" {
5
25
  interface Assertion<T = any> {
@@ -10,4 +30,4 @@ declare module "vitest" {
10
30
  }
11
31
  }
12
32
 
13
- export { StyleExpectation };
33
+ export { type StyleExpectation, toHaveStyle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/truss",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "type": "module",
5
5
  "main": "build/index.js",
6
6
  "bin": "cli.js",
@@ -1,24 +0,0 @@
1
- /** Supported style expectations for the matcher. */
2
- type StyleExpectation = string | Record<string, string | number>;
3
- /** Minimal subset of Vitest's matcher context used for error formatting. */
4
- type MatcherContext = {
5
- utils?: {
6
- printExpected?: (value: unknown) => string;
7
- printReceived?: (value: unknown) => string;
8
- };
9
- };
10
- /** Standard matcher result shape returned to Vitest. */
11
- type MatcherResult = {
12
- pass: boolean;
13
- message: () => string;
14
- };
15
- /**
16
- * Assert that an element's computed style matches the provided CSS declarations.
17
- *
18
- * Static class-based styles are read via `getComputedStyle`, while CSS custom
19
- * properties are read directly from the element's inline style because jsdom
20
- * does not resolve them through computed styles.
21
- */
22
- declare function toHaveStyle(this: MatcherContext, received: unknown, expected: StyleExpectation): MatcherResult;
23
-
24
- export { type StyleExpectation as S, toHaveStyle as t };