Skip to main content
Version: v2

@fluidframework/type-factory Package

Shared types for exposing schema methods and properties to an LLM agent.

Interfaces​

InterfaceAlertsDescription
ExposedMethodsAlphaAn interface for exposing methods of classes to an agent.
ExposedPropertiesAlphaAn interface for exposing properties of classes to an agent.
FunctionDefAlphaA function definition interface that describes the structure of a function.
IExposedMethodsAlphaAn interface that classes should implement to expose their methods to the LLM.
IExposedPropertiesAlphaAn interface that classes should implement to expose their properties to the LLM.
TypeFactoryArrayAlphaRepresents an array type in the type factory system.
TypeFactoryBooleanAlphaRepresents a boolean type in the type factory system.
TypeFactoryDateAlphaRepresents a Date type in the type factory system.
TypeFactoryFunctionAlphaRepresents a function type in the type factory system.
TypeFactoryInstanceOfAlphaRepresents an instanceof type that references a class in the type factory system.
TypeFactoryIntersectionAlphaRepresents an intersection type in the type factory system.
TypeFactoryLiteralAlphaRepresents a literal type (specific string, number, or boolean value) in the type factory system.
TypeFactoryMapAlphaRepresents a Map type in the type factory system.
TypeFactoryNullAlphaRepresents a null type in the type factory system.
TypeFactoryNumberAlphaRepresents a number type in the type factory system.
TypeFactoryObjectAlphaRepresents an object type with a fixed shape in the type factory system.
TypeFactoryOptionalAlphaRepresents an optional type modifier in the type factory system.
TypeFactoryPromiseAlphaRepresents a Promise type in the type factory system.
TypeFactoryReadonlyAlphaRepresents a readonly type modifier in the type factory system.
TypeFactoryRecordAlphaRepresents a record type (index signature) in the type factory system.
TypeFactoryStringAlphaRepresents a string type in the type factory system.
TypeFactoryTupleAlphaRepresents a tuple type with fixed-length items and optional rest elements in the type factory system.
TypeFactoryTypeAlphaBase interface for type factory types.
TypeFactoryUndefinedAlphaRepresents an undefined type in the type factory system.
TypeFactoryUnionAlphaRepresents a union type in the type factory system.
TypeFactoryUnknownAlphaRepresents an unknown type in the type factory system.
TypeFactoryVoidAlphaRepresents a void type in the type factory system.

Types​

TypeAliasAlertsDescription
ArgAlphaA type that represents a function argument.
ArgsTupleAlphaA utility type that extracts the argument types from a function definition.
CtorAlphaA type that represents a constructor function.
MethodKeysAlphaA utility type that extracts the method keys from a given type.
TypeFactoryFunctionParameterAlphaRepresents a function parameter as a tuple of [name, type].
TypeFactoryTypeKindAlphaType kinds for the type factory type system.

Functions​

FunctionAlertsReturn TypeDescription
buildFunc(def, args)AlphaFunctionDef<Args, Return, Rest>A utility function to build a function definition.
isTypeFactoryType(value)Alphavalue is TypeFactoryTypeType guard to check if a value is a type factory type.

Variables​

VariableAlertsModifiersTypeDescription
exposeMethodsSymbolAlphareadonlyunique symbolA symbol used to expose methods to the LLM.
exposePropertiesSymbolAlphareadonlyunique symbolA symbol used to expose properties to the LLM.

Function Details​

buildFunc​

A utility function to build a function definition.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/type-factory/alpha.

For more information about our API support guarantees, see here.

Signature​

export declare function buildFunc<const Return extends TypeFactoryType, const Args extends readonly Arg[], const Rest extends TypeFactoryType | null = null>(def: {
description?: string;
returns: Return;
rest?: Rest;
}, ...args: Args): FunctionDef<Args, Return, Rest>;
Type Parameters​
ParameterConstraintDefaultDescription
ReturnTypeFactoryType
Argsreadonly Arg[]
RestTypeFactoryType | nullnull

Parameters​

ParameterTypeDescription
def{ description?: string; returns: Return; rest?: Rest; }
argsArgs

Returns​

Return type: FunctionDef<Args, Return, Rest>

isTypeFactoryType​

Type guard to check if a value is a type factory type.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/type-factory/alpha.

For more information about our API support guarantees, see here.

Signature​

export declare function isTypeFactoryType(value: unknown): value is TypeFactoryType;

Parameters​

ParameterTypeDescription
valueunknown

Returns​

Return type: value is TypeFactoryType

Variable Details​

exposeMethodsSymbol​

A symbol used to expose methods to the LLM.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/type-factory/alpha.

For more information about our API support guarantees, see here.

Signature​

exposeMethodsSymbol: unique symbol

Type: unique symbol

exposePropertiesSymbol​

A symbol used to expose properties to the LLM.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/type-factory/alpha.

For more information about our API support guarantees, see here.

Signature​

exposePropertiesSymbol: unique symbol

Type: unique symbol