/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService } from "@fluidframework/datastore-definitions/internal"; import type { ISummaryTreeWithStats, ITelemetryContext, IRuntimeMessageCollection } from "@fluidframework/runtime-definitions/internal"; import type { IFluidSerializer } from "@fluidframework/shared-object-base/internal"; import { SharedObject } from "@fluidframework/shared-object-base/internal"; import type { ISharedMap, ISharedMapEvents } from "./interfaces.js"; /** * {@inheritDoc ISharedMap} */ export declare class SharedMap extends SharedObject implements ISharedMap { /** * String representation for the class. */ readonly [Symbol.toStringTag]: string; /** * MapKernel which manages actual map operations. */ private readonly kernel; /** * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}. * * @param id - String identifier. * @param runtime - Data store runtime. * @param attributes - The attributes for the map. */ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes); /** * Get an iterator over the keys in this map. * @returns The iterator */ keys(): IterableIterator; /** * Get an iterator over the entries in this map. * @returns The iterator */ entries(): IterableIterator<[string, any]>; /** * Get an iterator over the values in this map. * @returns The iterator */ values(): IterableIterator; /** * Get an iterator over the entries in this map. * @returns The iterator */ [Symbol.iterator](): IterableIterator<[string, any]>; /** * The number of key/value pairs stored in the map. */ get size(): number; /** * Executes the given callback on each entry in the map. * @param callbackFn - Callback function */ forEach(callbackFn: (value: any, key: string, map: Map) => void): void; /** * {@inheritDoc ISharedMap.get} */ get(key: string): T | undefined; /** * Check if a key exists in the map. * @param key - The key to check * @returns True if the key exists, false otherwise */ has(key: string): boolean; /** * {@inheritDoc ISharedMap.set} */ set(key: string, value: unknown): this; /** * Delete a key from the map. * @param key - Key to delete * @returns True if the key existed and was deleted, false if it did not exist */ delete(key: string): boolean; /** * Clear all data from the map. */ clear(): void; /** * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore} */ protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats; /** * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore} */ protected loadCore(storage: IChannelStorageService): Promise; /** * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect} */ protected onDisconnect(): void; /** * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore} */ protected reSubmitCore(content: unknown, localOpMetadata: unknown): void; /** * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp} */ protected applyStashedOp(content: unknown): void; protected processMessagesCore(messagesCollection: IRuntimeMessageCollection): void; private processMessage; /** * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback} */ protected rollback(content: unknown, localOpMetadata: unknown): void; } //# sourceMappingURL=map.d.ts.map