From fce3421487f9d47de5130a46593fd03a76c34bf8 Mon Sep 17 00:00:00 2001 From: Lawrence Forooghian Date: Mon, 20 Nov 2023 09:51:57 -0300 Subject: [PATCH] Add TypeScript typings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So that users importing it in TypeScript don’t get an error like this: > Could not find a declaration file for module '@ably/vcdiff-decoder'. '/Users/lawrence/code/work/ably/ably-js/node_modules/@ably/vcdiff-decoder/lib/vcdiff_decoder.js' implicitly has an 'any' type. --- package.json | 4 +++- typings.d.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 typings.d.ts diff --git a/package.json b/package.json index 66afd97..ee02e37 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "license": "Apache-2.0", "homepage": "https://ably.io/", "main": "lib/vcdiff_decoder.js", + "typings": "typings.d.ts", "scripts": { "grunt": "grunt", "test": "grunt test:all" @@ -28,7 +29,8 @@ }, "files": [ "lib", - "dist" + "dist", + "typings.d.ts" ], "devDependencies": { "@babel/core": "^7.9.0", diff --git a/typings.d.ts b/typings.d.ts new file mode 100644 index 0000000..10505b0 --- /dev/null +++ b/typings.d.ts @@ -0,0 +1 @@ +export declare function decode(delta: Uint8Array, source: Uint8Array): Uint8Array;