@tempots/dom 28.2.1 → 28.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/dom",
3
- "version": "28.2.1",
3
+ "version": "28.3.0",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/types/domain.d.ts CHANGED
@@ -148,12 +148,17 @@ export type Size = {
148
148
  */
149
149
  readonly height: number;
150
150
  };
151
+ type AttrPrimitive = string | number | boolean | null | undefined;
152
+ type NoDistribute<T> = [T] extends [any] ? T : never;
153
+ type IsFullyPrimitive<T> = [NoDistribute<T>] extends [AttrPrimitive] ? true : false;
154
+ type ExpandPrimitiveUnion<T> = Value<T> | (T extends any ? Value<T> : never);
155
+ type ExpandValueUnion<T> = IsFullyPrimitive<T> extends true ? ExpandPrimitiveUnion<T> : Value<T>;
151
156
  /**
152
157
  * Represents a nullable value or a signal of a nullable value.
153
158
  * @typeParam T - The type of the value.
154
159
  * @public
155
160
  */
156
- export type NValue<T> = Value<T> | Value<T | null> | Value<T | undefined> | Value<T | null | undefined> | null | undefined;
161
+ export type NValue<T> = ExpandValueUnion<NoDistribute<T>> | Value<T> | Value<T | null> | Value<T | undefined> | Value<T | null | undefined> | null | undefined;
157
162
  /**
158
163
  * Gets the value type of a given Value type.
159
164
  * If the type is a `Signal`, it returns the inferred value type.
@@ -179,3 +184,4 @@ export type GetValueTypes<T extends Value<unknown>[]> = {
179
184
  export type RemoveSignals<T extends Record<string | number | symbol, Value<unknown>>, K extends (string | number | symbol) & keyof T = keyof T> = {
180
185
  [k in K]: GetValueType<T[k]>;
181
186
  };
187
+ export {};