FluidFramework/api-report/tool-utils.api.md

2.8 KiB

API Report File for "@fluidframework/tool-utils"

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


import { IClientConfig } from '@fluidframework/odsp-doclib-utils';
import { IOdspTokens } from '@fluidframework/odsp-doclib-utils';
import { ITree } from '@fluidframework/protocol-definitions';

// @public
export const gcBlobPrefix = "__gc";

// @public (undocumented)
export const getMicrosoftConfiguration: () => IClientConfig;

// @public
export function getNormalizedSnapshot(snapshot: ITree, config?: ISnapshotNormalizerConfig): ITree;

// @public (undocumented)
export interface IAsyncCache<TKey, TValue> {
    // (undocumented)
    get(key: TKey): Promise<TValue | undefined>;
    // (undocumented)
    lock<T>(callback: () => Promise<T>): Promise<T>;
    // (undocumented)
    save(key: TKey, value: TValue): Promise<void>;
}

// @public (undocumented)
export interface IOdspTokenManagerCacheKey {
    // (undocumented)
    readonly isPush: boolean;
    // (undocumented)
    readonly userOrServer: string;
}

// @public (undocumented)
export interface IResources {
    // (undocumented)
    tokens?: {
        version?: number;
        data: {
            [key: string]: {
                storage?: IOdspTokens;
                push?: IOdspTokens;
            };
        };
    };
}

// @public (undocumented)
export interface ISnapshotNormalizerConfig {
    // (undocumented)
    blobsToNormalize?: string[];
    excludedChannelContentTypes?: string[];
}

// @public (undocumented)
export function loadRC(): Promise<IResources>;

// @public (undocumented)
export function lockRC(): Promise<any>;

// @public (undocumented)
export type OdspTokenConfig = {
    type: "password";
    username: string;
    password: string;
} | {
    type: "browserLogin";
    navigator: (url: string) => void;
    redirectUriCallback?: (tokens: IOdspTokens) => Promise<string>;
};

// @public (undocumented)
export class OdspTokenManager {
    constructor(tokenCache?: IAsyncCache<IOdspTokenManagerCacheKey, IOdspTokens> | undefined);
    // (undocumented)
    getOdspTokens(server: string, clientConfig: IClientConfig, tokenConfig: OdspTokenConfig, forceRefresh?: boolean, forceReauth?: boolean): Promise<IOdspTokens>;
    // (undocumented)
    getPushTokens(server: string, clientConfig: IClientConfig, tokenConfig: OdspTokenConfig, forceRefresh?: boolean, forceReauth?: boolean): Promise<IOdspTokens>;
    // (undocumented)
    updateTokensCache(key: IOdspTokenManagerCacheKey, value: IOdspTokens): Promise<void>;
}

// @public (undocumented)
export const odspTokensCache: IAsyncCache<IOdspTokenManagerCacheKey, IOdspTokens>;

// @public (undocumented)
export function saveRC(rc: IResources): Promise<void>;

// (No @packageDocumentation comment for this package)