import { Brand } from "./brand.mjs"; import { PromiseWrapper } from "./PromiseWrapper.mjs"; import { ReaderAst, StartUpdate } from "./reader.mjs"; import { NetworkRequestReaderOptions, WithEncounteredRecords } from "./read.mjs"; import { StoreLayer } from "./optimisticProxy.mjs"; import { WrappedLogFunction } from "./logging.mjs"; import { ExtractStartUpdate, FragmentReference, StableIdForFragmentReference, UnknownTReadFromStore, Variables } from "./FragmentReference.mjs"; import { IsographEntrypoint, IsographOperation, IsographPersistedOperation } from "./entrypoint.mjs"; import { RetainedQuery } from "./garbageCollection.mjs"; import { ParentCache } from "@isograph/react-disposable-state"; //#region src/core/IsographEnvironment.d.ts type ComponentOrFieldName = string; type StringifiedArgs = string; type FieldCache = { [key: StableIdForFragmentReference]: T; }; type FragmentSubscription = { readonly kind: 'FragmentSubscription'; readonly callback: (newEncounteredDataAndRecords: WithEncounteredRecords) => void; /** The value read out from the previous call to readButDoNotEvaluate */ encounteredDataAndRecords: WithEncounteredRecords; readonly fragmentReference: FragmentReference; readonly readerAst: ReaderAst; }; type AnyChangesToRecordSubscription = { readonly kind: 'AnyChangesToRecord'; readonly callback: () => void; readonly recordLink: StoreLink; }; type AnyRecordSubscription = { readonly kind: 'AnyRecords'; readonly callback: () => void; }; type Subscription = FragmentSubscription | AnyChangesToRecordSubscription | AnyRecordSubscription; type Subscriptions = Set; type CacheMap = { [index: string]: ParentCache; }; type IsographEnvironment = { store: StoreLayer; readonly networkFunction: IsographNetworkFunction; readonly componentFunction: IsographComponentFunction; readonly missingFieldHandler: MissingFieldHandler | null; readonly componentCache: FieldCache>; readonly eagerReaderCache: FieldCache | undefined>; readonly subscriptions: Subscriptions; readonly fragmentCache: CacheMap>; readonly entrypointArtifactCache: Map>>; readonly retainedQueries: Set; readonly gcBuffer: Array; readonly gcBufferSize: number; readonly loggers: Set; }; type MissingFieldHandler = (storeRecord: StoreRecord, root: StoreLink, fieldName: string, arguments_: { [index: string]: any; } | null, variables: Variables | null) => StoreLink | undefined; type IsographNetworkFunction = (operation: IsographOperation | IsographPersistedOperation, variables: Variables) => Promise; type IsographComponentFunction = (environment: IsographEnvironment, fragmentReference: FragmentReference, networkRequestOptions: NetworkRequestReaderOptions, startUpdate: ExtractStartUpdate) => React.FC; interface Link extends StoreLink { readonly __link: Brand; readonly __typename: T; } type StoreLink = { readonly __link: DataId; readonly __typename: TypeName; }; type DataTypeValue = undefined | number | boolean | string | null | StoreLink | readonly DataTypeValue[]; type StoreRecord = { [index: DataId | string]: DataTypeValue; readonly id?: DataId; }; type TypeName = string; type DataId = string; declare const ROOT_ID: DataId & '__ROOT'; type StoreLayerData = { [index: TypeName]: { [index: DataId]: StoreRecord | null; } | null; }; interface BaseStoreLayerData extends StoreLayerData { readonly Query: { readonly __ROOT: StoreRecord; }; } declare function createIsographStore(): BaseStoreLayerData; //#endregion export { AnyChangesToRecordSubscription, AnyRecordSubscription, BaseStoreLayerData, CacheMap, ComponentOrFieldName, DataId, DataTypeValue, FieldCache, FragmentSubscription, IsographEnvironment, IsographNetworkFunction, Link, MissingFieldHandler, ROOT_ID, StoreLayerData, StoreLink, StoreRecord, StringifiedArgs, Subscription, Subscriptions, TypeName, createIsographStore }; //# sourceMappingURL=IsographEnvironment.d.mts.map