@solid-primitives/utils 1.5.0 → 1.5.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +13 -1
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -54,6 +54,18 @@ declare type NonIterable<T> = T & {
54
54
  declare type Definite<T> = {
55
55
  [K in keyof T]-?: T[K];
56
56
  };
57
+ /** Unwraps the type definition of an object, making it more readable */
58
+ declare type Simplify<T> = T extends object ? {
59
+ [K in keyof T]: T[K];
60
+ } : T;
61
+ /** Unboxes type definition, making it more readable */
62
+ declare type UnboxLazy<T> = T extends () => infer U ? U : T;
63
+ /** Get the required keys of an object */
64
+ declare type RequiredKeys<T> = keyof {
65
+ [K in keyof T as T extends {
66
+ [_ in K]: unknown;
67
+ } ? K : never]: 0;
68
+ };
57
69
  /** `A | B => A & B` */
58
70
  declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
59
71
  declare type ExtractIfPossible<T, U> = Extract<T, U> extends never ? U : Extract<T, U>;
@@ -240,4 +252,4 @@ declare type StaticStoreSetter<T extends Readonly<AnyStatic>> = {
240
252
  */
241
253
  declare function createStaticStore<T extends Readonly<AnyStatic>>(init: T): [access: T, write: StaticStoreSetter<T>];
242
254
 
243
- export { AccessReturnTypes, AnyClass, AnyFunction, AnyObject, AnyStatic, DeepPartialAny, Definite, Directive, ExtractIfPossible, Falsy, FalsyValue, ItemsOf, ItemsOfMany, Many, MaybeAccessor, MaybeAccessorValue, Modify, ModifyDeep, NonIterable, Noop, OnAccessEffectFunction, Position, PrimitiveValue, SetterValue, StaticStoreSetter, Trigger, TriggerCache, Truthy, UnionToIntersection, Values, access, accessArray, accessWith, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createMicrotask, createProxy, createStaticStore, createTrigger, createTriggerCache, entries, forEachEntry, isClient, isDev, isObject, isProd, keys, noop, ofClass, onRootCleanup, promiseTimeout, raceTimeout, warn, withAccess };
255
+ export { AccessReturnTypes, AnyClass, AnyFunction, AnyObject, AnyStatic, DeepPartialAny, Definite, Directive, ExtractIfPossible, Falsy, FalsyValue, ItemsOf, ItemsOfMany, Many, MaybeAccessor, MaybeAccessorValue, Modify, ModifyDeep, NonIterable, Noop, OnAccessEffectFunction, Position, PrimitiveValue, RequiredKeys, SetterValue, Simplify, StaticStoreSetter, Trigger, TriggerCache, Truthy, UnboxLazy, UnionToIntersection, Values, access, accessArray, accessWith, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createMicrotask, createProxy, createStaticStore, createTrigger, createTriggerCache, entries, forEachEntry, isClient, isDev, isObject, isProd, keys, noop, ofClass, onRootCleanup, promiseTimeout, raceTimeout, warn, withAccess };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solid-primitives/utils",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "A bunch of reactive utility types and functions, for building primitives with Solid.js",
5
5
  "author": "Damian Tarnawski @thetarnav <gthetarnav@gmail.com>",
6
6
  "license": "MIT",
@@ -44,4 +44,4 @@
44
44
  "peerDependencies": {
45
45
  "solid-js": "^1.3.1"
46
46
  }
47
- }
47
+ }