export type Tuple = N extends Q['length'] ? Q : Tuple; export type TupleMinMax> = Max extends Q['length'] ? Q : Q | TupleMinMax; export interface Season { name: string; /** * 4 digit year, or undefined for wildcard */ year?: number; /** * 1 = jan ... 12 = dec, or undefined for wildcard */ month?: number; /** * 1..31, or undefined for wildcard */ dayOfMonth?: number; /** * 1..7, or undefined for wildcard */ dayOfWeek?: number; /** * 1..4, index week profile */ weekProfile: number; } export type Seasons = TupleMinMax; export type NumberRange = N extends Q['length'] ? Q['length'] : NumberRange | Q['length']; export type ProfileSchedule = { /** * seconds from 00:00:00 UTC */ startTime: number; } & ({ mode: 'tou'; action: NumberRange<48>; } | { mode: 'block'; action: NumberRange<8>; }); export type DayProfile = TupleMinMax; export type DayProfiles = TupleMinMax; export type DayProfileName = NumberRange<16>; export type WeekProfile = [ DayProfileName, DayProfileName, DayProfileName, DayProfileName, DayProfileName, DayProfileName, DayProfileName ]; export type WeekProfiles = TupleMinMax; export type BlockAction = { thresholds: [number]; prices: [number, number]; } | { thresholds: [number, number]; prices: [number, number, number]; } | { thresholds: [number, number, number]; prices: [number, number, number, number]; }; export type Blocks = Tuple; export type TOUAction = number; export type TOUs = TupleMinMax | []; export declare function scheduleSize(dp: DayProfile, ps: ProfileSchedule): number; export interface Pricing { /** * positive integer * */ standingCharge: number; /** * positive integer * * scale applied to standingCharge, e.g. 0 sets standingCharge to pounds and * -2 sets standingCharge to pence. * * standingCharge * 10^standingChargeScale */ standingChargeScale: number; /** * positive integer * * scale applied to tou and block tariff elements, e.g. 0 sets to pounds and * -2 sets to pence. */ priceScale: number; } export interface SpecialDay { /** * 4 digit year, or undefined for wildcard */ year?: number; /** * 1 = jan ... 12 = dec, or undefined for wildcard */ month?: number; /** * 1..31, or undefined for wildcard */ dayOfMonth?: number; /** * 1..7, or undefined for wildcard */ dayOfWeek?: number; /** * 1..16, index day profile */ dayProfile: number; } /** * 0 to 50 SpecialDays */ export type SpecialDays = SpecialDay[]; export interface Tariff { seasons: Seasons; weekProfiles: WeekProfiles; dayProfiles: DayProfiles; specialDays: SpecialDays; blocks: Blocks; tous: TOUs; pricing: Pricing; } //# sourceMappingURL=tariff.dto.d.ts.map