trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
21 lines • 1.02 kB
TypeScript
import type { AnyType } from './define.js';
import type { EntityData, TrellisDb } from '../client/sdk.js';
/** Read/query surface used by relation expansion (client or in-process kernel). */
export type RelationResolveClient = Pick<TrellisDb, 'read' | 'query'>;
/**
* Runtime resolve map (loose keys). For static types use
* {@link import('./define.js').ResolveSpecFor}.
*/
export type ResolveSpec = {
[key: string]: boolean | ResolveSpec | undefined;
};
/** Child attribute pointing at `parent` (inverse of a `many` relation). */
export declare function inverseForeignKey(parent: AnyType, relationName: string, child: AnyType): string | null;
/**
* Expand `resolve` relation keys on hydrated entities. Mutates rows in place.
*/
export declare function resolveRelations(client: RelationResolveClient, schema: AnyType, entities: EntityData[], spec: ResolveSpec, opts?: {
copy?: boolean;
schemaLookup?: (typeName: string) => AnyType | null;
}): Promise<EntityData[]>;
//# sourceMappingURL=resolve.d.ts.map