@itwin/core-backend
Version:
iTwin.js backend components
51 lines • 1.99 kB
TypeScript
import { IModelJsNative } from "@bentley/imodeljs-native";
import { Id64String } from "@itwin/core-bentley";
import { ElementLoadOptions, ElementLoadProps, ElementProps } from "@itwin/core-common";
export interface CachedElement {
loadOptions: ElementLoadOptions;
elProps: ElementProps;
}
/**
* A LRU cache for entities. Cache contains the ElementProps and the load options used to load it.
* Cache can be searched by id, code or federationGuid.
*/
export declare class ElementLRUCache {
readonly capacity: number;
static readonly DEFAULT_CAPACITY = 2000;
private _elementCache;
private _cacheByCode;
private _cacheByFederationGuid;
private static makeCodeKey;
private findElement;
constructor(capacity?: number);
clear(): void;
get size(): number;
deleteWithModel(modelId: Id64String): void;
delete(key: ElementLoadProps): boolean;
get(key: ElementLoadProps): CachedElement | undefined;
set(el: CachedElement): this;
get [Symbol.toStringTag](): string;
}
/**
* A LRU cache for entities. Cache contains the ElementProps and the load options used to load it.
* Cache can be searched by id, code or federationGuid.
*/
export declare class InstanceKeyLRUCache {
readonly capacity: number;
static readonly DEFAULT_CAPACITY = 2000;
private _argsToResultCache;
private _resultToArgsCache;
constructor(capacity?: number);
set(key: IModelJsNative.ResolveInstanceKeyArgs, result: IModelJsNative.ResolveInstanceKeyResult): this;
get(key: IModelJsNative.ResolveInstanceKeyArgs): IModelJsNative.ResolveInstanceKeyResult | undefined;
deleteById(id: string): boolean;
delete(key: IModelJsNative.ResolveInstanceKeyArgs): boolean;
private deleteCachedArgs;
private static makeCachedArgs;
private static combineCachedArgs;
private static makeCodeKey;
clear(): void;
get size(): number;
get [Symbol.toStringTag](): string;
}
//# sourceMappingURL=ElementLRUCache.d.ts.map