Skip to content

Latest commit

 

History

History
299 lines (267 loc) · 11.2 KB

map.api.md

File metadata and controls

299 lines (267 loc) · 11.2 KB

API Report File for "@fluidframework/map"

Do not edit this file. It is a report generated by API Extractor.

import { IChannelAttributes } from '@fluidframework/datastore-definitions';
import { IChannelFactory } from '@fluidframework/datastore-definitions';
import { IChannelServices } from '@fluidframework/datastore-definitions';
import { IChannelStorageService } from '@fluidframework/datastore-definitions';
import { IDisposable } from '@fluidframework/common-definitions';
import { IEvent } from '@fluidframework/common-definitions';
import { IEventProvider } from '@fluidframework/common-definitions';
import { IEventThisPlaceHolder } from '@fluidframework/common-definitions';
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
import { IFluidHandle } from '@fluidframework/core-interfaces';
import { IFluidSerializer } from '@fluidframework/shared-object-base';
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
import { ISharedObject } from '@fluidframework/shared-object-base';
import { ISharedObjectEvents } from '@fluidframework/shared-object-base';
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
import { SharedObject } from '@fluidframework/shared-object-base';

// @public @sealed
export class DirectoryFactory implements IChannelFactory {
    // (undocumented)
    static readonly Attributes: IChannelAttributes;
    // (undocumented)
    get attributes(): IChannelAttributes;
    // (undocumented)
    create(runtime: IFluidDataStoreRuntime, id: string): ISharedDirectory;
    // (undocumented)
    load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedDirectory>;
    // (undocumented)
    static readonly Type = "https://graph.microsoft.com/types/directory";
    // (undocumented)
    get type(): string;
}

// @public
export interface ICreateInfo {
    ccIds: string[];
    csn: number;
}

// @public
export interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {
    readonly absolutePath: string;
    countSubDirectory?(): number;
    createSubDirectory(subdirName: string): IDirectory;
    deleteSubDirectory(subdirName: string): boolean;
    get<T = any>(key: string): T | undefined;
    getSubDirectory(subdirName: string): IDirectory | undefined;
    getWorkingDirectory(relativePath: string): IDirectory | undefined;
    hasSubDirectory(subdirName: string): boolean;
    set<T = unknown>(key: string, value: T): this;
    subdirectories(): IterableIterator<[string, IDirectory]>;
}

// @public
export interface IDirectoryClearOperation {
    path: string;
    type: "clear";
}

// @public
export interface IDirectoryCreateSubDirectoryOperation {
    path: string;
    subdirName: string;
    type: "createSubDirectory";
}

// @public
export interface IDirectoryDataObject {
    ci?: ICreateInfo;
    storage?: {
        [key: string]: ISerializableValue;
    };
    subdirectories?: {
        [subdirName: string]: IDirectoryDataObject;
    };
}

// @public
export interface IDirectoryDeleteOperation {
    key: string;
    path: string;
    type: "delete";
}

// @public
export interface IDirectoryDeleteSubDirectoryOperation {
    path: string;
    subdirName: string;
    type: "deleteSubDirectory";
}

