Skip to content

Commit

Permalink
feat(quote): export QuoteField type (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Sep 29, 2024
1 parent 7e524fc commit a1f07d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -231,7 +231,8 @@ const QuoteSchema = Type.Union([

export type Quote = StaticDecode<typeof QuoteSchema>;

const QuoteField = Type.KeyOf(QuoteSchema);
const QuoteFieldSchema = Type.KeyOf(QuoteSchema);
export type QuoteField = Static<typeof QuoteFieldSchema>;

const ResultType = Type.Union([
Type.Literal("array"),
Expand All @@ -246,7 +247,7 @@ export type QuoteResponseMap = Map<string, Quote>;
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),
});

Expand Down

0 comments on commit a1f07d7

Please sign in to comment.