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

23 lines (22 loc) 786 B
import { Feature } from './feature'; import { UsageLimit } from './usage-limit'; export interface Plan { name: string; description?: string; price: number | string; unit: string; private: boolean; features: { [key: string]: Feature; }; usageLimits?: { [key: string]: UsageLimit; }; } export interface ContainerPlans { [key: string]: Plan; } export declare function getPlanNames(plans?: Record<string, Plan>): string[]; export declare function getPlanPrices(plans?: Record<string, Plan>): number[]; export declare function calculatePlanFeaturesMatrix(plans: Record<string, Plan>): number[][]; export declare function calculatePlanUsageLimitsMatrix(usageLimits: Record<string, UsageLimit>, plans: Record<string, Plan>): number[][];