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
24 lines (23 loc) • 884 B
TypeScript
import { ValueType, UsageLimitType, RenderMode } from './types';
export interface UsageLimit {
name: string;
description?: string;
trackable?: boolean;
period?: {
unit: "SEC" | "MIN" | "HOUR" | "DAY" | "MONTH" | "YEAR";
value: number;
};
valueType: ValueType;
defaultValue: string | number | boolean;
value?: string | number | boolean;
unit: string;
type: UsageLimitType;
linkedFeatures?: string[];
render: RenderMode;
}
export interface ContainerUsageLimits {
[key: string]: UsageLimit;
}
export declare function getNumberOfUsageLimits(usageLimits?: Record<string, UsageLimit>): number;
export declare function getUsageLimitNames(usageLimits?: Record<string, UsageLimit>): string[];
export declare function calculateLinkedFeaturesMatrix(usageLimits: Record<string, UsageLimit>, featureNames: string[]): number[][];