diff --git a/sdks/typescript/pmxt/models.ts b/sdks/typescript/pmxt/models.ts index d5b8c97f..ec400c0d 100644 --- a/sdks/typescript/pmxt/models.ts +++ b/sdks/typescript/pmxt/models.ts @@ -983,7 +983,10 @@ export interface EventMatchResult extends Readonly { marketMatches: MatchResult[]; } -export type MatchedClusterSort = 'volume' | 'confidence'; +/** Canonical cluster sort literal shared with the Python SDK. */ +export type ClusterSortOption = 'volume' | 'confidence'; + +export type MatchedClusterSort = ClusterSortOption; /** Shared filters for matched market/event cluster discovery. */ export interface MatchedClusterFilterParams { diff --git a/sdks/typescript/tests/public-exports.test.ts b/sdks/typescript/tests/public-exports.test.ts index acc17a0f..3cca683c 100644 --- a/sdks/typescript/tests/public-exports.test.ts +++ b/sdks/typescript/tests/public-exports.test.ts @@ -1,5 +1,8 @@ import * as pmxt from '../index'; import { FeedClient as DirectFeedClient } from '../pmxt/feed-client'; +import type { ClusterSortOption, MatchedClusterSort } from '../index'; + +const acceptsClusterSortOption = (sort: ClusterSortOption): MatchedClusterSort => sort; describe('public exports', () => { it('exports FeedClient as a top-level named export', () => { @@ -16,4 +19,10 @@ describe('public exports', () => { const client = new pmxt.FeedClient('chainlink'); expect(client).toBeInstanceOf(DirectFeedClient); }); + + it('exports ClusterSortOption as a public type alias matching MatchedClusterSort', () => { + const byVolume = acceptsClusterSortOption('volume'); + const byConfidence = acceptsClusterSortOption('confidence'); + expect([byVolume, byConfidence]).toEqual(['volume', 'confidence']); + }); });