UNPKG

1.4 kBTypeScriptView Raw
1// Copyright (c) .NET Foundation. All rights reserved.
2// Licensed under the MIT License.
3
4import { HookContext, HookContextInit } from './HookContext';
5
6/**
7 * Handler for app start hooks
8 */
9export type AppStartHandler = (context: AppStartContext) => void | Promise<void>;
10
11/**
12 * Context on a function app during app startup.
13 */
14export declare class AppStartContext extends HookContext {
15 /**
16 * For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
17 */
18 constructor(init?: AppStartContextInit);
19}
20
21/**
22 * Handler for app terminate hooks
23 */
24export type AppTerminateHandler = (context: AppTerminateContext) => void | Promise<void>;
25
26/**
27 * Context on a function app during app termination.
28 */
29export declare class AppTerminateContext extends HookContext {
30 /**
31 * For testing purposes only. This will always be constructed for you when run in the context of the Azure Functions runtime
32 */
33 constructor(init?: AppTerminateContextInit);
34}
35
36/**
37 * Object passed to AppStartContext constructors.
38 * For testing purposes only
39 */
40export interface AppStartContextInit extends HookContextInit {}
41
42/**
43 * Object passed to AppTerminateContext constructors.
44 * For testing purposes only
45 */
46export interface AppTerminateContextInit extends HookContextInit {}