From 8a2d6eb12d3facdc6968846cd4ef8b0fdb0fa9a0 Mon Sep 17 00:00:00 2001 From: James Prevett Date: Sun, 4 Aug 2024 17:42:48 -0500 Subject: [PATCH 1/2] Added Typescript support --- package.json | 1 + src/api.d.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/api.d.ts diff --git a/package.json b/package.json index bbf82a5..6e9c643 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "postject": "./dist/cli.js" }, "main": "dist/api.js", + "types": "dist/api.d.ts", "scripts": { "build": "zx ./scripts/build.mjs", "clean": "rimraf ./build", diff --git a/src/api.d.ts b/src/api.d.ts new file mode 100644 index 0000000..3a75536 --- /dev/null +++ b/src/api.d.ts @@ -0,0 +1,16 @@ +export interface InjectOptions { + /** + * @default '__POSTJECT' + */ + machoSegmentName?: string; + /** + * @default false + */ + overwrite?: boolean; + /** + * @default "POSTJECT_SENTINEL_fce680ab2cc467b6e072b8b5df1996b2" + */ + sentinelFuse?: string; +} + +export function inject(filename: string, resourceName: string, resourceData: Buffer, options: InjectOptions): Promise; From 023f83917e4e12a750eea9b2846885cd028016ff Mon Sep 17 00:00:00 2001 From: James Prevett Date: Mon, 26 Aug 2024 09:27:40 -0500 Subject: [PATCH 2/2] Make `options` optional in `inject` Co-authored-by: Jason Gwartz --- src/api.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api.d.ts b/src/api.d.ts index 3a75536..ef84a1b 100644 --- a/src/api.d.ts +++ b/src/api.d.ts @@ -13,4 +13,5 @@ export interface InjectOptions { sentinelFuse?: string; } -export function inject(filename: string, resourceName: string, resourceData: Buffer, options: InjectOptions): Promise; +export function inject(filename: string, resourceName: string, resourceData: Buffer, options?: InjectOptions): Promise; +