@@ -10,6 +10,32 @@ declare module '@azure/functions-core' {
1010 */
1111 const version : string ;
1212
13+ /**
14+ * The version of the Functions Host
15+ */
16+ const hostVersion : string ;
17+
18+ /**
19+ * Register a function
20+ * This is a preview feature and requires the feature flag `EnableWorkerIndexing` to be set in the app setting `AzureWebJobsFeatureFlags`
21+ */
22+ function registerFunction ( metadata : FunctionMetadata , callback : FunctionCallback ) : Disposable ;
23+
24+ /**
25+ * A slimmed down version of `RpcFunctionMetadata` that includes the minimum amount of information needed to register a function
26+ */
27+ interface FunctionMetadata {
28+ /**
29+ * The function name
30+ */
31+ name : string ;
32+
33+ /**
34+ * A dictionary of binding name to binding info
35+ */
36+ bindings : { [ name : string ] : RpcBindingInfo } ;
37+ }
38+
1339 /**
1440 * Register a hook to interact with the lifecycle of Azure Functions.
1541 * Hooks are executed in the order they were registered and will block execution if they throw an error
@@ -32,12 +58,14 @@ declare module '@azure/functions-core' {
3258 interface HookContext {
3359 /**
3460 * The recommended place to share data between hooks in the same scope (app-level vs invocation-level)
61+ * This object is readonly and attempting to overwrite it will throw an error
3562 */
36- hookData : HookData ;
63+ readonly hookData : HookData ;
3764 /**
3865 * The recommended place to share data across scopes for all hooks
66+ * This object is readonly and attempting to overwrite it will throw an error
3967 */
40- appHookData : HookData ;
68+ readonly appHookData : HookData ;
4169 }
4270
4371 /**
@@ -96,10 +124,6 @@ declare module '@azure/functions-core' {
96124 * Absolute directory of the function app
97125 */
98126 functionAppDirectory : string ;
99- /**
100- * The version of the host running the function app
101- */
102- hostVersion : string ;
103127 }
104128
105129 /**
0 commit comments