@starbeam/interfaces
Advanced tools
Comparing version 0.7.3 to 0.8.0
# @starbeam/interfaces | ||
## 0.8.0 | ||
### Minor Changes | ||
- 1a553c5: Prepare for 0.8 | ||
### Patch Changes | ||
- Updated dependencies [1a553c5] | ||
- @starbeam/shared@1.3.0 | ||
- @domtree/any@0.9.2 | ||
## 0.7.3 | ||
@@ -4,0 +16,0 @@ |
20
index.ts
export type { Unsubscribe } from "./src/aliases.js"; | ||
export type { | ||
ComponentNode, | ||
EmptyRoot, | ||
ComponentNode, | ||
RootNode, | ||
} from "./src/debug-protocol/tree.js"; | ||
export type { | ||
ApiDetails, | ||
Description, | ||
ApiDetails, | ||
DescriptionArgs, | ||
DescriptionArgument, | ||
DescriptionDescribeOptions, | ||
DescriptionArgument, | ||
MemberDescription, | ||
DetailsPart, | ||
DescriptionArgs, | ||
DetailDescription, | ||
DescriptionDetails, | ||
DescriptionParts, | ||
DescriptionType, | ||
DescriptionParts, | ||
DetailDescription, | ||
DetailsPart, | ||
MemberDescription, | ||
} from "./src/description.js"; | ||
@@ -32,2 +32,4 @@ export type { Diff } from "./src/diff.js"; | ||
Reactive, | ||
ReactiveCell, | ||
ReactiveCore, | ||
ReactiveId, | ||
@@ -39,7 +41,7 @@ ReactiveInternals, | ||
export type { | ||
DisplayParts, | ||
Stack, | ||
StackFrame, | ||
DisplayParts, | ||
StackFrameDisplayOptions, | ||
} from "./src/stack.js"; | ||
export type { Timestamp, TimestampStatics } from "./src/timestamp.js"; |
{ | ||
"name": "@starbeam/interfaces", | ||
"version": "0.7.3", | ||
"version": "0.8.0", | ||
"type": "module", | ||
"main": "index.ts", | ||
"starbeam:type": "interfaces", | ||
"dependencies": { | ||
"@starbeam/shared": "^1.2.2", | ||
"@domtree/any": "^0.9.1" | ||
}, | ||
"main": "dist/index.cjs", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts" | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.cjs" | ||
} | ||
}, | ||
"types": "dist/index.d.ts" | ||
"starbeam": { | ||
"source": "ts", | ||
"template:package": "interfaces.package.json", | ||
"type": "library:interfaces" | ||
}, | ||
"dependencies": { | ||
"@domtree/any": "^0.9.2", | ||
"@starbeam/shared": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"@starbeam-dev/build-support": "1.0.0" | ||
}, | ||
"scripts": { | ||
"test:lint": "eslint", | ||
"test:types": "tsc -b" | ||
} | ||
} |
import type * as anydom from "@domtree/any"; | ||
import type { Description } from "../description.js"; | ||
@@ -3,0 +4,0 @@ import type { ReactiveProtocol } from "../protocol.js"; |
@@ -12,3 +12,3 @@ import type { ReactiveId } from "./protocol.js"; | ||
*/ | ||
readonly id?: ReactiveId; | ||
readonly id?: ReactiveId | undefined; | ||
@@ -25,3 +25,3 @@ /** | ||
*/ | ||
api: string | "delegate" | ApiDetails; | ||
api?: string | ApiDetails | undefined; | ||
/** | ||
@@ -32,10 +32,12 @@ * An optional description, as provided by the end user. Each instance of an abstraction like | ||
*/ | ||
fromUser?: DescriptionDetails | Description; | ||
fromUser?: DescriptionDetails | Description | undefined; | ||
internal?: { | ||
reason: string; | ||
userFacing: Description; | ||
}; | ||
internal?: | ||
| { | ||
reason: string; | ||
userFacing: Description; | ||
} | ||
| undefined; | ||
stack?: Stack; | ||
stack?: Stack | undefined; | ||
} | ||
@@ -51,11 +53,11 @@ | ||
readonly type: DescriptionType; | ||
readonly api: string | ApiDetails; | ||
readonly api: string | ApiDetails | undefined; | ||
readonly userFacing: Description; | ||
readonly parts: DescriptionParts; | ||
method( | ||
method: ( | ||
id: ReactiveId | symbol, | ||
name: string, | ||
args?: DescriptionArgument[] | ||
): Description; | ||
) => Description; | ||
/** | ||
@@ -65,3 +67,3 @@ * An index is an integer property access on an object. This access must refer to a stable | ||
*/ | ||
index(index: number): Description; | ||
index: (index: number) => Description; | ||
/** | ||
@@ -71,3 +73,3 @@ * A property is a string property access on an object. This access must refer to a stable | ||
*/ | ||
property(name: string): Description; | ||
property: (name: string) => Description; | ||
/** | ||
@@ -83,6 +85,6 @@ * A `key` is like a property access, but the name is not a string property access. For example, | ||
*/ | ||
key( | ||
key: ( | ||
name: string, | ||
options?: { id?: string | number; note?: string } | ||
): Description; | ||
) => Description; | ||
/** | ||
@@ -97,7 +99,7 @@ * A detail is a representation of a *public* part of a value. Unlike `.property` or `.index`, the | ||
*/ | ||
detail( | ||
detail: ( | ||
name: string, | ||
args?: string[] | { args?: string[]; note?: string; id?: string | number } | ||
): Description; | ||
implementation( | ||
) => Description; | ||
implementation: ( | ||
id: ReactiveId | symbol, | ||
@@ -109,3 +111,3 @@ options?: { | ||
} | ||
): Description; | ||
) => Description; | ||
@@ -116,8 +118,8 @@ /** | ||
*/ | ||
asImplementation(options?: { reason: string }): Description; | ||
asImplementation: (options?: { reason: string }) => Description; | ||
withStack(stack: Stack, id: ReactiveId | symbol): Description; | ||
withId(id?: ReactiveId): Description; | ||
withStack: (stack: Stack, id: ReactiveId | symbol) => Description; | ||
withId: (id?: ReactiveId) => Description; | ||
describe(options?: DescriptionDescribeOptions): string; | ||
describe: (options?: DescriptionDescribeOptions) => string; | ||
readonly frame: StackFrame | undefined; | ||
@@ -145,6 +147,12 @@ } | ||
| "resource" | ||
| "service" | ||
| "variants"; | ||
export type BlueprintType = | ||
| "blueprint:reactive" | ||
| "blueprint:resource" | ||
| "blueprint:service"; | ||
/** DescriptionType is `erased` in production */ | ||
export type DescriptionType = MarkerType | ValueType | "erased"; | ||
export type DescriptionType = MarkerType | ValueType | BlueprintType | "erased"; | ||
@@ -154,3 +162,3 @@ export interface MemberDescription { | ||
kind: "index" | "property" | "key"; | ||
note?: string; | ||
note?: string | undefined; | ||
parent: Description; | ||
@@ -162,4 +170,4 @@ name: string | number; | ||
type: "detail"; | ||
args?: string[]; | ||
note?: string; | ||
args?: string[] | undefined; | ||
note?: string | undefined; | ||
parent: Description; | ||
@@ -175,3 +183,3 @@ name: string; | ||
name: string; | ||
args?: DescriptionArgument[]; | ||
args?: DescriptionArgument[] | undefined; | ||
} | ||
@@ -202,6 +210,6 @@ | ||
export interface ApiDetails { | ||
package?: string; | ||
module?: string; | ||
package?: string | undefined; | ||
module?: string | undefined; | ||
// default is allowed here | ||
name: string; | ||
name?: string | undefined; | ||
method?: | ||
@@ -215,7 +223,8 @@ | { | ||
name: string; | ||
}; | ||
} | ||
| undefined; | ||
} | ||
export interface InternalDescription { | ||
reason?: string; | ||
reason?: string | undefined; | ||
userFacing: Description; | ||
@@ -226,3 +235,4 @@ } | ||
readonly type: DescriptionType; | ||
readonly api: ApiDetails; | ||
readonly id: ReactiveId; | ||
readonly api: ApiDetails | undefined; | ||
readonly details: DetailsPart; | ||
@@ -229,0 +239,0 @@ readonly userFacing: Description; |
@@ -21,3 +21,3 @@ import type { UNINITIALIZED } from "@starbeam/shared"; | ||
validate<U>(this: Frame<U | UNINITIALIZED>): FrameValidation<U>; | ||
validate: () => FrameValidation<Exclude<_T, UNINITIALIZED>>; | ||
@@ -24,0 +24,0 @@ // update<U>( |
@@ -17,3 +17,3 @@ import type { REACTIVE } from "@starbeam/shared"; | ||
readonly lastUpdated: Timestamp; | ||
isFrozen?(): boolean; | ||
isFrozen?: () => boolean; | ||
} | ||
@@ -23,3 +23,3 @@ | ||
readonly type: "composite"; | ||
children(): ReactiveProtocol[]; | ||
children: () => ReactiveProtocol[]; | ||
} | ||
@@ -48,5 +48,18 @@ | ||
export interface Reactive<T, I extends ReactiveInternals = ReactiveInternals> | ||
extends ReactiveProtocol<I> { | ||
read(stack?: Stack): T; | ||
export interface ReactiveCore< | ||
T = unknown, | ||
I extends ReactiveInternals = ReactiveInternals | ||
> extends ReactiveProtocol<I> { | ||
read: (stack?: Stack) => T; | ||
} | ||
export interface Reactive< | ||
out T, | ||
I extends ReactiveInternals = ReactiveInternals | ||
> extends ReactiveCore<T, I> { | ||
readonly current: T; | ||
} | ||
export interface ReactiveCell<T> extends Reactive<T, MutableInternals> { | ||
current: T; | ||
} |
@@ -16,2 +16,6 @@ export interface Stack { | ||
export interface StackFrame { | ||
readonly starbeamCaller: | ||
| { package: string; api?: string | undefined } | ||
| undefined; | ||
/** | ||
@@ -21,3 +25,3 @@ * A link to the file/line/column that this stack frame represents, in a format suitable to be | ||
*/ | ||
link(options?: StackFrameDisplayOptions): string; | ||
link: (options?: StackFrameDisplayOptions | undefined) => string; | ||
@@ -27,9 +31,9 @@ /** | ||
*/ | ||
display(options?: StackFrameDisplayOptions): string; | ||
display: (options?: StackFrameDisplayOptions | undefined) => string; | ||
parts(options?: StackFrameDisplayOptions): DisplayParts; | ||
parts: (options?: StackFrameDisplayOptions | undefined) => DisplayParts; | ||
} | ||
export interface DisplayRoot { | ||
name?: string; | ||
name?: string | undefined; | ||
prefix: string; | ||
@@ -40,3 +44,3 @@ } | ||
line: number; | ||
column?: number; | ||
column?: number | undefined; | ||
} | ||
@@ -50,3 +54,3 @@ | ||
display(): string; | ||
display: () => string; | ||
} |
export interface Timestamp { | ||
gt(other: Timestamp): boolean; | ||
eq(other: Timestamp): boolean; | ||
gt: (other: Timestamp) => boolean; | ||
eq: (other: Timestamp) => boolean; | ||
next(): Timestamp; | ||
next: () => Timestamp; | ||
} | ||
export interface TimestampStatics { | ||
now(): Timestamp; | ||
max(...timestamps: Timestamp[]): Timestamp; | ||
debug(timestamp: Timestamp): { at: number }; | ||
now: () => Timestamp; | ||
max: (...timestamps: Timestamp[]) => Timestamp; | ||
debug: (timestamp: Timestamp) => { at: number }; | ||
} |
{ | ||
"extends": "../../.config/tsconfig/tsconfig.-package.json", | ||
"extends": "../../../.config/tsconfig/tsconfig.shared.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/packages", | ||
"composite": true, | ||
"declaration": true, | ||
"composite": true, | ||
"declarationDir": "../../../dist/types", | ||
"declarationMap": true, | ||
"declarationDir": "../../dist/types", | ||
"types": ["../env"] | ||
"outDir": "../../../dist/packages", | ||
"types": ["../../env"] | ||
}, | ||
"exclude": ["dist/**/*"], | ||
"include": ["./index.ts", "./src/**/*.ts"] | ||
} |
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
19153
1
15
503
Updated@domtree/any@^0.9.2
Updated@starbeam/shared@^1.3.0