Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "rosma", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -5,7 +5,7 @@ import { Listener } from '../types'; | ||
constructor(initialValues?: T); | ||
subscribe(key: string | string[], listener: Listener): () => void; | ||
set<State = Record<string, any>>(object: State | T, { silent }?: { | ||
subscribe<K extends keyof T>(key: K | K[], listener: Listener): () => void; | ||
set<StateType>(object: Partial<StateType | T>, { silent }?: { | ||
silent?: boolean; | ||
}): void; | ||
get(key: string | string[]): any; | ||
get<K extends keyof T>(key: K | Array<K>): any; | ||
isValid(key: string): boolean; | ||
@@ -12,0 +12,0 @@ } |
@@ -8,4 +8,5 @@ export declare type Listener = (value: any) => void; | ||
}; | ||
export declare type Setter<T> = T | ((prev: T) => T); | ||
export declare type WithSetters<T> = T extends object ? { | ||
[K in keyof T as `set${Capitalize<string & K>}`]: (value: T[K]) => void; | ||
[K in keyof T as `set${Capitalize<string & K>}`]: (value: Setter<T[K]>) => void; | ||
} & T : T; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13032
57