Skip to content

Conversation

@happy-edge
Copy link

Summary

Export TypeScript types so integrators get proper autocomplete and type checking.

Before

import { init } from '@jup-ag/plugin';
// ❌ No type exports - integrators have to define their own types or use 'any'

After

import { init } from '@jup-ag/plugin';
import type { IInit, FormProps, QuoteResponse, SwapResult } from '@jup-ag/plugin';

// ✅ Full autocomplete and type checking
const config: IInit = {
  formProps: { /* autocomplete works */ },
  onSuccess: ({ txid, swapResult }) => { /* typed! */ }
};

Exported Types

Main configuration:

  • IInit - Main initialization options
  • FormProps - Swap form configuration
  • JupiterPlugin - Window.Jupiter interface

Display options:

  • WidgetPosition - Widget placement options
  • WidgetSize - Widget size options
  • SwapMode - ExactIn/ExactOut/ExactInOrOut
  • DEFAULT_EXPLORER - Explorer options

Callback types:

  • IForm - Form state passed to onFormUpdate
  • QuoteResponse - Quote data in callbacks
  • SwapResult - Result passed to onSuccess
  • SwappingStatus - Transaction status
  • Screens - Screen state for onScreenUpdate

Impact

Better DX for TypeScript users with zero runtime changes.

Integrators using TypeScript can now import types directly:

```typescript
import type {
  IInit,
  FormProps,
  QuoteResponse,
  SwapResult
} from '@jup-ag/plugin';
```

Exported types:
- IInit, FormProps, JupiterPlugin (main config)
- WidgetPosition, WidgetSize, SwapMode, DEFAULT_EXPLORER (options)
- IForm, QuoteResponse, SwapResult, SwappingStatus, Screens (callbacks)
@vercel
Copy link

vercel bot commented Feb 6, 2026

Someone is attempting to deploy a commit to the wowcats Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant