// Generated by tsbindgen - Architecture // Namespace: Microsoft.Extensions.Caching.Memory // Assembly: Microsoft.Extensions.Caching.Abstractions, Microsoft.Extensions.Caching.Memory // Core type aliases from @tsonic/core import type { fnptr, ptr, sbyte, byte, short, ushort, int, uint, long, ulong, int128, uint128, half, float, double, decimal, nint, nuint, char } from '@tsonic/core/types.js'; // Import types from other namespaces import type { ISystemClock } from "../../Microsoft.Extensions.Internal/internal/index.js"; import type { ILoggerFactory } from "../../Microsoft.Extensions.Logging/internal/index.js"; import * as Microsoft_Extensions_Options_Internal from "../../Microsoft.Extensions.Options/internal/index.js"; import type { IOptions_1 } from "../../Microsoft.Extensions.Options/internal/index.js"; import type { IChangeToken } from "../../Microsoft.Extensions.Primitives/internal/index.js"; import type { IEnumerable_1, IList_1 } from "@tsonic/dotnet/System.Collections.Generic/internal/index.js"; import * as System_Runtime_Serialization_Internal from "@tsonic/dotnet/System.Runtime.Serialization/internal/index.js"; import type { ISerializable } from "@tsonic/dotnet/System.Runtime.Serialization/internal/index.js"; import type { Task_1 } from "@tsonic/dotnet/System.Threading.Tasks/internal/index.js"; import * as System_Internal from "@tsonic/dotnet/System/internal/index.js"; import type { AsyncCallback, Boolean as ClrBoolean, Char, DateTimeOffset, Double, Enum, Func_2, IAsyncResult, ICloneable, IComparable, IConvertible, IDisposable, IFormattable, Int32, Int64, IntPtr, ISpanFormattable, MulticastDelegate, Nullable_1, Object as ClrObject, ReadOnlySpan_1, TimeSpan, Void } from "@tsonic/dotnet/System/internal/index.js"; export enum CacheItemPriority { Low = 0, Normal = 1, High = 2, NeverRemove = 3 } export enum EvictionReason { None = 0, Removed = 1, Replaced = 2, Expired = 3, TokenExpired = 4, Capacity = 5 } export type PostEvictionDelegate = (key: unknown, value: unknown | null, reason: EvictionReason, state: unknown | null) => void; export interface ICacheEntry$instance extends IDisposable { readonly __tsonic_iface_Microsoft_Extensions_Caching_Memory_ICacheEntry: never; readonly Key: unknown; get Value(): unknown | null; set Value(value: unknown | null); get AbsoluteExpiration(): Nullable_1; set AbsoluteExpiration(value: Nullable_1 | DateTimeOffset); get AbsoluteExpirationRelativeToNow(): Nullable_1; set AbsoluteExpirationRelativeToNow(value: Nullable_1 | TimeSpan); get SlidingExpiration(): Nullable_1; set SlidingExpiration(value: Nullable_1 | TimeSpan); readonly ExpirationTokens: IList_1; readonly PostEvictionCallbacks: IList_1; Priority: CacheItemPriority; get Size(): Nullable_1; set Size(value: Nullable_1 | long); } export interface ICacheEntry$instance extends System_Internal.IDisposable {} export type ICacheEntry = ICacheEntry$instance; export interface IMemoryCache$instance extends IDisposable { readonly __tsonic_iface_Microsoft_Extensions_Caching_Memory_IMemoryCache: never; CreateEntry(key: unknown): ICacheEntry; GetCurrentStatistics(): MemoryCacheStatistics | null; Remove(key: unknown): void; TryGetValue(key: unknown, value: unknown | null): boolean; } export interface IMemoryCache$instance extends System_Internal.IDisposable {} export type IMemoryCache = IMemoryCache$instance; export interface MemoryCache$instance { readonly __tsonic_type_Microsoft_Extensions_Caching_Memory_MemoryCache: never; readonly __tsonic_iface_Microsoft_Extensions_Caching_Memory_IMemoryCache: never; readonly __tsonic_iface_System_IDisposable: never; readonly Count: int; readonly Keys: IEnumerable_1; Clear(): void; Compact(percentage: double): void; CreateEntry(key: unknown): ICacheEntry; Dispose(): void; Dispose(disposing: boolean): void; Finalize(): void; GetCurrentStatistics(): MemoryCacheStatistics | null; Remove(key: unknown): void; TryGetValue(key: unknown, result: unknown | null): boolean; TryGetValue(key: ReadOnlySpan_1, value: unknown | null): boolean; TryGetValue(key: ReadOnlySpan_1, value: TItem | null): boolean; } export const MemoryCache: { new(optionsAccessor: IOptions_1): MemoryCache; new(optionsAccessor: IOptions_1, loggerFactory: ILoggerFactory): MemoryCache; }; export interface __MemoryCache$views { As_IMemoryCache(): IMemoryCache$instance; } export type MemoryCache = MemoryCache$instance & __MemoryCache$views; export interface MemoryCacheEntryOptions$instance { readonly __tsonic_type_Microsoft_Extensions_Caching_Memory_MemoryCacheEntryOptions: never; get AbsoluteExpiration(): Nullable_1; set AbsoluteExpiration(value: Nullable_1 | DateTimeOffset); get AbsoluteExpirationRelativeToNow(): Nullable_1; set AbsoluteExpirationRelativeToNow(value: Nullable_1 | TimeSpan); readonly ExpirationTokens: IList_1; readonly PostEvictionCallbacks: IList_1; Priority: CacheItemPriority; get Size(): Nullable_1; set Size(value: Nullable_1 | long); get SlidingExpiration(): Nullable_1; set SlidingExpiration(value: Nullable_1 | TimeSpan); } export const MemoryCacheEntryOptions: { new(): MemoryCacheEntryOptions; }; export type MemoryCacheEntryOptions = MemoryCacheEntryOptions$instance; export interface MemoryCacheOptions$instance extends Microsoft_Extensions_Options_Internal.IOptions_1$instance { readonly __tsonic_type_Microsoft_Extensions_Caching_Memory_MemoryCacheOptions: never; readonly __tsonic_iface_Microsoft_Extensions_Options_IOptions_1: never; get Clock(): ISystemClock | null; set Clock(value: ISystemClock | null); CompactionPercentage: double; CompactOnMemoryPressure: boolean; ExpirationScanFrequency: TimeSpan; get SizeLimit(): Nullable_1; set SizeLimit(value: Nullable_1 | long); TrackLinkedCacheEntries: boolean; TrackStatistics: boolean; } export const MemoryCacheOptions: { new(): MemoryCacheOptions; }; export interface __MemoryCacheOptions$views { As_IOptions_1(): Microsoft_Extensions_Options_Internal.IOptions_1$instance; } export type MemoryCacheOptions = MemoryCacheOptions$instance & __MemoryCacheOptions$views; export interface MemoryCacheStatistics$instance { readonly __tsonic_type_Microsoft_Extensions_Caching_Memory_MemoryCacheStatistics: never; CurrentEntryCount: long; get CurrentEstimatedSize(): Nullable_1; set CurrentEstimatedSize(value: Nullable_1 | long); TotalHits: long; TotalMisses: long; } export const MemoryCacheStatistics: { new(): MemoryCacheStatistics; }; export type MemoryCacheStatistics = MemoryCacheStatistics$instance; export interface MemoryDistributedCacheOptions$instance extends MemoryCacheOptions$instance, Microsoft_Extensions_Options_Internal.IOptions_1$instance { readonly __tsonic_type_Microsoft_Extensions_Caching_Memory_MemoryDistributedCacheOptions: never; readonly __tsonic_iface_Microsoft_Extensions_Options_IOptions_1: never; } export const MemoryDistributedCacheOptions: { new(): MemoryDistributedCacheOptions; }; export interface __MemoryDistributedCacheOptions$views { As_IOptions_1(): Microsoft_Extensions_Options_Internal.IOptions_1$instance; } export type MemoryDistributedCacheOptions = MemoryDistributedCacheOptions$instance & __MemoryDistributedCacheOptions$views; export interface PostEvictionCallbackRegistration$instance { readonly __tsonic_type_Microsoft_Extensions_Caching_Memory_PostEvictionCallbackRegistration: never; get EvictionCallback(): PostEvictionDelegate | null; set EvictionCallback(value: PostEvictionDelegate | null); get State(): unknown | null; set State(value: unknown | null); } export const PostEvictionCallbackRegistration: { new(): PostEvictionCallbackRegistration; }; export type PostEvictionCallbackRegistration = PostEvictionCallbackRegistration$instance; export abstract class CacheEntryExtensions$instance { static AddExpirationToken(entry: ICacheEntry, expirationToken: IChangeToken): ICacheEntry; static RegisterPostEvictionCallback(entry: ICacheEntry, callback: PostEvictionDelegate, state: unknown | null): ICacheEntry; static RegisterPostEvictionCallback(entry: ICacheEntry, callback: PostEvictionDelegate): ICacheEntry; static SetAbsoluteExpiration(entry: ICacheEntry, absolute: DateTimeOffset): ICacheEntry; static SetAbsoluteExpiration(entry: ICacheEntry, relative: TimeSpan): ICacheEntry; static SetOptions(entry: ICacheEntry, options: MemoryCacheEntryOptions): ICacheEntry; static SetPriority(entry: ICacheEntry, priority: CacheItemPriority): ICacheEntry; static SetSize(entry: ICacheEntry, size: long): ICacheEntry; static SetSlidingExpiration(entry: ICacheEntry, offset: TimeSpan): ICacheEntry; static SetValue(entry: ICacheEntry, value: unknown | null): ICacheEntry; } export type CacheEntryExtensions = CacheEntryExtensions$instance; export abstract class CacheExtensions$instance { static Get(cache: IMemoryCache, key: unknown): unknown | null; static Get(cache: IMemoryCache, key: unknown): TItem | null; static GetOrCreate(cache: IMemoryCache, key: unknown, factory: Func_2, createOptions: MemoryCacheEntryOptions | null): TItem | null; static GetOrCreate(cache: IMemoryCache, key: unknown, factory: Func_2): TItem | null; static GetOrCreateAsync(cache: IMemoryCache, key: unknown, factory: Func_2>, createOptions: MemoryCacheEntryOptions | null): Task_1; static GetOrCreateAsync(cache: IMemoryCache, key: unknown, factory: Func_2>): Task_1; static Set(cache: IMemoryCache, key: unknown, value: TItem, options: MemoryCacheEntryOptions | null): TItem; static Set(cache: IMemoryCache, key: unknown, value: TItem, expirationToken: IChangeToken): TItem; static Set(cache: IMemoryCache, key: unknown, value: TItem, absoluteExpiration: DateTimeOffset): TItem; static Set(cache: IMemoryCache, key: unknown, value: TItem, absoluteExpirationRelativeToNow: TimeSpan): TItem; static Set(cache: IMemoryCache, key: unknown, value: TItem): TItem; static TryGetValue(cache: IMemoryCache, key: unknown, value: TItem | null): boolean; } export type CacheExtensions = CacheExtensions$instance; export abstract class MemoryCacheEntryExtensions$instance { static AddExpirationToken(options: MemoryCacheEntryOptions, expirationToken: IChangeToken): MemoryCacheEntryOptions; static RegisterPostEvictionCallback(options: MemoryCacheEntryOptions, callback: PostEvictionDelegate, state: unknown | null): MemoryCacheEntryOptions; static RegisterPostEvictionCallback(options: MemoryCacheEntryOptions, callback: PostEvictionDelegate): MemoryCacheEntryOptions; static SetAbsoluteExpiration(options: MemoryCacheEntryOptions, absolute: DateTimeOffset): MemoryCacheEntryOptions; static SetAbsoluteExpiration(options: MemoryCacheEntryOptions, relative: TimeSpan): MemoryCacheEntryOptions; static SetPriority(options: MemoryCacheEntryOptions, priority: CacheItemPriority): MemoryCacheEntryOptions; static SetSize(options: MemoryCacheEntryOptions, size: long): MemoryCacheEntryOptions; static SetSlidingExpiration(options: MemoryCacheEntryOptions, offset: TimeSpan): MemoryCacheEntryOptions; } export type MemoryCacheEntryExtensions = MemoryCacheEntryExtensions$instance;