@aiszlab/relax 1.2.26 → 1.2.27

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.
@@ -1,6 +1,6 @@
1
1
  import { type Dispatch, type SetStateAction } from 'react';
2
- import type { State } from "../types";
3
- interface Dependencies<T> {
2
+ import type { State } from '../types';
3
+ interface Props<T> {
4
4
  defaultState?: State<T>;
5
5
  }
6
6
  /**
@@ -9,5 +9,5 @@ interface Dependencies<T> {
9
9
  * @description
10
10
  * controlled state
11
11
  */
12
- export declare const useControlledState: <T>(controlledState: T, { defaultState }?: Dependencies<T>) => [T, Dispatch<SetStateAction<T>>];
12
+ export declare const useControlledState: <T>(controlledState: T, { defaultState }?: Props<T>) => [T, Dispatch<SetStateAction<T>>];
13
13
  export {};
@@ -4,4 +4,5 @@ export type { Partialable } from './partialable';
4
4
  export type { RequiredIn } from './required-in';
5
5
  export type { ThenableEffectCallback } from './thenable-effect-callback';
6
6
  export type { First } from './first';
7
+ export type { Last } from './last';
7
8
  export type { State, StateGetter } from './state';
@@ -0,0 +1 @@
1
+ export type Last<T> = T extends [...Array<unknown>, infer D] ? D : undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiszlab/relax",
3
- "version": "1.2.26",
3
+ "version": "1.2.27",
4
4
  "description": "react utils collection",
5
5
  "type": "module",
6
6
  "exports": {