Documentation / @etherfold/processor-entities / createReadSurface
Function: createReadSurface() ​
createReadSurface<
S,D>(store,declarations):ReadSurface<S,D>
Defined in: packages/state-store/dist/read-surface.d.ts:159
Generate the read surface of a set of declarations over a store.
The declarations are passed rather than read off store.declarations because a ReadonlyMap<string, NormalizedEntity> has no literal types to derive from, so it can produce a read but not a TYPED one. That redundancy is then CHECKED rather than trusted: every declaration is compared with the one the store was built with, and a disagreement throws here, at construction, naming both. A surface built from a declaration the store does not share would be the very second description of the data this exists to remove.
Type Parameters ​
S ​
S extends StateStore
D ​
D extends readonly EntityDeclaration[]
Parameters ​
store ​
S
declarations ​
D
Returns ​
ReadSurface<S, D>