@@ -113,24 +113,37 @@ export interface Visit {
113113 creating ?: boolean ;
114114}
115115
116+ /** Used in denormalize. Lookup to find an entity in the store table */
117+ export interface EntityPath {
118+ key : string ;
119+ pk : string ;
120+ }
121+
122+ export type IndexPath = [ key : string , index : string , value : string ] ;
123+ export type EntitiesPath = [ key : string ] ;
124+
116125/** Returns true if a circular reference is found */
117126export interface CheckLoop {
118127 ( entityKey : string , pk : string , input : object ) : boolean ;
119128}
120129
121- /** Get Array of entities with map function applied */
130+ /** Get all normalized entities of one type from store */
131+ export interface GetEntities {
132+ ( key : string ) : { readonly [ pk : string ] : any } | undefined ;
133+ }
134+ /** Get normalized Entity from store */
122135export interface GetEntity {
123- ( entityKey : string | symbol ) : { readonly [ pk : string ] : any } | undefined ;
124- ( entityKey : string | symbol , pk : string | number ) : any ;
136+ ( key : string , pk : string ) : any ;
125137}
126138/** Get PK using an Entity Index */
127139export interface GetIndex {
128140 /** getIndex('User', 'username', 'ntucker') */
129- ( entityKey : string , field : string , value : string ) : string | undefined ;
141+ ( ... path : IndexPath ) : string | undefined ;
130142}
131143
132144/** Accessors to the currently processing state while building query */
133145export interface IQueryDelegate {
146+ getEntities : GetEntities ;
134147 getEntity : GetEntity ;
135148 getIndex : GetIndex ;
136149 /** Return to consider results invalid */
@@ -141,6 +154,8 @@ export interface IQueryDelegate {
141154export interface INormalizeDelegate {
142155 /** Action meta-data for this normalize call */
143156 readonly meta : { fetchedAt : number ; date : number ; expiresAt : number } ;
157+ /** Get all normalized entities of one type from store */
158+ getEntities : GetEntities ;
144159 /** Gets any previously normalized entity from store */
145160 getEntity : GetEntity ;
146161 /** Updates an entity using merge lifecycles when it has previously been set */
0 commit comments