/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { IChannelAttributes, IChannelFactory, IFluidDataStoreRuntime, IChannelServices } from "@fluidframework/datastore-definitions/internal"; import { type ISharedObjectKind, type SharedObjectKind } from "@fluidframework/shared-object-base/internal"; import type { ISharedString, SharedStringSegment } from "./sharedString.js"; import { SharedStringClass } from "./sharedString.js"; /** * Options for SharedString factories created by {@link configuredSharedString}. * @legacy @beta */ export interface SharedStringOptions { /** * Selects the summary format for SharedStrings created or loaded by the factory. * * @remarks * `true` selects the flat format, and `false` selects the legacy format. * When omitted, the runtime option takes precedence over the loaded snapshot format. * New SharedStrings use the legacy format by default. * * The `Fluid.Sequence.newMergeTreeSnapshotFormat` configuration flag overrides this factory option. * This factory option overrides the `newMergeTreeSnapshotFormat` runtime option. * Configuration and runtime options are expected to stay fixed for each DDS instance. * Format selection does not force an otherwise unchanged DDS to generate a new summary. */ readonly newMergeTreeSnapshotFormat?: boolean; } export declare class SharedStringFactory implements IChannelFactory { static Type: string; static readonly Attributes: IChannelAttributes; private readonly options; constructor(options?: SharedStringOptions); static segmentFromSpec(spec: any): SharedStringSegment; get type(): string; get attributes(): IChannelAttributes; load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise; create(document: IFluidDataStoreRuntime, id: string): SharedStringClass; } /** * Creates a SharedString kind with factory-level options. * * @param options - Options applied to SharedStrings created or loaded by the returned kind's factory. * @returns A SharedString kind to register in place of the default `SharedString`. * * @remarks * The kind uses the same DDS type and summary formats as `SharedString`. * The options are captured when this function is called. * Each registered factory applies its configuration independently of other clients' factories. * * @example * ```typescript * const ConfiguredSharedString = configuredSharedString({ * newMergeTreeSnapshotFormat: true, * }); * const factory = ConfiguredSharedString.getFactory(); * ``` * * @legacy @beta */ export declare function configuredSharedString(options: SharedStringOptions): ISharedObjectKind & SharedObjectKind; /** * Entrypoint for {@link ISharedString} creation. * @legacy @beta */ export declare const SharedString: ISharedObjectKind & SharedObjectKind; /** * Alias for {@link ISharedString} for compatibility. * @legacy @beta */ export type SharedString = ISharedString; //# sourceMappingURL=sequenceFactory.d.ts.map