Skip to content

EventGridOutput doesn't contain all types for typescript #177

Closed
@kubop

Description

@kubop

One way to define connection to an Event Grid is to use identity based connection, see documentation. However, when dealing with Typescript, the connection property doesn't seem to exist:

Argument of type '{ connection: string; }' is not assignable to parameter of type 'EventGridOutputOptions'.

Sample code:

const eventGridOutput = output.eventGrid({    
    connection: 'EmailServiceTopic'
})

Repro steps

  1. Create a .ts function
  2. Install the latest @azure/functions
  3. Define return function output:
import { app, output } from '@azure/functions';

const eventGridOutput = output.eventGrid({    
    connection: 'EmailServiceTopic'
})

app.serviceBusQueue('ACSEmailMessageQueueTrigger', {
    connection: 'ServiceBusEmailQueue',
    queueName: 'emailservice-queue',
    return: eventGridOutput,
    handler: ....
})

Expected behavior

EventGridOutputOptions type should contain connection property.

Actual behavior

Argument of type '{ connection: string; }' is not assignable to parameter of type 'EventGridOutputOptions'.

Known workarounds

Use Javascript instead of Typescript or suppress TS warnings.

Related information

NodeJS version 18.x
@azure/functions 4.0.1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions