Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@platform/state.types

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@platform/state.types - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

lib/types.State.d.ts

1

lib/types.d.ts
export * from './types.Node';
export * from './types.Patch';
export * from './types.State';
export * from './types.StateObject';

@@ -4,0 +5,0 @@ export * from './types.StateObject.events';

@@ -6,2 +6,3 @@ "use strict";

tslib_1.__exportStar(require("./types.Patch"), exports);
tslib_1.__exportStar(require("./types.State"), exports);
tslib_1.__exportStar(require("./types.StateObject"), exports);

@@ -8,0 +9,0 @@ tslib_1.__exportStar(require("./types.StateObject.events"), exports);

import * as t from './common';
declare type O = Record<string, unknown>;
export declare type ArrayPatch = {
op: 'replace' | 'remove' | 'add';
op: PatchOperation['op'];
path: (string | number)[];

@@ -11,3 +12,11 @@ value?: any;

isEmpty(patches: t.PatchSet): boolean;
change<T extends O>(from: T, fn: t.StateChanger<T> | T): t.PatchChange<T>;
changeAsync<T extends O>(from: T, fn: t.StateChangerAsync<T>): Promise<t.PatchChange<T>>;
apply<T extends O>(from: T, patches: t.PatchOperation[] | t.PatchSet): T;
};
export declare type PatchChange<T extends O> = {
to: T;
op: t.StateChangeOperation;
patches: t.PatchSet;
};
export declare type PatchSet = {

@@ -14,0 +23,0 @@ prev: PatchOperation[];

9

lib/types.StateObject.d.ts

@@ -26,7 +26,6 @@ import * as t from './common';

};
export declare type StateObjectChange<T extends O> = (input: StateObjectChanger<T> | T) => IStateObjectChangeResponse<T>;
export declare type StateObjectChangeAsync<T extends O> = (input: StateObjectChangerAsync<T>) => Promise<IStateObjectChangeResponse<T>>;
export declare type StateObjectChangeOperation = 'update' | 'replace';
export declare type StateObjectChange<T extends O> = (input: t.StateChanger<T> | T) => IStateObjectChangeResponse<T>;
export declare type StateObjectChangeAsync<T extends O> = (input: t.StateChangerAsync<T>) => Promise<IStateObjectChangeResponse<T>>;
export declare type IStateObjectChangeResponse<T extends O> = {
op: StateObjectChangeOperation;
op: t.StateChangeOperation;
cid: string;

@@ -37,4 +36,2 @@ patches: t.PatchSet;

};
export declare type StateObjectChanger<T extends O> = (draft: T) => void;
export declare type StateObjectChangerAsync<T extends O> = (draft: T) => Promise<void>;
export declare type StateMerger<T extends CombineObject> = {

@@ -41,0 +38,0 @@ readonly store: t.IStateObjectReadable<T>;

@@ -17,3 +17,3 @@ import * as t from './common';

export declare type IStateObjectChanging<T extends O = any> = {
op: t.StateObjectChangeOperation;
op: t.StateChangeOperation;
cid: string;

@@ -31,3 +31,3 @@ from: T;

export declare type IStateObjectChanged<T extends O = any> = {
op: t.StateObjectChangeOperation;
op: t.StateChangeOperation;
cid: string;

@@ -43,3 +43,3 @@ patches: t.PatchSet;

export declare type IStateObjectPatched = {
op: t.StateObjectChangeOperation;
op: t.StateChangeOperation;
cid: string;

@@ -46,0 +46,0 @@ prev: t.PatchSet['prev'];

{
"name": "@platform/state.types",
"version": "0.1.4",
"version": "0.1.5",
"description": "Abstract type definitions for the state library.",

@@ -5,0 +5,0 @@ "main": "lib/index",

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