UNPKG

pricing4ts

Version:

![NPM Version](https://img.shields.io/npm/v/pricing4ts) Pricing4TS is a TypeScript-based toolkit designed to enhance the server-side functionality of a pricing-driven SaaS by enabling the seamless integration of pricing plans into the application logic. T

37 lines (36 loc) 1.1 kB
import { Feature } from './feature'; import { UsageLimit } from './usage-limit'; import { Plan } from './plan'; import { AddOn } from './addon'; export interface Pricing { saasName: string; syntaxVersion: string; version: string; url?: string; createdAt: Date; currency: string; tags?: string[]; billing?: { [key: string]: number; }; variables: { [key: string]: number | string | boolean; }; features: Record<string, Feature>; usageLimits?: Record<string, UsageLimit>; plans?: Record<string, Plan>; addOns?: Record<string, AddOn>; custom?: { [key: string]: any; }; } export interface ExtractedPricing extends Omit<Pricing, 'syntaxVersion' | 'createdAt'> { syntaxVersion: string; createdAt: string | Date; } export interface PricingToBeWritten extends Omit<Pricing, 'createdAt' | 'features'> { createdAt: string; features: Record<string, Feature> | undefined; } export declare function generateEmptyPricing(): Pricing; export declare function generatePricingToBeWritten(): PricingToBeWritten;