// @public
export interface IDirectoryEvents extends IEvent {
    (event: "containedValueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
    (event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
    (event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
    (event: "disposed", listener: (target: IEventThisPlaceHolder) => void): any;
    (event: "undisposed", listener: (target: IEventThisPlaceHolder) => void): any;
}

// @public
export type IDirectoryKeyOperation = IDirectorySetOperation | IDirectoryDeleteOperation;

// @internal
export interface IDirectoryNewStorageFormat {
    blobs: string[];
    content: IDirectoryDataObject;
}

// @public
export type IDirectoryOperation = IDirectoryStorageOperation | IDirectorySubDirectoryOperation;

// @public
export interface IDirectorySetOperation {
    key: string;
    path: string;
    type: "set";
    value: ISerializableValue;
}

// @public
export type IDirectoryStorageOperation = IDirectoryKeyOperation | IDirectoryClearOperation;

// @public
export type IDirectorySubDirectoryOperation = IDirectoryCreateSubDirectoryOperation | IDirectoryDeleteSubDirectoryOperation;

// @public
export interface IDirectoryValueChanged extends IValueChanged {
    path: string;
}

// @public
export interface ILocalValue {
    makeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue;
    readonly type: string;
    readonly value: any;
}

// @public @deprecated
export interface ISerializableValue {
    type: string;
    value: any;
}

// @public
export interface ISerializedValue {
    type: string;
    value: string | undefined;
}

// @public
export interface ISharedDirectory extends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>, Omit<IDirectory, "on" | "once" | "off"> {
    // (undocumented)
    [Symbol.iterator](): IterableIterator<[string, any]>;
    // (undocumented)
    readonly [Symbol.toStringTag]: string;
}

// @public
export interface ISharedDirectoryEvents extends ISharedObjectEvents {
    (event: "valueChanged", listener: (changed: IDirectoryValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
    (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
    (event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
    (event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
}

// @public
export interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
    get<T = any>(key: string): T | undefined;
    set<T = unknown>(key: string, value: T): this;
}

// @public
export interface ISharedMapEvents extends ISharedObjectEvents {
    (event: "valueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
    (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
}

// @public
export interface IValueChanged {
    key: string;
    previousValue: any;
}

// @public
export class LocalValueMaker {
    constructor(serializer: IFluidSerializer);
    fromInMemory(value: unknown): ILocalValue;
    fromSerializable(serializable: ISerializableValue): ILocalValue;
}

// @public @sealed
export class MapFactory implements IChannelFactory {
    // (undocumented)
    static readonly Attributes: IChannelAttributes;
    // (undocumented)
    get attributes(): IChannelAttributes;
    // (undocumented)
    create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap;
    // (undocumented)
    load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedMap>;
    // (undocumented)
    static readonly Type = "https://graph.microsoft.com/types/map";
    // (undocumented)
    get type(): string;
}

// @public @sealed
export class SharedDirectory extends SharedObject<ISharedDirectoryEvents> implements ISharedDirectory {
    [Symbol.iterator](): IterableIterator<[string, any]>;
    [Symbol.toStringTag]: string;
    constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
    get absolutePath(): string;
    // @internal (undocumented)
    protected applyStashedOp(op: unknown): unknown;
    clear(): void;
    countSubDirectory(): number;
    static create(runtime: IFluidDataStoreRuntime, id?: string): SharedDirectory;
    createSubDirectory(subdirName: string): IDirectory;
    delete(key: string): boolean;
    deleteSubDirectory(subdirName: string): boolean;
    // (undocumented)
    dispose(error?: Error): void;
    // (undocumented)
    get disposed(): boolean;
    entries(): IterableIterator<[string, any]>;
    forEach(callback: (value: any, key: string, map: Map<string, any>) => void): void;
    get<T = any>(key: string): T | undefined;
    static getFactory(): IChannelFactory;
    getSubDirectory(subdirName: string): IDirectory | undefined;
    getWorkingDirectory(relativePath: string): IDirectory | undefined;
    has(key: string): boolean;
    hasSubDirectory(subdirName: string): boolean;
    keys(): IterableIterator<string>;
    // @internal (undocumented)
    protected loadCore(storage: IChannelStorageService): Promise<void>;
    // @internal (undocumented)
    readonly localValueMaker: LocalValueMaker;
    // @internal (undocumented)
    protected onDisconnect(): void;
    // @internal
    protected populate(data: IDirectoryDataObject): void;
    // @internal (undocumented)
    protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
    // @internal (undocumented)
    protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
    // @internal (undocumented)
    protected rollback(content: unknown, localOpMetadata: unknown): void;
    set<T = unknown>(key: string, value: T): this;
    get size(): number;
    subdirectories(): IterableIterator<[string, IDirectory]>;
    // @internal
    submitDirectoryMessage(op: IDirectoryOperation, localOpMetadata: unknown): void;
    // @internal (undocumented)
    protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
    values(): IterableIterator<any>;
}

// @public
export class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
    [Symbol.iterator](): IterableIterator<[string, any]>;
    readonly [Symbol.toStringTag]: string;
    constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
    // @internal (undocumented)
    protected applyStashedOp(content: unknown): unknown;
    clear(): void;
    static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap;
    delete(key: string): boolean;
    entries(): IterableIterator<[string, any]>;
    forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void;
    get<T = any>(key: string): T | undefined;
    static getFactory(): IChannelFactory;
    has(key: string): boolean;
    keys(): IterableIterator<string>;
    // @internal (undocumented)
    protected loadCore(storage: IChannelStorageService): Promise<void>;
    // @internal (undocumented)
    protected onDisconnect(): void;
    // @internal (undocumented)
    protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
    // @internal (undocumented)
    protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
    // @internal (undocumented)
    protected rollback(content: unknown, localOpMetadata: unknown): void;
    set(key: string, value: unknown): this;
    get size(): number;
    // @internal (undocumented)
    protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
    values(): IterableIterator<any>;
}