Skip to main content
Version: v2

ExposedMethods Interface

An interface for exposing methods of classes to an agent.

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 interface ExposedMethods

Methods​

MethodAlertsReturn TypeDescription
expose(constructor, methodName, tfFunction)AlphavoidExpose a method with type factory types.
exposeMethod(constructor, methodName, tfFunction)AlphavoidExpose a method with type factory types.

Method Details​

expose​

Expose a method with type factory types.

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

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

Signature​

expose<const K extends string & keyof MethodKeys<InstanceType<S>>, S extends Ctor & IExposedMethods, Z extends FunctionDef<readonly Arg[], TypeFactoryType, TypeFactoryType | null>>(constructor: S, methodName: K, tfFunction: Z): void;
Type Parameters​
ParameterConstraintDescription
Kstring & keyof MethodKeys<InstanceType<S>>
SCtor & IExposedMethods
ZFunctionDef<readonly Arg[], TypeFactoryType, TypeFactoryType | null>

Parameters​

ParameterTypeDescription
constructorS
methodNameK
tfFunctionZ

exposeMethod​

Expose a method with type factory types.

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

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

Signature​

exposeMethod<const K extends string & keyof MethodKeys<InstanceType<S>>, S extends Ctor & IExposedMethods, Z extends FunctionDef<readonly Arg[], TypeFactoryType, TypeFactoryType | null>>(constructor: S, methodName: K, tfFunction: Z): void;
Type Parameters​
ParameterConstraintDescription
Kstring & keyof MethodKeys<InstanceType<S>>
SCtor & IExposedMethods
ZFunctionDef<readonly Arg[], TypeFactoryType, TypeFactoryType | null>

Parameters​

ParameterTypeDescription
constructorS
methodNameK
tfFunctionZ