/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { IFluidDependencySynthesizer } from "./IFluidDependencySynthesizer.js"; /** * This is a condensed version of Record that requires the object has all * the FluidObject properties as its type mapped to a string representation * of that property. * * @example * * ```typescript * { IFoo: "IFoo" } * ``` * @legacy @beta */ export type FluidObjectSymbolProvider = { [P in keyof T]?: P; }; /** * This is a condensed version of Record that requires the object has all * the FluidObject properties as its type mapped to an object that implements * the property. * @legacy @beta */ export type AsyncRequiredFluidObjectProvider = T extends undefined ? Record : { // eslint-disable-next-line @rushstack/no-new-null -- supported by JavaScript; it isn't deprecated [P in keyof T]: Promise>>; }; /** * This is a condensed version of Record that requires the object has all * the FluidObject properties as its type, mapped to an object that implements * the property or undefined. * @legacy @beta */ export type AsyncOptionalFluidObjectProvider = T extends undefined ? Record : { [P in keyof T]?: Promise; }; /** * Combined type for Optional and Required Async Fluid object Providers * @legacy @beta */ export type AsyncFluidObjectProvider = AsyncOptionalFluidObjectProvider & AsyncRequiredFluidObjectProvider; /** * Multiple ways to provide a Fluid object. * @legacy @beta */ export type FluidObjectProvider = | NonNullable | Promise> | ((dependencyContainer: IFluidDependencySynthesizer) => NonNullable) | ((dependencyContainer: IFluidDependencySynthesizer) => Promise>);