value-enhancer
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -162,2 +162,8 @@ import { R as ReadonlyVal, V as ValInputsValueTuple, a as ValConfig, U as UnwrapVal, b as ValDisposer, N as NoInfer, c as ValSetValue, d as Val, e as ValSubscriber } from './typings-2bae36c2.js'; | ||
* | ||
* @returns A tuple with the readonly val and a function to set the value. | ||
*/ | ||
declare function readonlyVal(value: [], config?: ValConfig<any[]>): [ReadonlyVal<any[]>, ValSetValue<any[]>]; | ||
/** | ||
* Creates a readonly val with the given value. | ||
* | ||
* @param value Value for the val | ||
@@ -222,2 +228,8 @@ * @param config Custom config for the val. | ||
*/ | ||
declare function val(value: [], config?: ValConfig<any[]>): Val<any[]>; | ||
/** | ||
* Creates a writable val. | ||
* @param value Initial value. | ||
* @param config Custom config. | ||
*/ | ||
declare function val<TValue = any>(value: TValue, config?: ValConfig<TValue>): Val<NoInfer<TValue>>; | ||
@@ -224,0 +236,0 @@ |
{ | ||
"name": "value-enhancer", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"private": false, | ||
@@ -47,3 +47,3 @@ "description": "A tiny library to enhance value with reactive wrapper.", | ||
"lint": "eslint --ext .ts,.tsx . && prettier --check .", | ||
"test": "jest", | ||
"test": "tsc --noEmit -p ./test/tsconfig.json && jest", | ||
"docs": "typedoc --options typedoc.json", | ||
@@ -50,0 +50,0 @@ "types": "cross-env NODE_ENV=production tsc --declaration --emitDeclarationOnly --jsx react --esModuleInterop --outDir dist", |
@@ -163,2 +163,11 @@ import type { | ||
* | ||
* @returns A tuple with the readonly val and a function to set the value. | ||
*/ | ||
export function readonlyVal( | ||
value: [], | ||
config?: ValConfig<any[]> | ||
): [ReadonlyVal<any[]>, ValSetValue<any[]>]; | ||
/** | ||
* Creates a readonly val with the given value. | ||
* | ||
* @param value Value for the val | ||
@@ -165,0 +174,0 @@ * @param config Custom config for the val. |
@@ -92,2 +92,8 @@ import type { NoInfer, ReadonlyVal, Val, ValConfig } from "./typings"; | ||
*/ | ||
export function val(value: [], config?: ValConfig<any[]>): Val<any[]>; | ||
/** | ||
* Creates a writable val. | ||
* @param value Initial value. | ||
* @param config Custom config. | ||
*/ | ||
export function val<TValue = any>( | ||
@@ -94,0 +100,0 @@ value: TValue, |
147935
4183