diff --git a/package.json b/package.json index 46b0ea3..ace5d2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zxilly/bin-wrapper", - "version": "1.0.1", + "version": "1.0.2", "description": "Binary wrapper that makes your programs seamlessly available as local dependencies, now with TypeScript.", "license": "MIT", "repository": "Zxilly/bin-wrapper-ts", @@ -24,6 +24,8 @@ "types": "./lib/index.d.ts", "default": "./lib/index.js" }, + "module": "lib/index.js", + "types": "lib/index.d.ts", "keywords": [ "bin", "check", diff --git a/src/index.ts b/src/index.ts index ff3e607..32cb6a9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,10 +5,11 @@ import {downloadAndExtract, download} from "./download"; import {execa, ExecaChildProcess} from "execa"; export type Arch = typeof process.arch +export type Platform = typeof process.platform export interface SrcObject { url: string; - os: string; + os: Platform; arch: Arch; } @@ -33,7 +34,7 @@ export default class BinWrapper { * @param os The OS to download for * @param arch The architecture to download for */ - src(src: string, os: string, arch: Arch): this { + src(src: string, os: Platform, arch: Arch): this { this.sources.push({url: src, os, arch}); return this; } @@ -47,7 +48,7 @@ export default class BinWrapper { * @param prefix The files in the compressed archive met the prefix will be extracted * @param strip strip the directory levels from the extracted files */ - compressedSrc(src: string, os: string, arch: Arch, prefix: string, strip: number): this { + compressedSrc(src: string, os: Platform, arch: Arch, prefix: string, strip: number): this { this.sources.push({url: src, os, arch, prefix, strip}); return this; }