1 |
|
2 |
|
3 |
|
4 | import * as types from '@azure/functions';
|
5 | import { nonNullProp } from '../utils/nonNull';
|
6 | import { InvocationHookContext } from './InvocationHookContext';
|
7 |
|
8 | export class PreInvocationContext extends InvocationHookContext implements types.PreInvocationContext {
|
9 | #init: types.PreInvocationContextInit;
|
10 |
|
11 | constructor(init?: types.PreInvocationContextInit) {
|
12 | super(init);
|
13 | this.#init = init ?? {};
|
14 | this.#init.functionCallback ??= () => {};
|
15 | }
|
16 |
|
17 | get functionHandler(): types.FunctionHandler {
|
18 | return nonNullProp(this.#init, 'functionCallback');
|
19 | }
|
20 |
|
21 | set functionHandler(value: types.FunctionHandler) {
|
22 | this.#init.functionCallback = value;
|
23 | }
|
24 | }
|