Socket
Socket
Sign inDemoInstall

@starbeam/interfaces

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@starbeam/interfaces - npm Package Compare versions

Comparing version 0.8.10-unstable.84e5619 to 0.8.10-unstable.9b17989

LICENSE.md

16

.eslintrc.json
{
"root": true,
"ignorePatterns": ["node_modules", "dist", "html", "tests"],
"plugins": ["@starbeam"],
"overrides": [
{
"extends": ["plugin:@starbeam/tight"],
"files": ["index.ts", "src/**/*.ts"],
"parserOptions": {
"project": "tsconfig.json"
}
},
{
"extends": ["plugin:@starbeam/json:recommended"],
"files": ["*.json"]
}
]
"extends": ["plugin:@starbeam-dev/library:recommended"]
}
{
"name": "@starbeam/interfaces",
"version": "0.8.10-unstable.84e5619",
"type": "module",
"main": "index.ts",
"types": "index.ts",
"version": "0.8.10-unstable.9b17989",
"main": "dist/index.cjs",
"types": "dist/index.d.ts",
"exports": {
"default": "./index.ts"
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.cjs"
},
"publishConfig": {
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"types": "dist/index.d.ts"
},
"starbeam": {

@@ -26,14 +17,14 @@ "source": "ts",

},
"dependencies": {
"@domtree/any": "0.9.4-unstable.9b17989",
"@starbeam/shared": "1.3.8-unstable.9b17989"
},
"devDependencies": {
"@starbeam-dev/compile": "1.2.1-unstable.9b17989",
"@starbeam-dev/eslint-plugin": "^1.0.6"
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:types": "tsc -b"
},
"dependencies": {
"@domtree/any": "0.9.4-unstable.84e5619",
"@starbeam/shared": "1.3.8-unstable.84e5619"
},
"devDependencies": {
"@starbeam/eslint-plugin": "workspace:^",
"@starbeam-dev/build-support": "workspace:^"
}
}
}

@@ -10,4 +10,4 @@ import type { PresentArray } from "@starbeam/core-utils";

| {
id: boolean | undefined;
}
id: boolean | undefined;
}
| undefined;

@@ -30,4 +30,4 @@

/**
* Mark the current function as a debug entry point. The immediate caller of a
* debug entry point becomes the call stack associated with any debug
* Mark the current function as a debug entry point. The immediate caller of
* a debug entry point becomes the call stack associated with any debug
* information generated for that entry point.

@@ -46,10 +46,10 @@ *

| {
caller?: CallStack | undefined;
description?: EntryPointDescriptionArg | string | undefined;
force?: boolean | undefined;
}
caller?: CallStack | undefined;
description?: EntryPointDescriptionArg | string | undefined;
force?: boolean | undefined;
}
| EntryPointDescriptionArg
| EntryPoint
| string
) => EntryPoint;
) => void;
getEntryPoint: () => EntryPoint | undefined;

@@ -74,34 +74,34 @@

| [
operation: "reactive:read" | "reactive:write" | "reactive:call",
entity: DescriptionDetails | string | undefined,
api?: PropertyKey
]
operation: "reactive:read" | "reactive:write" | "reactive:call",
entity: DescriptionDetails | string | undefined,
api?: PropertyKey
]
| [
operation:
| "object:get"
| "object:set"
| "object:has"
| "object:call"
| "object:define"
| "object:delete"
| "object:meta:get",
entity: DescriptionDetails | string | undefined,
target: PropertyKey
]
operation:
| "object:get"
| "object:set"
| "object:has"
| "object:call"
| "object:define"
| "object:delete"
| "object:meta:get",
entity: DescriptionDetails | string | undefined,
target: PropertyKey
]
| [
operation: "object:meta:keys",
entity: DescriptionDetails | string | undefined
]
operation: "object:meta:keys",
entity: DescriptionDetails | string | undefined
]
| [
operation: "function:call",
entity: DescriptionDetails | string | undefined
]
operation: "function:call",
entity: DescriptionDetails | string | undefined
]
| [
operation:
| "collection:has"
| "collection:get"
| "collection:insert"
| "collection:delete",
entity: DescriptionDetails | string | undefined,
key: unknown
];
operation:
| "collection:has"
| "collection:get"
| "collection:insert"
| "collection:delete",
entity: DescriptionDetails | string | undefined,
key: unknown
];

@@ -18,4 +18,5 @@ import type { TAG } from "@starbeam/shared";

/**
* Cell is the fundamental mutable reactive value. All subscriptions in Starbeam are ultimately
* subscriptions to cells, and all mutations in Starbeam are ultimately mutations to cells.
* Cell is the fundamental mutable reactive value. All subscriptions in
* Starbeam are ultimately subscriptions to cells, and all mutations in
* Starbeam are ultimately mutations to cells.
*/

