@fluidframework/runtime-utils Package
Classes
Class | Alerts | Description |
---|---|---|
FluidHandleBase | Legacy |
Base class which can be uses to assist implementing IFluidHandleInternal. |
RequestParser | Legacy |
The Request Parser takes an IRequest provides parsing and sub request creation |
RuntimeFactoryHelper | Legacy |
|
SummaryTreeBuilder | Legacy |
A helper class for building summary trees. |
Functions
Function | Alerts | Return Type | Description |
---|---|---|---|
compareFluidHandles(a, b) | boolean | Compare two IFluidHandles. | |
convertToSummaryTreeWithStats(snapshot, fullTree) | Legacy |
ISummaryTreeWithStats | Converts snapshot ITree to ISummaryTree format and tracks stats. |
create404Response(request) | Legacy |
IResponse | Creates a 404 "not found" response for the given request |
isFluidHandle(value) | value is IFluidHandle | Check if a value is an @fluidframework/core-interfaces#IFluidHandle. | |
isFluidHandlePayloadPending(handle) | Legacy |
handle is IFluidHandlePayloadPending<T> | Check if the handle is an IFluidHandlePayloadPending. |
isLocalFluidHandle(handle) | Legacy |
handle is ILocalFluidHandle<T> | Check if the handle is an ILocalFluidHandle. |
lookupTemporaryBlobStorageId(containerRuntime, handle) | Legacy |
string | undefined | Lookup the blob storage ID for a blob handle. |
toDeltaManagerInternal(deltaManager) | Legacy |
IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> | Casts the public API for delta manager into the internal one, exposing access to APIs needed by the implementation of Fluid Framework but not its users. |
toFluidHandleErased(handle) | Legacy |
IFluidHandleErased<T> | Type erase IFluidHandleInternal for use with fluidHandleSymbol. |
toFluidHandleInternal(handle) | Legacy |
IFluidHandleInternal<T> | Downcast an IFluidHandle to an IFluidHandleInternal. |
Function Details
compareFluidHandles
Compare two IFluidHandles.
Signature
export declare function compareFluidHandles(a: IFluidHandle, b: IFluidHandle): boolean;
Remarks
Returns true iff both handles have the same internal absolutePath
.
Parameters
Parameter | Type | Description |
---|---|---|
a | IFluidHandle | |
b | IFluidHandle |
Returns
Return type: boolean
convertToSummaryTreeWithStats
Converts snapshot ITree to ISummaryTree format and tracks stats.
To use, import via @fluidframework/runtime-utils/legacy
.
For more information about our API support guarantees, see here.
Signature
export declare function convertToSummaryTreeWithStats(snapshot: ITree, fullTree?: boolean): ISummaryTreeWithStats;
Parameters
Parameter | Modifiers | Type | Description |
---|---|---|---|
snapshot | ITree | snapshot in ITree format | |
fullTree | optional | boolean | true to never use handles, even if id is specified |
Returns
Return type: ISummaryTreeWithStats
create404Response
Creates a 404 "not found" response for the given request
To use, import via @fluidframework/runtime-utils/legacy
.
For more information about our API support guarantees, see here.
Signature
create404Response: (request: IRequest) => IResponse
Parameters
Parameter | Type | Description |
---|---|---|
request | IRequest | The request that resulted in the 404 response |
Returns
An IResponse with 404 status code. \
Return type: IResponse
isFluidHandle
Check if a value is an @fluidframework/core-interfaces#IFluidHandle.
Signature
export declare function isFluidHandle(value: unknown): value is IFluidHandle;
Remarks
Objects which have a field named IFluidHandle
can in some cases produce a false positive.
Parameters
Parameter | Type | Description |
---|---|---|
value | unknown |
Returns
Return type: value is IFluidHandle
isFluidHandlePayloadPending
Check if the handle is an IFluidHandlePayloadPending. \
To use, import via @fluidframework/runtime-utils/legacy
.
For more information about our API support guarantees, see here.
Signature
isFluidHandlePayloadPending: <T>(handle: IFluidHandle<T>) => handle is IFluidHandlePayloadPending<T>
Type Parameters
Parameter | Description |
---|---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
handle | IFluidHandle<T> |
Returns
Return type: handle is IFluidHandlePayloadPending<T>
isLocalFluidHandle
Check if the handle is an ILocalFluidHandle. \
To use, import via @fluidframework/runtime-utils/legacy
.
For more information about our API support guarantees, see here.
Signature
isLocalFluidHandle: <T>(handle: IFluidHandle<T>) => handle is ILocalFluidHandle<T>
Type Parameters
Parameter | Description |
---|---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
handle | IFluidHandle<T> |
Returns
Return type: handle is ILocalFluidHandle<T>
lookupTemporaryBlobStorageId
Lookup the blob storage ID for a blob handle.
To use, import via @fluidframework/runtime-utils/legacy
.
For more information about our API support guarantees, see here.
Signature
export declare function lookupTemporaryBlobStorageId(containerRuntime: IContainerRuntime, handle: IFluidHandle): string | undefined;
Remarks
This is a legacy+alpha helper function that provides access to blob storage IDs. For blobs with pending payloads (localId exists but upload hasn't finished), this is expected to return undefined. Consumers should use the observability APIs on the handle (handle.payloadState, payloadShared event) to understand/wait for storage ID availability. Similarly, when the runtime is detached, this will return undefined as no blobs have been uploaded to storage.
Warning: the returned blob URL may expire and does not support permalinks. This API is intended for temporary integration scenarios only.
Parameters
Parameter | Type | Description |
---|---|---|
containerRuntime | IContainerRuntime | The container runtime instance |
handle | IFluidHandle | The blob handle to lookup the storage ID for |
Returns
The storage ID if found and the blob is not pending, undefined otherwise \
Return type: string | undefined
toDeltaManagerInternal
Casts the public API for delta manager into the internal one, exposing access to APIs needed by the implementation of Fluid Framework but not its users. \
To use, import via @fluidframework/runtime-utils/legacy
.
For more information about our API support guarantees, see here.
Signature
export declare function toDeltaManagerInternal(deltaManager: IDeltaManagerErased): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
Parameters
Parameter | Type | Description |
---|---|---|
deltaManager | IDeltaManagerErased |
Returns
Return type: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
toFluidHandleErased
Type erase IFluidHandleInternal for use with fluidHandleSymbol. \
To use, import via @fluidframework/runtime-utils/legacy
.
For more information about our API support guarantees, see here.
Signature
export declare function toFluidHandleErased<T>(handle: IFluidHandleInternal<T>): IFluidHandleErased<T>;
Type Parameters
Parameter | Description |
---|---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
handle | IFluidHandleInternal<T> |
Returns
Return type: IFluidHandleErased<T>
toFluidHandleInternal
Downcast an IFluidHandle to an IFluidHandleInternal. \
To use, import via @fluidframework/runtime-utils/legacy
.
For more information about our API support guarantees, see here.
Signature
export declare function toFluidHandleInternal<T>(handle: IFluidHandle<T>): IFluidHandleInternal<T>;
Type Parameters
Parameter | Description |
---|---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
handle | IFluidHandle<T> |
Returns
Return type: IFluidHandleInternal<T>