2018-07-10 19:29:09 +02:00
|
|
|
export type PatternOptionType = "measure" | "percentage" | "angle" | "choice" | "constant";
|
|
|
|
|
2018-07-10 12:20:53 +00:00
|
|
|
export interface PatternOption {
|
2018-07-10 19:29:09 +02:00
|
|
|
id: string;
|
|
|
|
val: number;
|
|
|
|
type?: string;
|
2018-07-10 12:20:53 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2018-07-10 19:29:09 +02:00
|
|
|
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;
|
|
|
|
}
|
2018-07-12 07:37:52 +00:00
|
|
|
|
|
|
|
declare namespace Pattern {
|
|
|
|
export type OptionType = "measure" | "percentage" | "angle" | "choice" | "constant";
|
|
|
|
|
|
|
|
export interface Option {
|
|
|
|
id: string;
|
|
|
|
val: number;
|
|
|
|
type?: string;
|
|
|
|
onlyIf?: {
|
|
|
|
option: string;
|
|
|
|
oneOf: number[];
|
|
|
|
}
|
|
|
|
min?: number;
|
|
|
|
max?: number;
|
|
|
|
options?: {
|
|
|
|
[index: number]: string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface Config {
|
|
|
|
parts: string[];
|
|
|
|
measurements: string[];
|
|
|
|
options: Option[];
|
|
|
|
[propName: string]: any;
|
|
|
|
}
|
|
|
|
}
|