From 00845cd49671b0f876bded1df774dce76362c63e Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Mon, 17 Aug 2026 11:17:16 +0800 Subject: [PATCH] fix(typescript): export OutcomeType alias --- sdks/typescript/pmxt/models.ts | 7 +++++-- sdks/typescript/tests/outcome-type.test.ts | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 sdks/typescript/tests/outcome-type.test.ts diff --git a/sdks/typescript/pmxt/models.ts b/sdks/typescript/pmxt/models.ts index 5db743cb..832f72af 100644 --- a/sdks/typescript/pmxt/models.ts +++ b/sdks/typescript/pmxt/models.ts @@ -871,6 +871,9 @@ export interface UnifiedEvent { // Advanced Filtering Types // ---------------------------------------------------------------------------- +/** Supported outcome labels for binary and up/down markets. */ +export type OutcomeType = 'yes' | 'no' | 'up' | 'down'; + /** * Advanced criteria for filtering markets. * Supports text search, numeric ranges, dates, categories, and price filters. @@ -908,14 +911,14 @@ export interface MarketFilterCriteria { /** Filter by outcome price (for binary markets) */ price?: { - outcome: 'yes' | 'no' | 'up' | 'down'; + outcome: OutcomeType; min?: number; max?: number; }; /** Filter by 24-hour price change */ priceChange24h?: { - outcome: 'yes' | 'no' | 'up' | 'down'; + outcome: OutcomeType; min?: number; max?: number; }; diff --git a/sdks/typescript/tests/outcome-type.test.ts b/sdks/typescript/tests/outcome-type.test.ts new file mode 100644 index 00000000..f36a539a --- /dev/null +++ b/sdks/typescript/tests/outcome-type.test.ts @@ -0,0 +1,14 @@ +import type { MarketFilterCriteria, OutcomeType } from "../pmxt/models"; + +describe("OutcomeType", () => { + it("is exported for reuse in market filters", () => { + const outcome: OutcomeType = "yes"; + const criteria: MarketFilterCriteria = { + price: { outcome }, + priceChange24h: { outcome }, + }; + + expect(criteria.price?.outcome).toBe("yes"); + expect(criteria.priceChange24h?.outcome).toBe("yes"); + }); +});