@fluidframework/synthesize Package
Packages > @fluidframework/synthesize
Classes
Class | Description |
---|---|
DependencyContainer | DependencyContainer is similar to a IoC Container. It takes providers and will synthesize an object based on them when requested. |
Interfaces
Interface | Description |
---|---|
IFluidDependencySynthesizer | IFluidDependencySynthesizer can generate IFluidObjects based on the IProvideFluidObject pattern. It allow for registering providers and uses synthesize to generate a new object with the optional and required types. |
IProvideFluidDependencySynthesizer | |
ProviderEntry | ProviderEntry is a mapping of the type to the Provider |
Variables
Variable | Description |
---|---|
IFluidDependencySynthesizer |
Type Aliases
Type Alias | Description |
---|---|
AsyncFluidObjectProvider | Combined type for Optional and Required Async Fluid object Providers |
AsyncOptionalFluidObjectProvider | This is a condensed version of Record that requires the object has all the IFluidObject properties as its type, mapped to an object that implements the property or undefined. |
AsyncRequiredFluidObjectProvider | This is a condensed version of Record that requires the object has all the IFluidObject properties as its type mapped to an object that implements the property. |
DependencyContainerRegistry | A mapping of ProviderEntries |
FluidObjectKey | |
FluidObjectProvider | Multiple ways to provide a Fluid object. |
FluidObjectSymbolProvider | This is a condensed version of Record that requires the object has all the IFluidObject properties as its type mapped to a string representation of that property. |
NonNullableFluidObject | Provided a keyof IFluidObject will ensure the type is an instance of that type |
Variables
IFluidDependencySynthesizer
Signature:
IFluidDependencySynthesizer: keyof IProvideFluidDependencySynthesizer
Type Aliases
AsyncFluidObjectProvider
Combined type for Optional and Required Async Fluid object Providers
Signature:
export declare type AsyncFluidObjectProvider<O extends keyof IFluidObject, R extends keyof IFluidObject> = AsyncOptionalFluidObjectProvider<O> & AsyncRequiredFluidObjectProvider<R>;
AsyncOptionalFluidObjectProvider
This is a condensed version of Record that requires the object has all the IFluidObject properties as its type, mapped to an object that implements the property or undefined.
Signature:
export declare type AsyncOptionalFluidObjectProvider<T extends keyof IFluidObject> = {
[P in T]: Promise<IFluidObject[P] | undefined>;
};
AsyncRequiredFluidObjectProvider
This is a condensed version of Record that requires the object has all the IFluidObject properties as its type mapped to an object that implements the property.
Signature:
export declare type AsyncRequiredFluidObjectProvider<T extends keyof IFluidObject> = {
[P in T]: Promise<NonNullable<IFluidObject[P]>>;
};
DependencyContainerRegistry
A mapping of ProviderEntries
Signature:
export declare type DependencyContainerRegistry = Iterable<ProviderEntry<any>>;
FluidObjectKey
Signature:
export declare type FluidObjectKey<T extends IFluidObject> = keyof T & keyof IFluidObject;
FluidObjectProvider
Multiple ways to provide a Fluid object.
Signature:
export declare type FluidObjectProvider<T extends keyof IFluidObject> = NonNullableFluidObject<T> | Promise<NonNullableFluidObject<T>> | ((dependencyContainer: DependencyContainer) => NonNullableFluidObject<T>) | ((dependencyContainer: DependencyContainer) => Promise<NonNullableFluidObject<T>>);
FluidObjectSymbolProvider
This is a condensed version of Record that requires the object has all the IFluidObject properties as its type mapped to a string representation of that property.
Signature:
export declare type FluidObjectSymbolProvider<T extends IFluidObject> = {
[P in FluidObjectKey<T>]: FluidObjectKey<T> & P;
};
Example
- { IFoo: “IFoo” }
NonNullableFluidObject
Provided a keyof IFluidObject will ensure the type is an instance of that type
Signature:
export declare type NonNullableFluidObject<T extends keyof IFluidObject> = NonNullable<IFluidObject[T]>;