pricing4ts
Version:
 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
TypeScript
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[][];