1
0
Fork 0
freesewing/lib/types.ts
2018-07-10 19:29:09 +02:00

47 lines
893 B
TypeScript

export type PatternOptionType = "measure" | "percentage" | "angle" | "choice" | "constant";
export interface PatternOption {
id: string;
val: number;
type?: string;
onlyIf?: {
option: string;
oneOf: number[];
}
min?: number;
max?: number;
options?: {
[index: number]: string;
}
}
export interface PatternConfig {
parts: string[];
measurements: string[];
options: PatternOption[];
[propName: string]: any;
}
export type Pattern = {
parts: string[];
measurements: string[];
config: PatternConfig;
}
export type DraftMode = "sample" | "compare" | "draft";
export type CompareGroup = "men" | "women";
export type Units = "metric" | "imperial";
export interface DraftConfig {
mode: DraftMode;
units?: Units;
options: PatternOption[];
measurements?: {
[index:string]: number;
};
sa?: number;
scope?: string[];
theme?: string;
}