import type { ActionDefinition, ActionEditResponse, ActionValidationResponse, ObjectTypeDefinition, Osdk, PrimaryKeyType } from "@osdk/api";
import type { ActionSignatureFromDef } from "../../actions/applyAction.js";
import { type Client } from "../../Client.js";
import type { OptimisticBuilder } from "../OptimisticBuilder.js";
import { AggregationsHelper } from "./aggregation/AggregationsHelper.js";
import type { BatchContext } from "./BatchContext.js";
import { CacheKeys } from "./CacheKeys.js";
import { type Changes } from "./Changes.js";
import { IntersectCanonicalizer } from "./IntersectCanonicalizer.js";
import type { KnownCacheKey } from "./KnownCacheKey.js";
import type { Entry } from "./Layer.js";
import { Layers } from "./Layers.js";
import { LinksHelper } from "./links/LinksHelper.js";
import { ListsHelper } from "./list/ListsHelper.js";
import { ObjectCacheKeyRegistry } from "./object/ObjectCacheKeyRegistry.js";
import { ObjectsHelper } from "./object/ObjectsHelper.js";
import { ObjectSetHelper } from "./objectset/ObjectSetHelper.js";
import { type OptimisticId } from "./OptimisticId.js";
import { OrderByCanonicalizer } from "./OrderByCanonicalizer.js";
import { PivotCanonicalizer } from "./PivotCanonicalizer.js";
import { Queries } from "./Queries.js";
import { RdpCanonicalizer } from "./RdpCanonicalizer.js";
import type { Subjects } from "./Subjects.js";
import { WhereClauseCanonicalizer } from "./WhereClauseCanonicalizer.js";
export declare namespace Store {
	interface ApplyActionOptions {
		optimisticUpdate?: (ctx: OptimisticBuilder) => void;
	}
}
/**
* Central data store with layered cache architecture.
* - Truth layer: server state | Optimistic layers: pending changes
* - Reference counting prevents memory leaks
* - Batch operations ensure consistency
*/
export declare class Store {
	#private;
	readonly whereCanonicalizer: WhereClauseCanonicalizer;
	readonly orderByCanonicalizer: OrderByCanonicalizer;
	readonly rdpCanonicalizer: RdpCanonicalizer;
	readonly intersectCanonicalizer: IntersectCanonicalizer;
	readonly pivotCanonicalizer: PivotCanonicalizer;
	readonly client: Client;
	readonly cacheKeys: CacheKeys<KnownCacheKey>;
	readonly queries: Queries;
	readonly objectCacheKeyRegistry: ObjectCacheKeyRegistry;
	readonly layers: Layers;
	readonly subjects: Subjects;
	readonly aggregations: AggregationsHelper;
	readonly lists: ListsHelper;
	readonly objects: ObjectsHelper;
	readonly links: LinksHelper;
	readonly objectSets: ObjectSetHelper;
	constructor(client: Client);
	applyAction: <Q extends ActionDefinition<any>>(action: Q, args: Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0] | Array<Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0]>, opts?: Store.ApplyActionOptions) => Promise<ActionEditResponse>;
	validateAction: <Q extends ActionDefinition<any>>(action: Q, args: Parameters<ActionSignatureFromDef<Q>["applyAction"]>[0]) => Promise<ActionValidationResponse>;
	getValue<K extends KnownCacheKey>(cacheKey: K): Entry<K> | undefined;
	batch<X>({ optimisticId, changes }: {
		optimisticId?: OptimisticId
		changes?: Changes
	}, batchFn: (batchContext: BatchContext) => X): {
		batchResult: BatchContext
		retVal: X
		changes: Changes
	};
	invalidateObject<T extends ObjectTypeDefinition>(apiName: T["apiName"] | T, pk: PrimaryKeyType<T>): Promise<unknown>;
	/**
	* Invalidates all cache entries for a specific object type.
	* This will revalidate:
	* 1. All objects of the specified type
	* 2. All lists of the specified type
	* 3. All links where the source object is of the specified type
	*
	* @param apiName - The API name of the object type to invalidate
	* @param changes - Optional changes object to track what has been modified
	* @returns Promise that resolves when all invalidations are complete
	*/
	invalidateObjectType<T extends ObjectTypeDefinition>(apiName: T["apiName"] | T, changes: Changes | undefined): Promise<void>;
	invalidateAll(): Promise<void>;
	invalidateObjects(objects: Osdk.Instance<ObjectTypeDefinition> | ReadonlyArray<Osdk.Instance<ObjectTypeDefinition>>): Promise<void>;
}
