Skip to content

Commit 0e69c06

Browse files
add types-only npm package without axios runtime (#13)
1 parent 6322039 commit 0e69c06

File tree

7 files changed

+101
-1
lines changed

7 files changed

+101
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ Alternatively, if you use Yarn:
8989
yarn add ip-geolocation-api-sdk-typescript
9090
```
9191

92+
### Types-only Package (No HTTP Client)
93+
If you only need TypeScript request/response interfaces without Axios or API client runtime code, install:
94+
```bash
95+
npm install ip-geolocation-api-typescript-types
96+
```
97+
98+
Then use type-only imports:
99+
```ts
100+
import type { GeolocationResponse, Security } from "ip-geolocation-api-typescript-types";
101+
```
102+
92103
### Manual Installation
93104
To include the SDK manually:
94105
1. Clone this repository:
@@ -2056,4 +2067,4 @@ Sample Response:
20562067
- [UserAgentData](https://github.com/IPGeolocation/ip-geolocation-api-typescript-sdk/blob/HEAD/docs/UserAgentData.md)
20572068
- [UserAgentDataDevice](https://github.com/IPGeolocation/ip-geolocation-api-typescript-sdk/blob/HEAD/docs/UserAgentDataDevice.md)
20582069
- [UserAgentDataEngine](https://github.com/IPGeolocation/ip-geolocation-api-typescript-sdk/blob/HEAD/docs/UserAgentDataEngine.md)
2059-
- [UserAgentDataOperatingSystem](https://github.com/IPGeolocation/ip-geolocation-api-typescript-sdk/blob/HEAD/docs/UserAgentDataOperatingSystem.md)
2070+
- [UserAgentDataOperatingSystem](https://github.com/IPGeolocation/ip-geolocation-api-typescript-sdk/blob/HEAD/docs/UserAgentDataOperatingSystem.md)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"sideEffects": false,
2222
"scripts": {
2323
"build": "tsc && tsc -p tsconfig.esm.json",
24+
"build:types-package": "node ./node_modules/typescript/bin/tsc -p packages/types/tsconfig.json && node ./node_modules/typescript/bin/tsc -p packages/types/tsconfig.esm.json",
2425
"prepare": "npm run build"
2526
},
2627
"dependencies": {

packages/types/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
*.tgz

packages/types/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# IPGeolocation TypeScript Types
2+
3+
This package contains only generated TypeScript interfaces for IPGeolocation.io API request/response payloads.
4+
5+
- No Axios dependency
6+
- No HTTP runtime/client implementation
7+
8+
## Installation
9+
10+
```bash
11+
npm install ip-geolocation-api-typescript-types
12+
```
13+
14+
## Usage
15+
16+
```ts
17+
import type { GeolocationResponse, Security } from "ip-geolocation-api-typescript-types";
18+
```

packages/types/package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"author": "IPGeolocation.io",
3+
"name": "ip-geolocation-api-typescript-types",
4+
"version": "2.0.1",
5+
"description": "TypeScript interfaces for IPGeolocation.io API responses and request payloads (no HTTP client runtime).",
6+
"license": "ISC",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/IPGeolocation/ip-geolocation-api-typescript-sdk.git",
10+
"directory": "packages/types"
11+
},
12+
"keywords": [
13+
"ipgeolocation",
14+
"typescript",
15+
"types",
16+
"interfaces",
17+
"response types"
18+
],
19+
"main": "dist/models.js",
20+
"types": "dist/models.d.ts",
21+
"module": "dist/esm/models.js",
22+
"sideEffects": false,
23+
"files": [
24+
"dist",
25+
"README.md"
26+
],
27+
"exports": {
28+
".": {
29+
"types": "./dist/models.d.ts",
30+
"require": "./dist/models.js",
31+
"import": "./dist/esm/models.js"
32+
}
33+
},
34+
"scripts": {
35+
"build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json && node ../../node_modules/typescript/bin/tsc -p tsconfig.esm.json",
36+
"prepare": "npm run build"
37+
}
38+
}

packages/types/tsconfig.esm.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"outDir": "dist/esm"
6+
}
7+
}

packages/types/tsconfig.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"target": "ES6",
5+
"module": "commonjs",
6+
"noImplicitAny": true,
7+
"outDir": "dist",
8+
"rootDir": "../..",
9+
"moduleResolution": "node",
10+
"typeRoots": [
11+
"../../node_modules/@types"
12+
]
13+
},
14+
"include": [
15+
"../../models.ts",
16+
"../../models/**/*.ts"
17+
],
18+
"exclude": [
19+
"dist",
20+
"node_modules"
21+
]
22+
}

0 commit comments

Comments
 (0)