UNPKG

autumn-js

Version:

Autumn JS Library

59 lines (55 loc) 1.63 kB
import { i as CheckFeatureResult, j as CheckProductResult } from './cusTypes-COIU0NG3.mjs'; import { z } from 'zod'; import { A as AutumnError } from './error-DHbclCVh.mjs'; declare const CancelResultSchema: z.ZodObject<{ success: z.ZodBoolean; customer_id: z.ZodString; product_id: z.ZodString; }, "strip", z.ZodTypeAny, { customer_id: string; product_id: string; success: boolean; }, { customer_id: string; product_id: string; success: boolean; }>; type CancelResult = z.infer<typeof CancelResultSchema>; declare const TrackResultSchema: z.ZodObject<{ id: z.ZodString; code: z.ZodString; customer_id: z.ZodString; feature_id: z.ZodOptional<z.ZodString>; event_name: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; code: string; customer_id: string; feature_id?: string | undefined; event_name?: string | undefined; }, { id: string; code: string; customer_id: string; feature_id?: string | undefined; event_name?: string | undefined; }>; type TrackResult = z.infer<typeof TrackResultSchema>; type CheckResult = CheckFeatureResult & CheckProductResult; interface SetupPaymentResult { customer_id: string; url: string; } type Success<T> = { data: T; error: null; statusCode?: number; }; type Failure<E> = { data: null; error: E; statusCode?: number; }; type Result<T, E> = Success<T> | Failure<E>; type AutumnPromise<T> = Promise<Result<T, AutumnError>>; export type { AutumnPromise as A, CancelResult as C, Result as R, SetupPaymentResult as S, TrackResult as T, CheckResult as a };