@medplum/hl7 2.1.15 → 2.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,68 @@
1
+ /// <reference types="node" />
2
+
3
+ import { Hl7Message } from '@medplum/core';
4
+ import net from 'net';
5
+
6
+ export declare const CR: string;
7
+
8
+ declare const FS_2: string;
9
+ export { FS_2 as FS }
10
+
11
+ export declare abstract class Hl7Base extends EventTarget {
12
+ addEventListener<K extends keyof Hl7EventMap>(type: K, listener: ((event: Hl7EventMap[K]) => void) | EventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
13
+ removeEventListener<K extends keyof Hl7EventMap>(type: K, listener: ((event: Hl7EventMap[K]) => void) | EventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
14
+ }
15
+
16
+ export declare class Hl7Client extends Hl7Base {
17
+ options: Hl7ClientOptions;
18
+ host: string;
19
+ port: number;
20
+ connection?: Hl7Connection;
21
+ constructor(options: Hl7ClientOptions);
22
+ connect(): Promise<Hl7Connection>;
23
+ send(msg: Hl7Message): Promise<void>;
24
+ sendAndWait(msg: Hl7Message): Promise<Hl7Message>;
25
+ close(): void;
26
+ }
27
+
28
+ export declare interface Hl7ClientOptions {
29
+ host: string;
30
+ port: number;
31
+ }
32
+
33
+ export declare class Hl7Connection extends Hl7Base {
34
+ readonly socket: net.Socket;
35
+ readonly encoding?: BufferEncoding | undefined;
36
+ constructor(socket: net.Socket, encoding?: BufferEncoding | undefined);
37
+ send(reply: Hl7Message): void;
38
+ sendAndWait(msg: Hl7Message): Promise<Hl7Message>;
39
+ close(): void;
40
+ }
41
+
42
+ export declare class Hl7ErrorEvent extends Event {
43
+ readonly error: Error;
44
+ constructor(error: Error);
45
+ }
46
+
47
+ export declare interface Hl7EventMap {
48
+ message: Hl7MessageEvent;
49
+ error: Hl7ErrorEvent;
50
+ }
51
+
52
+ export declare class Hl7MessageEvent extends Event {
53
+ readonly connection: Hl7Connection;
54
+ readonly message: Hl7Message;
55
+ constructor(connection: Hl7Connection, message: Hl7Message);
56
+ }
57
+
58
+ export declare class Hl7Server {
59
+ readonly handler: (connection: Hl7Connection) => void;
60
+ server?: net.Server;
61
+ constructor(handler: (connection: Hl7Connection) => void);
62
+ start(port: number, encoding?: BufferEncoding): void;
63
+ stop(): void;
64
+ }
65
+
66
+ export declare const VT: string;
67
+
68
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medplum/hl7",
3
- "version": "2.1.15",
3
+ "version": "2.1.17",
4
4
  "description": "Medplum HL7 Utilities",
5
5
  "keywords": [
6
6
  "medplum",
@@ -27,15 +27,14 @@
27
27
  "author": "Medplum <hello@medplum.com>",
28
28
  "sideEffects": false,
29
29
  "exports": {
30
- "types": "./dist/types.d.ts",
31
30
  "require": "./dist/cjs/index.cjs",
32
31
  "import": "./dist/esm/index.mjs"
33
32
  },
34
33
  "main": "dist/cjs/index.cjs",
35
34
  "module": "dist/esm/index.mjs",
36
- "types": "dist/types.d.ts",
37
35
  "scripts": {
38
- "build": "npm run clean && tsc --project tsconfig.build.json && node esbuild.mjs && api-extractor run --local",
36
+ "api-extractor": "api-extractor run --local && cp dist/types.d.ts dist/cjs/index.d.cts && cp dist/types.d.ts dist/esm/index.d.mts",
37
+ "build": "npm run clean && tsc --project tsconfig.build.json && node esbuild.mjs && npm run api-extractor",
39
38
  "clean": "rimraf dist",
40
39
  "test": "jest"
41
40
  },
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "../../api-extractor.json"
3
- }
package/tsdoc.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
3
- "extends": ["../../tsdoc.json"]
4
- }
File without changes