@wora/relay-store
Version:
@wora Relay Store
32 lines • 1.65 kB
TypeScript
import { Store as RelayModernStore } from 'relay-runtime';
import { Disposable, OperationDescriptor, RequestDescriptor, OperationAvailability, OperationLoader } from 'relay-runtime';
import { CheckOptions, LogFunction, Scheduler } from 'relay-runtime/lib/store/RelayStoreTypes';
import { Cache, CacheOptions } from '@wora/cache-persist';
import { RecordSource } from './RecordSource';
import { GetDataID } from 'relay-runtime/lib/store/RelayResponseNormalizer';
export declare type StoreOptions = {
gcScheduler?: Scheduler | null | undefined;
log?: LogFunction | null | undefined;
operationLoader?: OperationLoader | null | undefined;
GetDataID?: GetDataID | null | undefined;
gcReleaseBufferSize?: number | null | undefined;
queryCacheExpirationTime?: number | null | undefined;
shouldProcessClientComponents?: boolean | null | undefined;
};
export declare class Store extends RelayModernStore {
_cache: Cache;
checkGC: () => boolean;
constructor(recordSource: RecordSource, persistOptions?: CacheOptions, options?: StoreOptions);
setCheckGC(checkGC?: () => boolean): void;
purge(): Promise<void[]>;
hydrate(): Promise<Cache[]>;
isRehydrated(): boolean;
getTTL(operation: OperationDescriptor): number;
retain(operation: OperationDescriptor): Disposable;
__gc(): void;
scheduleGC(): void;
private isCurrent;
check(operation: OperationDescriptor, options?: CheckOptions): OperationAvailability;
notify(sourceOperation?: OperationDescriptor, invalidateStore?: boolean): ReadonlyArray<RequestDescriptor>;
}
//# sourceMappingURL=Store.d.ts.map