UNPKG

@sudowealth/schwab-api

Version:

TypeScript client for Charles Schwab API with OAuth support, market data, trading functionality, and complete type safety

39 lines (38 loc) 1.49 kB
import { z } from 'zod'; /** * Type of date representation to use */ export declare enum DateFormatType { /** JavaScript Date object */ DATE_OBJECT = "date_object", /** ISO 8601 string (e.g., "2023-10-15T14:30:00.000Z") */ ISO_STRING = "iso_string", /** Date string in YYYY-MM-DD format */ DATE_STRING = "date_string", /** UNIX timestamp in milliseconds */ EPOCH_MS = "epoch_ms" } /** * Zod schema for validating and transforming Unix timestamp in milliseconds */ export declare const epochMillisSchema: z.ZodEffects<z.ZodNumber, string | number | Date | null, number>; /** * Zod schema for validating and transforming ISO 8601 date strings */ export declare const isoDateTimeSchema: z.ZodEffects<z.ZodString, string | number | Date | null, string>; /** * Zod schema for validating and transforming YYYY-MM-DD date strings */ export declare const dateStringSchema: z.ZodEffects<z.ZodString, string | number | Date | null, string>; /** * Creates a Zod schema for query parameter dates that accepts: * - UNIX epoch milliseconds (number) * - YYYY-MM-DD formatted strings * - null values * * All values are transformed to UNIX epoch milliseconds or undefined (if null/undefined) * for API compatibility. * * @returns A Zod schema for query parameter dates */ export declare function createQueryDateSchema(): z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>>, number | undefined, string | number | null | undefined>;