From 0c41ff831a62b780efcaec741b86950028b9ba47 Mon Sep 17 00:00:00 2001 From: Stefan-Gabriel Muscalu Date: Thu, 13 Jun 2019 17:49:24 +0300 Subject: [PATCH] Add: typescript definitions --- index.d.ts | 9 +++++++++ package.json | 1 + 2 files changed, 10 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..2a3dee7 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,9 @@ +export type SIGNAL = "SIGSEGV" | string; + +export type CrashCallback = (signal: SIGNAL, address: string, stack: string[]) => any; + +export function registerHandler(): void; +export function registerHandler(file: string): void; +export function registerHandler(file: string, callback: CrashCallback): void; + +export function causeSegfault(): void; \ No newline at end of file diff --git a/package.json b/package.json index 66dcc48..f5970df 100644 --- a/package.json +++ b/package.json @@ -19,5 +19,6 @@ "nan": "^2.13.2" }, "main": "index.js", + "types": "index.d.ts", "license": "BSD-3-Clause" }