Socket
Socket
Sign inDemoInstall

valtio

Package Overview
Dependencies
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

valtio - npm Package Compare versions

Comparing version 2.0.0-alpha.2 to 2.0.0-beta.0

4

package.json
{
"name": "valtio",
"private": false,
"version": "2.0.0-alpha.2",
"version": "2.0.0-beta.0",
"publishConfig": {

@@ -80,3 +80,3 @@ "tag": "next"

"dependencies": {
"proxy-compare": "2.5.1"
"proxy-compare": "2.6.0"
},

@@ -83,0 +83,0 @@ "peerDependencies": {

@@ -1,2 +0,2 @@

import type { INTERNAL_Snapshot as Snapshot } from 'valtio/vanilla';
import type { Snapshot } from 'valtio/vanilla';
type Options = {

@@ -3,0 +3,0 @@ sync?: boolean;

type AnyFunction = (...args: any[]) => any;
type AsRef = {
$$valtioRef: true;
};
type Path = (string | symbol)[];

@@ -9,11 +6,8 @@ type Op = [op: 'set', path: Path, value: unknown, prevValue: unknown] | [op: 'delete', path: Path, prevValue: unknown] | [op: 'resolve', path: Path, value: unknown] | [op: 'reject', path: Path, error: unknown];

type Primitive = string | number | boolean | null | undefined | symbol | bigint;
type SnapshotIgnore = Date | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | AsRef | Error | RegExp | AnyFunction | Primitive;
type Snapshot<T> = T extends SnapshotIgnore ? T : T extends object ? {
type SnapshotIgnore = Date | Map<any, any> | Set<any> | WeakMap<any, any> | WeakSet<any> | Error | RegExp | AnyFunction | Primitive;
export type Snapshot<T> = T extends {
$$valtioSnapshot: infer S;
} ? S : T extends SnapshotIgnore ? T : T extends object ? {
readonly [K in keyof T]: Snapshot<T[K]>;
} : T;
/**
* This is not a public API.
* It can be changed without any notice.
*/
export type INTERNAL_Snapshot<T> = Snapshot<T>;
type CreateSnapshot = <T extends object>(target: T, version: number) => T;

@@ -32,4 +26,6 @@ type RemoveListener = () => void;

export declare function snapshot<T extends object>(proxyObject: T): Snapshot<T>;
export declare function ref<T extends object>(obj: T): T & AsRef;
export declare function ref<T extends object>(obj: T): T & {
$$valtioSnapshot: T;
};
export declare const unstable_buildProxyFunction: (objectIs?: (value1: any, value2: any) => boolean, newProxy?: <T extends object>(target: T, handler: ProxyHandler<T>) => T, canProxy?: (x: unknown) => boolean, snapCache?: WeakMap<object, [version: number, snap: unknown]>, createSnapshot?: CreateSnapshot, proxyCache?: WeakMap<object, object>, versionHolder?: [number, number], proxyFunction?: <T_1 extends object>(baseObject: T_1) => T_1) => readonly [<T_1 extends object>(baseObject: T_1) => T_1, WeakMap<object, ProxyState>, WeakSet<WeakKey>, (value1: any, value2: any) => boolean, <T extends object>(target: T, handler: ProxyHandler<T>) => T, (x: unknown) => boolean, WeakMap<object, [version: number, snap: unknown]>, CreateSnapshot, WeakMap<object, object>, [number, number]];
export {};

@@ -29,2 +29,4 @@ /**

*/
export declare function proxyMap<K, V>(entries?: Iterable<readonly [K, V]> | null): Map<K, V>;
export declare function proxyMap<K, V>(entries?: Iterable<readonly [K, V]> | null): Map<K, V> & {
$$valtioSnapshot: Omit<Map<K, V>, 'set' | 'delete' | 'clear'>;
};

@@ -16,2 +16,4 @@ /**

*/
export declare function proxySet<T>(initialValues?: Iterable<T> | null): Set<T>;
export declare function proxySet<T>(initialValues?: Iterable<T> | null): Set<T> & {
$$valtioSnapshot: Omit<Set<T>, 'add' | 'delete' | 'clear'>;
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc