diff --git a/index.d.ts b/index.d.ts index cb4cf6f..79dbb61 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -declare interface Apdu { +export interface Apdu { Cla : number; Ins : number; P1 : number; @@ -7,29 +7,29 @@ declare interface Apdu { Lc : number; } -declare interface ApduResponse { +export interface ApduResponse { SW : Array; Data? : Array; } -declare enum CardEvent { +export enum CardEvent { Inserted, Removed } -declare enum MemoryCardTypes { +export enum MemoryCardTypes { SLE5528 = 0x05, SLE5542 = 0x06 } -declare enum PINStatus { +export enum PINStatus { NOT_VERIFIED, OK, WRONG, LOCKED } -declare class SmartCard { +export class SmartCard { constructor(_atr : Array, _protocol: number, _isMemoryCard : boolean); @@ -38,7 +38,7 @@ declare class SmartCard { isMemoryCard : boolean; } -declare class Reader { +export class Reader { constructor(_pcscReader : any); @@ -48,7 +48,7 @@ declare class Reader { close(); } -declare class TsCard { +export class TsCard { static instance : TsCard diff --git a/package.json b/package.json index cdb5dee..dcaa00c 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,11 @@ { "name": "tscard", - "version": "1.0.8", + "version": "1.0.9", "description": "Typescript pcsclite wrapper library to support memory cards too", "scripts": { "start": "node example.js", + "build": "tsc", + "prepublishOnly": "npm run build", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "lewix", @@ -21,6 +23,12 @@ ], "devDependencies": { "@types/buffers": "^0.1.34", - "typescript": "^5.8.3" - } + "typescript": "^5.8.3", + "node-gyp": "^11.2.0" + }, + "types": "index.d.ts", + "files": [ + "dist", + "index.d.ts" + ] } diff --git a/tsconfig.json b/tsconfig.json index 7cc01a5..e1a5096 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,9 @@ { "compilerOptions": { "target": "ES2023", - "module": "commonjs", + "module": "commonjs", "sourceMap": true, - "lib": ["ES2023", "dom"], - } + "lib": ["ES2023", "dom"] + }, + "include": ["*.ts", "cards/*.ts"] } \ No newline at end of file