fix: add TypeScript declarations and fix build errors
Fixed TypeScript compilation errors preventing Docker build: 1. Added type declarations for convert-units library: - Created types/convert-units.d.ts with proper interfaces - Defined Unit and Converter interfaces - Made value parameter optional in convert() function - Methods like measures() accessible on Converter instance 2. Fixed CommandPalette type error: - Added explicit type annotation to commands array - Made color property optional (color?: string) - Theme commands don't have color, measure commands do Build now completes successfully: - TypeScript compilation passes - Static pages generate correctly - Ready for Docker build 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
30
types/convert-units.d.ts
vendored
Normal file
30
types/convert-units.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
declare module 'convert-units' {
|
||||
export interface Unit {
|
||||
abbr: string;
|
||||
measure: string;
|
||||
system: string;
|
||||
singular: string;
|
||||
plural: string;
|
||||
}
|
||||
|
||||
export interface Converter {
|
||||
from(unit: string): {
|
||||
to(toUnit: string): number;
|
||||
toBest(options?: { exclude?: string[]; cutOffNumber?: number }): {
|
||||
val: number;
|
||||
unit: string;
|
||||
singular: string;
|
||||
plural: string;
|
||||
};
|
||||
getUnit(): Unit;
|
||||
possibilities(): string[];
|
||||
};
|
||||
measures(): string[];
|
||||
possibilities(measure?: string): string[];
|
||||
describe(unit: string): Unit;
|
||||
}
|
||||
|
||||
function convert(value?: number): Converter;
|
||||
|
||||
export default convert;
|
||||
}
|
||||
Reference in New Issue
Block a user