Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions types/eventGrid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { FunctionOptions, FunctionOutput, FunctionResult, FunctionTrigger } from './index';
import { InvocationContext } from './InvocationContext';
import { Either } from './utils/either';

export type EventGridHandler = (event: EventGridEvent, context: InvocationContext) => FunctionResult;

Expand Down Expand Up @@ -31,12 +32,11 @@ export interface EventGridOutputKeyOptions {
}
export interface EventGridOutputConnectionOptions {
/**
* The value of the common prefix for the app setting that contains the `topicEndpointUri`.
* When setting the `connection` property, the `topicEndpointUri` and `topicKeySetting` properties should NOT be set.
* The value of the common prefix for the app setting that contains the `topicEndpointUri`
*/
connection: string;
}
export type EventGridOutputOptions = EventGridOutputKeyOptions | EventGridOutputConnectionOptions;
export type EventGridOutputOptions = Either<EventGridOutputKeyOptions, EventGridOutputConnectionOptions>;
export type EventGridOutput = FunctionOutput & EventGridOutputOptions;

/**
Expand Down
3 changes: 3 additions & 0 deletions types/utils/either.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type Only<T, U> = { [P in keyof T]: T[P] } & { [P in keyof U]?: never };

export type Either<T, U> = Only<T, U> | Only<U, T>;