Skip to content

Add TypeScript support#91

Closed
SrAnthony wants to merge 1 commit intorails:mainfrom
SrAnthony:add-typescript-support
Closed

Add TypeScript support#91
SrAnthony wants to merge 1 commit intorails:mainfrom
SrAnthony:add-typescript-support

Conversation

@SrAnthony
Copy link

@SrAnthony SrAnthony commented Feb 12, 2026

Summary

  • Converts all source files from JavaScript to TypeScript with full type annotations
  • Exports RequestOptions, ResponseKind, and Interceptor types for consumers
  • Generates .d.ts declaration files via @rollup/plugin-typescript
  • Adds "types" field to package.json pointing to dist/index.d.ts

Changes

  • Source: Renamed all src/*.jssrc/*.ts with strict type annotations
  • Build: Added @rollup/plugin-typescript to Rollup pipeline; declarations emitted to dist/
  • Config: Added tsconfig.json, src/global.d.ts (Window.Turbo augmentation)
  • Tests: Unchanged (JS), work via @babel/preset-typescript
  • CI: Added typecheck and build steps, bumped actions to v4
  • Linting: Removed standard (no TS support); TypeScript compiler provides strictness

Test plan

  • yarn typecheck passes with zero errors
  • yarn test — all 69 existing tests pass without modification
  • yarn build — produces dist/requestjs.js + .d.ts declaration files
  • Verify dist/index.d.ts exports all public types correctly

@marcelolx
Copy link
Collaborator

At the moment, there is no intention to convert this codebase to TypeScript — For the same reasons Turbo is plain javascript as well.

@marcelolx marcelolx closed this Feb 14, 2026
@richardkmiller
Copy link

@SrAnthony Maybe https://definitelytyped.org/ ? I would use it that way if you end up going down that path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants