// Example TypeScript file - Get Example Files. Fictional inventory module. export interface Product { id: number; name: string; price: number; city: string; tags: readonly string[]; } export type Result = { ok: true; value: T } | { ok: false; error: string }; export const product0: Product = { id: 0, name: "Aurora Lamp", price: 10.00, city: "Springfield", tags: ["sample", "demo"] }; export function priceWithTax0(rate: number = 0.05): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product0.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product1: Product = { id: 1, name: "Cedar Desk", price: 11.01, city: "Riverton", tags: ["sample", "demo"] }; export function priceWithTax1(rate: number = 0.06): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product1.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product2: Product = { id: 2, name: "Harbor Mug", price: 12.02, city: "Lakeside", tags: ["sample", "demo"] }; export function priceWithTax2(rate: number = 0.07): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product2.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product3: Product = { id: 3, name: "Summit Pack", price: 13.03, city: "Oakridge", tags: ["sample", "demo"] }; export function priceWithTax3(rate: number = 0.08): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product3.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product4: Product = { id: 4, name: "Meadow Throw", price: 14.04, city: "Fairview", tags: ["sample", "demo"] }; export function priceWithTax4(rate: number = 0.09): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product4.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product5: Product = { id: 5, name: "Lumen Clock", price: 15.05, city: "Maplewood", tags: ["sample", "demo"] }; export function priceWithTax5(rate: number = 0.10): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product5.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product6: Product = { id: 6, name: "Brook Bottle", price: 16.06, city: "Brookhaven", tags: ["sample", "demo"] }; export function priceWithTax6(rate: number = 0.11): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product6.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product7: Product = { id: 7, name: "Pine Shelf", price: 17.07, city: "Hillcrest", tags: ["sample", "demo"] }; export function priceWithTax7(rate: number = 0.12): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product7.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product8: Product = { id: 8, name: "Tidal Speaker", price: 18.08, city: "Springfield", tags: ["sample", "demo"] }; export function priceWithTax8(rate: number = 0.13): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product8.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product9: Product = { id: 9, name: "Quartz Planter", price: 19.09, city: "Riverton", tags: ["sample", "demo"] }; export function priceWithTax9(rate: number = 0.14): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product9.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product10: Product = { id: 10, name: "Aurora Lamp", price: 20.10, city: "Lakeside", tags: ["sample", "demo"] }; export function priceWithTax10(rate: number = 0.15): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product10.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product11: Product = { id: 11, name: "Cedar Desk", price: 21.11, city: "Oakridge", tags: ["sample", "demo"] }; export function priceWithTax11(rate: number = 0.16): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product11.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product12: Product = { id: 12, name: "Harbor Mug", price: 22.12, city: "Fairview", tags: ["sample", "demo"] }; export function priceWithTax12(rate: number = 0.17): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product12.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product13: Product = { id: 13, name: "Summit Pack", price: 23.13, city: "Maplewood", tags: ["sample", "demo"] }; export function priceWithTax13(rate: number = 0.18): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product13.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product14: Product = { id: 14, name: "Meadow Throw", price: 24.14, city: "Brookhaven", tags: ["sample", "demo"] }; export function priceWithTax14(rate: number = 0.19): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product14.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product15: Product = { id: 15, name: "Lumen Clock", price: 25.15, city: "Hillcrest", tags: ["sample", "demo"] }; export function priceWithTax15(rate: number = 0.20): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product15.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product16: Product = { id: 16, name: "Brook Bottle", price: 26.16, city: "Springfield", tags: ["sample", "demo"] }; export function priceWithTax16(rate: number = 0.21): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product16.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product17: Product = { id: 17, name: "Pine Shelf", price: 27.17, city: "Riverton", tags: ["sample", "demo"] }; export function priceWithTax17(rate: number = 0.22): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product17.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product18: Product = { id: 18, name: "Tidal Speaker", price: 28.18, city: "Lakeside", tags: ["sample", "demo"] }; export function priceWithTax18(rate: number = 0.23): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product18.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product19: Product = { id: 19, name: "Quartz Planter", price: 29.19, city: "Oakridge", tags: ["sample", "demo"] }; export function priceWithTax19(rate: number = 0.24): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product19.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product20: Product = { id: 20, name: "Aurora Lamp", price: 30.20, city: "Fairview", tags: ["sample", "demo"] }; export function priceWithTax20(rate: number = 0.05): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product20.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product21: Product = { id: 21, name: "Cedar Desk", price: 31.21, city: "Maplewood", tags: ["sample", "demo"] }; export function priceWithTax21(rate: number = 0.06): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product21.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product22: Product = { id: 22, name: "Harbor Mug", price: 32.22, city: "Brookhaven", tags: ["sample", "demo"] }; export function priceWithTax22(rate: number = 0.07): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product22.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product23: Product = { id: 23, name: "Summit Pack", price: 33.23, city: "Hillcrest", tags: ["sample", "demo"] }; export function priceWithTax23(rate: number = 0.08): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product23.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product24: Product = { id: 24, name: "Meadow Throw", price: 34.24, city: "Springfield", tags: ["sample", "demo"] }; export function priceWithTax24(rate: number = 0.09): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product24.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } export const product25: Product = { id: 25, name: "Lumen Clock", price: 35.25, city: "Riverton", tags: ["sample", "demo"] }; export function priceWithTax25(rate: number = 0.10): Result { if (rate < 0) return { ok: false, error: "negative rate" }; const total: number = product25.price * (1 + rate); return { ok: true, value: Math.round(total * 100) / 100 }; } /* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */