Skip to content

Commit

Permalink
Set up typing
Browse files Browse the repository at this point in the history
  • Loading branch information
kjellmorten committed Apr 13, 2020
1 parent da9a77a commit ed24e72
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Definitions file for integreat-adapter-mongodb
import { MongoClient } from 'mongodb'

export interface Connection {
status: string
error?: string
client?: MongoClient
}

export interface Response {
status: string
error?: string
data?: object[]
}

export interface Adapter {
authentication?: string
prepareEndpoint: (endpointOptions: object, serviceOptions: object) => object
connect: (options: object, connection: Connection) => Promise<Connection>
disconnect: (connection: Connection) => Promise<void>
send: (request: object, connection: Connection) => Promise<object>
normalize: (data: object[], request: object) => Promise<object[]>
serialize: (data: object[], request: object) => Promise<object[]>
}

declare const _default: { adapter: Adapter }

export = _default

0 comments on commit ed24e72

Please sign in to comment.