@fluidframework/type-factory Package
Shared types for exposing schema methods and properties to an LLM agent.
Interfaces
| Interface | Alerts | Description |
|---|---|---|
| ExposedMethods | Alpha | An interface for exposing methods of classes to an agent. |
| ExposedProperties | Alpha | An interface for exposing properties of classes to an agent. |
| FunctionDef | Alpha | A function definition interface that describes the structure of a function. |
| IExposedMethods | Alpha | An interface that classes should implement to expose their methods to the LLM. |
| IExposedProperties | Alpha | An interface that classes should implement to expose their properties to the LLM. |
| TypeFactoryArray | Alpha | Represents an array type in the type factory system. |
| TypeFactoryBoolean | Alpha | Represents a boolean type in the type factory system. |
| TypeFactoryDate | Alpha | Represents a Date type in the type factory system. |
| TypeFactoryFunction | Alpha | Represents a function type in the type factory system. |
| TypeFactoryInstanceOf | Alpha | Represents an instanceof type that references a class in the type factory system. |
| TypeFactoryIntersection | Alpha | Represents an intersection type in the type factory system. |
| TypeFactoryLiteral | Alpha | Represents a literal type (specific string, number, or boolean value) in the type factory system. |
| TypeFactoryMap | Alpha | Represents a Map type in the type factory system. |
| TypeFactoryNull | Alpha | Represents a null type in the type factory system. |
| TypeFactoryNumber | Alpha | Represents a number type in the type factory system. |
| TypeFactoryObject | Alpha | Represents an object type with a fixed shape in the type factory system. |
| TypeFactoryOptional | Alpha | Represents an optional type modifier in the type factory system. |
| TypeFactoryPromise | Alpha | Represents a Promise type in the type factory system. |
| TypeFactoryReadonly | Alpha | Represents a readonly type modifier in the type factory system. |
| TypeFactoryRecord | Alpha | Represents a record type (index signature) in the type factory system. |
| TypeFactoryString | Alpha | Represents a string type in the type factory system. |
| TypeFactoryTuple | Alpha | Represents a tuple type with fixed-length items and optional rest elements in the type factory system. |
| TypeFactoryType | Alpha | Base interface for type factory types. |
| TypeFactoryUndefined | Alpha | Represents an undefined type in the type factory system. |
| TypeFactoryUnion | Alpha | Represents a union type in the type factory system. |
| TypeFactoryUnknown | Alpha | Represents an unknown type in the type factory system. |
| TypeFactoryVoid | Alpha | Represents a void type in the type factory system. |
Types
| TypeAlias | Alerts | Description |
|---|---|---|
| Arg | Alpha | A type that represents a function argument. |
| ArgsTuple | Alpha | A utility type that extracts the argument types from a function definition. |
| Ctor | Alpha | A type that represents a constructor function. |
| MethodKeys | Alpha | A utility type that extracts the method keys from a given type. |
| TypeFactoryFunctionParameter | Alpha | Represents a function parameter as a tuple of [name, type]. |
| TypeFactoryTypeKind | Alpha | Type kinds for the type factory type system. |
Functions
| Function | Alerts | Return Type | Description |
|---|---|---|---|
| buildFunc(def, args) | Alpha | FunctionDef<Args, Return, Rest> | A utility function to build a function definition. |
| isTypeFactoryType(value) | Alpha | value is TypeFactoryType | Type guard to check if a value is a type factory type. |
Variables
| Variable | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| exposeMethodsSymbol | Alpha | readonly | unique symbol | A symbol used to expose methods to the LLM. |
| exposePropertiesSymbol | Alpha | readonly | unique symbol | A symbol used to expose properties to the LLM. |
Function Details
buildFunc
A utility function to build a function definition.
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
| Parameter | Constraint | Default | Description |
|---|---|---|---|
| Return | TypeFactoryType | ||
| Args | readonly Arg[] | ||
| Rest | TypeFactoryType | null | null |
Parameters
| Parameter | Type | Description |
|---|---|---|
| def | { description?: string; returns: Return; rest?: Rest; } | |
| args | Args |
Returns
Return type: FunctionDef<Args, Return, Rest>
isTypeFactoryType
Type guard to check if a value is a type factory type.
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
| Parameter | Type | Description |
|---|---|---|
| value | unknown |
Returns
Return type: value is TypeFactoryType
Variable Details
exposeMethodsSymbol
A symbol used to expose methods to the LLM.
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.
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