@@ -10,6 +10,32 @@ declare module '@azure/functions-core' {
10
10
*/
11
11
const version : string ;
12
12
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
+
13
39
/**
14
40
* Register a hook to interact with the lifecycle of Azure Functions.
15
41
* 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' {
32
58
interface HookContext {
33
59
/**
34
60
* 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
35
62
*/
36
- hookData : HookData ;
63
+ readonly hookData : HookData ;
37
64
/**
38
65
* 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
39
67
*/
40
- appHookData : HookData ;
68
+ readonly appHookData : HookData ;
41
69
}
42
70
43
71
/**
@@ -96,10 +124,6 @@ declare module '@azure/functions-core' {
96
124
* Absolute directory of the function app
97
125
*/
98
126
functionAppDirectory : string ;
99
- /**
100
- * The version of the host running the function app
101
- */
102
- hostVersion : string ;
103
127
}
104
128
105
129
/**
0 commit comments