@@ -32,12 +33,15 @@ export interface CellTag extends TagMethods {

/**
* Formula is a reactive that has *dynamic* children. This means that you can't cache the children
* (or subscribe directly to them), because they may change. This is different from delegates, which
* are guaranteed to have the same set of children forever.
* Formula is a reactive that has *dynamic* children. This means that you can't
* cache the children (or subscribe directly to them), because they may change.
* This is different from delegates, which are guaranteed to have the same set
* of children forever.
*
* Composite reactives must notify the timeline when their children have changed.
* Composite reactives must notify the timeline when their children have
* changed.
*
* A subscription to a composite reactive is a subscription to its current children, as of the last
* time the timeline was notified of changes to the composite's children. Whenever the timeline is
* notified of a change to the composite's children, it removes subscriptions from any stale
* dependencies and adds subscriptions to any new dependencies.
* A subscription to a composite reactive is a subscription to its current
* children, as of the last time the timeline was notified of changes to the
* composite's children. Whenever the timeline is notified of a change to the
* composite's children, it removes subscriptions from any stale dependencies
* and adds subscriptions to any new dependencies.
*/

@@ -66,5 +70,5 @@ export interface FormulaTag extends TagMethods {

*
* Data structures built on `FormulaTag` should always read the formula before
* attempting to read the children if they plan to rely on the absence of
* children as a strong indicator of staticness.
* Data structures built on `FormulaTag` should always read the formula
* before attempting to read the children if they plan to rely on the absence
* of children as a strong indicator of staticness.
*/

@@ -75,9 +79,11 @@ children: () => ReadonlySet<Tag>;

/**
* Delegate is a reactive that represents one or more reactives, but that set of reactives cannot
* change. This allows you to cache the value of the `delegate` property, and it also allows you to
* subscribe directly to the delegate's targets.
* Delegate is a reactive that represents one or more reactives, but that set
* of reactives cannot change. This allows you to cache the value of the
* `delegate` property, and it also allows you to subscribe directly to the
* delegate's targets.
*
* In practice, when you subscribe to a delegate, the timeline subscribes directly to the delegate's
* targets. This means that delegates don't need to know when their value changes, and don't need to
* notify the timeline when their targets change.
* In practice, when you subscribe to a delegate, the timeline subscribes
* directly to the delegate's targets. This means that delegates don't need to
* know when their value changes, and don't need to notify the timeline when
* their targets change.
*/

@@ -91,12 +97,14 @@ export interface DelegateTag extends TagMethods {

/**
* Static is a reactive that is guaranteed not to change. This means that you can cache the value of
* the static reactive and don't need to include it in composite children. All validation semantics
* act as if static reactives were not present.
* Static is a reactive that is guaranteed not to change. This means that you
* can cache the value of the static reactive and don't need to include it in
* composite children. All validation semantics act as if static reactives were
* not present.
*
* If a formula or delegate has only static children, it is also static. Even though a formula's
* children can change, if the formula's *only* children are static, then the formula can never
* invalidate, and therefore it, itself, is treated as static.
* If a formula or delegate has only static children, it is also static. Even
* though a formula's children can change, if the formula's *only* children are
* static, then the formula can never invalidate, and therefore it, itself, is
* treated as static.
*
* TODO: Do we need a separate fundamental type for pollable formulas, which can get new
* dependencies even if they never invalidate?
* TODO: Do we need a separate fundamental type for pollable formulas, which
* can get new dependencies even if they never invalidate?
*/

@@ -109,9 +117,11 @@ export interface StaticTag extends TagMethods {

/**
* A tag validates a reactive value. The behavior of a tags is defined in relation to reads and
* writes of the reactive value they represent. Tags model **value composition** (and functional
* composition), not a more general algebra.
* A tag validates a reactive value. The behavior of a tags is defined in
* relation to reads and writes of the reactive value they represent. Tags
* model **value composition** (and functional composition), not a more general
* algebra.
*
* In other words, it doesn't make sense to think about the composition of tags abstracted from the
* values they represent. Attempting to think about tags this way makes them seem more general than
* they are, and that generality breaks system invariants derived from value composition.
* In other words, it doesn't make sense to think about the composition of tags
* abstracted from the values they represent. Attempting to think about tags
* this way makes them seem more general than they are, and that generality
* breaks system invariants derived from value composition.
*/

@@ -123,5 +133,6 @@ export type Tag = CellTag | FormulaTag | DelegateTag | StaticTag;

*
* A subscription to a formula is a dynamic subscription to its current dependencies.
* A subscription to a delegate is equivalent to subscribing to its (stable) targets.
* A subscription to a static is equivalent to subscribing to nothing.
* A subscription to a formula is a dynamic subscription to its current
* dependencies. A subscription to a delegate is equivalent to subscribing to
* its (stable) targets. A subscription to a static is equivalent to
* subscribing to nothing.
*/

@@ -136,4 +147,4 @@ export type SubscriptionTarget = CellTag | FormulaTag;

* the tagged object was initially created. However, this made it impossible to
* use an tagged object's tag as a key in a WeakMap, which meant that the tagged
* object itself had to be passed around even when it was semantically
* use an tagged object's tag as a key in a WeakMap, which meant that the
* tagged object itself had to be passed around even when it was semantically
* unimportant.

@@ -140,0 +151,0 @@ *

@@ -8,4 +8,4 @@ import type { CallStack } from "./debug/call-stack.js";

/**
* The runtime is the interface that defines the core operations of the reactive
* system.
* The runtime is the interface that defines the core operations of the
* reactive system.
*

@@ -28,4 +28,4 @@ * ## Cells and Formulas

*
* - `onFinalize(object, handler)`: Registers a finalizer handler for an object.
* - `finalize(object)`: Finalizes an object.
* - `onFinalize(object, handler)`: Registers a finalizer handler for an
* object. - `finalize(object)`: Finalizes an object.
* - `link(parent, child)`: Link two objects together: when the parent is

@@ -55,4 +55,4 @@ * finalized, the child will be finalized as well.

/**
* Subscribe to notifications that the given tag has updates ready ("readiness
* notifications").
* Subscribe to notifications that the given tag has updates ready
* ("readiness notifications").
*

@@ -59,0 +59,0 @@ * The second parameter to `subscribe` is a callback that will be called

@@ -1,3 +0,1 @@

import type { UNINITIALIZED } from "@starbeam/shared";
import type { Description } from "./debug/description.js";

@@ -13,9 +11,9 @@ import type { Timestamp } from "./timestamp.js";

/**
* Cell is the fundamental mutable reactive value. All subscriptions in Starbeam
* are ultimately subscriptions to cells, and all mutations in Starbeam are
* ultimately mutations to cells.
* Cell is the fundamental mutable reactive value. All subscriptions in
* Starbeam are ultimately subscriptions to cells, and all mutations in
* Starbeam are ultimately mutations to cells.
*
* If a cell has `undefined` dependencies, that means that the cell cannot
* change anymore. This allows it to be removed from any formulas that depend on
* it.
* change anymore. This allows it to be removed from any formulas that depend
* on it.
*/

@@ -30,15 +28,18 @@ export interface CellTag {

/**
* Formula is a reactive that has *dynamic* children. This means that you can't cache the children
* (or subscribe directly to them), because they may change. This is different from delegates, which
* are guaranteed to have the same set of children forever.
* Formula is a reactive that has *dynamic* children. This means that you can't
* cache the children (or subscribe directly to them), because they may change.
* This is different from delegates, which are guaranteed to have the same set
* of children forever.
*
* Composite reactives must notify the timeline when their children have changed.
* Composite reactives must notify the timeline when their children have
* changed.
*
* A subscription to a composite reactive is a subscription to its current children, as of the last
* time the timeline was notified of changes to the composite's children. Whenever the timeline is
* notified of a change to the composite's children, it removes subscriptions from any stale
* dependencies and adds subscriptions to any new dependencies.
* A subscription to a composite reactive is a subscription to its current
* children, as of the last time the timeline was notified of changes to the
* composite's children. Whenever the timeline is notified of a change to the
* composite's children, it removes subscriptions from any stale dependencies
* and adds subscriptions to any new dependencies.
*
* TODO: Do we need a separate fundamental type for non-cached formulas, which can get new
* dependencies even if they never invalidate?
* TODO: Do we need a separate fundamental type for non-cached formulas, which
* can get new dependencies even if they never invalidate?
*/

@@ -48,14 +49,16 @@ export interface FormulaTag {

readonly description?: Description | undefined;
readonly dependencies: UNINITIALIZED | (() => readonly CellTag[]);
readonly dependencies: undefined | (() => readonly CellTag[]);
}
/**
* A tag validates a reactive value. The behavior of a tags is defined in relation to reads and
* writes of the reactive value they represent. Tags model **value composition** (and functional
* composition), not a more general algebra.
* A tag validates a reactive value. The behavior of a tags is defined in
* relation to reads and writes of the reactive value they represent. Tags
* model **value composition** (and functional composition), not a more general
* algebra.
*
* In other words, it doesn't make sense to think about the composition of tags abstracted from the
* values they represent. Attempting to think about tags this way makes them seem more general than
* they are, and that generality breaks system invariants derived from value composition.
* In other words, it doesn't make sense to think about the composition of tags
* abstracted from the values they represent. Attempting to think about tags
* this way makes them seem more general than they are, and that generality
* breaks system invariants derived from value composition.
*/
export type Tag = CellTag | FormulaTag;

@@ -17,4 +17,4 @@ import type { TAG } from "@starbeam/shared";

* the tagged object was initially created. However, this made it impossible to
* use an tagged object's tag as a key in a WeakMap, which meant that the tagged
* object itself had to be passed around even when it was semantically
* use an tagged object's tag as a key in a WeakMap, which meant that the
* tagged object itself had to be passed around even when it was semantically
* unimportant.

@@ -27,5 +27,5 @@ */

/**
* A `TaggedReactive` object is a reactive object that has a `Tag` (which is used
* to validate it) and a `read` function that can be used to read the current
* value of the object.
* A `TaggedReactive` object is a reactive object that has a `Tag` (which is
* used to validate it) and a `read` function that can be used to read the
* current value of the object.
*/

@@ -32,0 +32,0 @@ export interface TaggedReactive<out T = unknown, I extends Tag = Tag>

@@ -5,10 +5,10 @@ {

"composite": true,
"types": ["../../env.d.ts"],
"declaration": true,
"declarationDir": "../../../dist/types",
"declarationMap": true,
"outDir": "../../../dist/packages",
"types": ["../../env"]
"emitDeclarationOnly": true
},
"exclude": ["dist/**/*"],
"include": ["index.ts", "./src/**/*.ts", "./src/**/*.d.ts"]
"include": ["index.ts", "./src/**/*.ts", "./src/**/*.d.ts"],
"exclude": ["dist/**/*"]
}
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