Skip to content

Commit

Permalink
feat: add new type
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Feb 17, 2024
1 parent 02d1d12 commit 579b4be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 579b4be

Please sign in to comment.