Skip to content

Documentation / @etherfold/browser / PortStateReads

Type Alias: PortStateReads ​

PortStateReads = object

Defined in: packages/browser/src/host/reads.ts:64

THE FOUR READS AS THE WIRE SPEAKS THEM: an entity NAME and untyped rows.

The counterpart of EntityStateView (@etherfold/processor-entities), which is the same four reads over a store on this thread -- and, like it, the thing a TYPED surface is generated over rather than the thing an app should hold. createPortReadSurface is what turns an app's declarations into named entities and typed rows; this is what it calls.

It carries no capabilities getter, and that absence is deliberate rather than pending: what a store reports about itself is synchronous on this thread and a round trip across a port, so it is a surface with its own shape rather than a field to smuggle onto this one.

Methods ​

declarations() ​

declarations(): Promise<readonly NormalizedEntity[]>

Defined in: packages/browser/src/host/reads.ts:66

What the host's store was BUILT WITH, so a surface can be checked against it.

Returns ​

Promise<readonly NormalizedEntity[]>


getAsOf() ​

getAsOf(entity, id, at): Promise<PortRow | undefined>

Defined in: packages/browser/src/host/reads.ts:70

One entity as of a block NUMBER. Refused, never answered from the tip, outside retention.

Parameters ​

entity ​

string

id ​

EntityId

at ​

number

Returns ​

Promise<PortRow | undefined>


getCurrent() ​

getCurrent(entity, id): Promise<PortRow | undefined>

Defined in: packages/browser/src/host/reads.ts:68

One entity at the tip, or undefined if it is absent.

Parameters ​

entity ​

string

id ​

EntityId

Returns ​

Promise<PortRow | undefined>


listAsOf() ​

listAsOf(entity, prefix, at, limit): Promise<Listing<PortRow>>

Defined in: packages/browser/src/host/reads.ts:74

The same listing as of a block NUMBER.

Parameters ​

entity ​

string

prefix ​

EntityIdPrefix

at ​

number

limit ​

number

Returns ​

Promise<Listing<PortRow>>


listCurrent() ​

listCurrent(entity, prefix, limit): Promise<Listing<PortRow>>

Defined in: packages/browser/src/host/reads.ts:72

The rows of an id PREFIX at the tip, ascending, bounded by a REQUIRED limit.

Parameters ​

entity ​

string

prefix ​

EntityIdPrefix

limit ​

number

Returns ​

Promise<Listing<PortRow>>