UNPKG

10.4 kBTypeScriptView Raw
1// Copyright (c) .NET Foundation. All rights reserved.
2// Licensed under the MIT License.
3
4import { CosmosDBFunctionOptions } from './cosmosDB';
5import { EventGridFunctionOptions } from './eventGrid';
6import { EventHubFunctionOptions } from './eventHub';
7import { GenericFunctionOptions } from './generic';
8import { HttpFunctionOptions, HttpHandler, HttpMethodFunctionOptions } from './http';
9import { ServiceBusQueueFunctionOptions, ServiceBusTopicFunctionOptions } from './serviceBus';
10import { StorageBlobFunctionOptions, StorageQueueFunctionOptions } from './storage';
11import { TimerFunctionOptions } from './timer';
12import { WarmupFunctionOptions } from './warmup';
13
14/**
15 * Registers an http function in your app that will be triggered by making a request to the function url
16 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
17 * @param options Configuration options describing the inputs, outputs, and handler for this function
18 */
19export function http(name: string, options: HttpFunctionOptions): void;
20
21/**
22 * Registers an http function in your app that will be triggered by making a 'GET' request to the function url
23 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
24 * @param handler The handler for this function
25 */
26export function get(name: string, handler: HttpHandler): void;
27
28/**
29 * Registers an http function in your app that will be triggered by making a 'GET' request to the function url
30 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
31 * @param options Configuration options describing the inputs, outputs, and handler for this function
32 */
33export function get(name: string, options: HttpMethodFunctionOptions): void;
34
35/**
36 * Registers an http function in your app that will be triggered by making a 'PUT' request to the function url
37 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
38 * @param handler The handler for this function
39 */
40export function put(name: string, handler: HttpHandler): void;
41
42/**
43 * Registers an http function in your app that will be triggered by making a 'PUT' request to the function url
44 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
45 * @param options Configuration options describing the inputs, outputs, and handler for this function
46 */
47export function put(name: string, options: HttpMethodFunctionOptions): void;
48
49/**
50 * Registers an http function in your app that will be triggered by making a 'POST' request to the function url
51 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
52 * @param handler The handler for this function
53 */
54export function post(name: string, handler: HttpHandler): void;
55
56/**
57 * Registers an http function in your app that will be triggered by making a 'POST' request to the function url
58 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
59 * @param options Configuration options describing the inputs, outputs, and handler for this function
60 */
61export function post(name: string, options: HttpMethodFunctionOptions): void;
62
63/**
64 * Registers an http function in your app that will be triggered by making a 'PATCH' request to the function url
65 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
66 * @param handler The handler for this function
67 */
68export function patch(name: string, handler: HttpHandler): void;
69
70/**
71 * Registers an http function in your app that will be triggered by making a 'PATCH' request to the function url
72 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
73 * @param options Configuration options describing the inputs, outputs, and handler for this function
74 */
75export function patch(name: string, options: HttpMethodFunctionOptions): void;
76
77/**
78 * Registers an http function in your app that will be triggered by making a 'DELETE' request to the function url
79 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
80 * @param handler The handler for this function
81 */
82export function deleteRequest(name: string, handler: HttpHandler): void;
83
84/**
85 * Registers an http function in your app that will be triggered by making a 'DELETE' request to the function url
86 * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`
87 * @param options Configuration options describing the inputs, outputs, and handler for this function
88 */
89export function deleteRequest(name: string, options: HttpMethodFunctionOptions): void;
90
91/**
92 * Registers a timer function in your app that will be triggered on a schedule
93 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
94 * @param options Configuration options describing the inputs, outputs, and handler for this function
95 */
96export function timer(name: string, options: TimerFunctionOptions): void;
97
98/**
99 * Registers a function in your app that will be triggered whenever an item is added to a storage blob path
100 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
101 * @param options Configuration options describing the inputs, outputs, and handler for this function
102 */
103export function storageBlob(name: string, options: StorageBlobFunctionOptions): void;
104
105/**
106 * Registers a function in your app that will be triggered whenever an item is added to a storage queue
107 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
108 * @param options Configuration options describing the inputs, outputs, and handler for this function
109 */
110export function storageQueue(name: string, options: StorageQueueFunctionOptions): void;
111
112/**
113 * Registers a function in your app that will be triggered whenever a message is added to a service bus queue
114 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
115 * @param options Configuration options describing the inputs, outputs, and handler for this function
116 */
117export function serviceBusQueue(name: string, options: ServiceBusQueueFunctionOptions): void;
118
119/**
120 * Registers a function in your app that will be triggered whenever a message is added to a service bus topic
121 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
122 * @param options Configuration options describing the inputs, outputs, and handler for this function
123 */
124export function serviceBusTopic(name: string, options: ServiceBusTopicFunctionOptions): void;
125
126/**
127 * Registers a function in your app that will be triggered whenever a message is added to an event hub
128 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
129 * @param options Configuration options describing the inputs, outputs, and handler for this function
130 */
131export function eventHub(name: string, options: EventHubFunctionOptions): void;
132
133/**
134 * Registers a function in your app that will be triggered whenever an event is sent by an event grid source
135 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
136 * @param options Configuration options describing the inputs, outputs, and handler for this function
137 */
138export function eventGrid(name: string, options: EventGridFunctionOptions): void;
139
140/**
141 * Registers a Cosmos DB function in your app that will be triggered whenever inserts and updates occur (not deletions)
142 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
143 * @param options Configuration options describing the inputs, outputs, and handler for this function
144 */
145export function cosmosDB(name: string, options: CosmosDBFunctionOptions): void;
146
147/**
148 * Registers a function in your app that will be triggered when an instance is added to scale a running function app.
149 * The warmup trigger is only called during scale-out operations, not during restarts or other non-scale startups.
150 * Make sure your logic can load all required dependencies without relying on the warmup trigger.
151 * Lazy loading is a good pattern to achieve this goal.
152 * The warmup trigger isn't available to apps running on the Consumption plan.
153 * For more information, please see the [Azure Functions warmup trigger documentation](https://learn.microsoft.com/azure/azure-functions/functions-bindings-warmup?tabs=isolated-process&pivots=programming-language-javascript).
154 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
155 * @param options Configuration options describing the inputs, outputs, and handler for this function
156 */
157export function warmup(name: string, options: WarmupFunctionOptions): void;
158
159/**
160 * Registers a generic function in your app that will be triggered based on the type specified in `options.trigger.type`
161 * Use this method if your desired trigger type does not already have its own method
162 * @param name The name of the function. The name must be unique within your app and will mostly be used for your own tracking purposes
163 * @param options Configuration options describing the inputs, outputs, and handler for this function
164 */
165export function generic(name: string, options: GenericFunctionOptions): void;
166
167export * as hook from './hooks/registerHook';