Skip to content

Commit

Permalink
feat: publish Config type (#423)
Browse files Browse the repository at this point in the history
Adds the `Config` type for the v2 API.
  • Loading branch information
Skn0tt authored Sep 22, 2023
1 parent ad630c0 commit 392f177
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/function/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export { HandlerContext } from './handler_context.js'
export { HandlerEvent } from './handler_event.js'
export { BuilderHandler, Handler, BackgroundHandler, HandlerCallback, StreamingHandler } from './handler.js'
export { BuilderResponse, HandlerResponse, StreamingResponse } from './handler_response.js'
export { Context } from './v2.js'
export { Context, Config } from './v2.js'
12 changes: 12 additions & 0 deletions src/function/v2.ts
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
export type { Context } from '@netlify/serverless-functions-api'

type Path = `/${string}`

type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'

type CronSchedule = string

export interface Config {
path?: Path | Path[]
method?: HTTPMethod | HTTPMethod[]
schedule?: CronSchedule
}

0 comments on commit 392f177

Please # to comment.