diff --git a/types/debessmann/debessmann-tests.ts b/types/debessmann/debessmann-tests.ts new file mode 100644 index 0000000000..3e44ff8cd6 --- /dev/null +++ b/types/debessmann/debessmann-tests.ts @@ -0,0 +1,13 @@ +import {DM, Event, EventId} from 'debessmann'; + +let eventId: EventId = {seq: 0, time: new Date()}; +let e: Event = {_id: eventId, headers: {'header1': 'header1Val'}}; + +let dm: DM = { + init(endpoint: string, auth: string): void { + }, + send(data: Event): void { + } +}; +dm.init("ep.debessmann.com", "AUTHID"); +dm.send(e); diff --git a/types/debessmann/index.d.ts b/types/debessmann/index.d.ts index b99dc2809b..acb415faa7 100644 --- a/types/debessmann/index.d.ts +++ b/types/debessmann/index.d.ts @@ -10,11 +10,11 @@ export class EventId { export class Event { _id: EventId; - id: string; - timestamp: string; - payload: any; + timestamp?: string; + id?: string; + payload?: any; headers: { [key: string]: string; }; - metrics: { [key: string]: number; }; + metrics?: { [key: string]: number; }; } export class DM {