UNPKG

1.26 kBTypeScriptView Raw
1// Copyright (c) .NET Foundation. All rights reserved.
2// Licensed under the MIT License.
3
4import { Context } from './Context';
5
6export * from './Context';
7export * from './http';
8export * from './timer';
9
10/**
11 * Sets the programming model contained in this package to be the one used by the Azure Functions worker
12 */
13export declare function setup(): void;
14
15/**
16 * Interface for your Azure Function code. This function must be exported (via module.exports or exports)
17 * and will execute when triggered. It is recommended that you declare this function as async, which
18 * implicitly returns a Promise.
19 * @param context Context object passed to your function from the Azure Functions runtime.
20 * @param {any[]} args Optional array of input and trigger binding data. These binding data are passed to the
21 * function in the same order that they are defined in function.json. Valid input types are string, HttpRequest,
22 * and Buffer.
23 * @returns Output bindings (optional). If you are returning a result from a Promise (or an async function), this
24 * result will be passed to JSON.stringify unless it is a string, Buffer, ArrayBufferView, or number.
25 */
26export type AzureFunction = (context: Context, ...args: any[]) => Promise<any> | void;