From a1f07d70171fa9b19ac26d58aefdbda6373a3ba0 Mon Sep 17 00:00:00 2001 From: Gadi Cohen Date: Sun, 29 Sep 2024 11:25:42 +0100 Subject: [PATCH] feat(quote): export `QuoteField` type (#808) --- src/modules/quote.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/quote.ts b/src/modules/quote.ts index 8639a976..833c0b30 100644 --- a/src/modules/quote.ts +++ b/src/modules/quote.ts @@ -5,7 +5,7 @@ import type { ModuleThis, } from "../lib/moduleCommon.js"; -import { StaticDecode, Type } from "@sinclair/typebox"; +import { Static, StaticDecode, Type } from "@sinclair/typebox"; import { YahooDateInMs, YahooFinanceDate, @@ -231,7 +231,8 @@ const QuoteSchema = Type.Union([ export type Quote = StaticDecode; -const QuoteField = Type.KeyOf(QuoteSchema); +const QuoteFieldSchema = Type.KeyOf(QuoteSchema); +export type QuoteField = Static; const ResultType = Type.Union([ Type.Literal("array"), @@ -246,7 +247,7 @@ export type QuoteResponseMap = Map; export type QuoteResponseObject = { [key: string]: Quote }; export const QuoteOptionsSchema = Type.Object({ - fields: Type.Optional(Type.Array(QuoteField)), + fields: Type.Optional(Type.Array(QuoteFieldSchema)), return: Type.Optional(ResultType), });