Skip to content

Instantly share code, notes, and snippets.

@futantan
Last active September 4, 2018 07:36
Show Gist options
  • Select an option

  • Save futantan/0dfdae80c74556f3f35c9de456046688 to your computer and use it in GitHub Desktop.

Select an option

Save futantan/0dfdae80c74556f3f35c9de456046688 to your computer and use it in GitHub Desktop.
default config
type ImgUrl = string;
type Color = string;
enum PackageService {
EyesightCheck = "EyesightCheck",
GlassFrame = "GlassFrame",
GlassLens = "GlassLens",
}
interface IGlassFrameConfig {
brandName: string;
brandBannerUrl: ImgUrl;
species: Array<{
gender: 'male' | 'female' | 'all';
model: string;
types: Array<{ color: Color; colorDesc: String; img: ImgUrl }>
}>
}
interface IDefaultConfig {
packageSummaryImg: ImgUrl;
packageSummaryLogo: ImgUrl;
services: Array<PackageService>;
glassFrameServiceLogo: ImgUrl;
packageDetailImgs: Array<ImgUrl>;
glassFrameConfig: Array<IGlassFrameConfig>;
}
const json: IDefaultConfig = {
"packageSummaryImg": "https://user-images.githubusercontent.com/6268441/44649101-88259680-aa15-11e8-9662-c1f3fb3d6b6b.png",
"packageSummaryLogo": "https://user-images.githubusercontent.com/6268441/44713599-0f423f80-aae6-11e8-9814-b9366b2d3f57.png",
"packageDetailImgs": [
"https://user-images.githubusercontent.com/6268441/44649100-878d0000-aa15-11e8-8409-a5100bdaf1df.png",
"https://user-images.githubusercontent.com/6268441/44649100-878d0000-aa15-11e8-8409-a5100bdaf1df.png",
"https://user-images.githubusercontent.com/6268441/44649100-878d0000-aa15-11e8-8409-a5100bdaf1df.png"
],
"services": ["EyesightCheck", "GlassFrame", "GlassLens"],
"glassFrameServiceLogo": "https://user-images.githubusercontent.com/6268441/44713599-0f423f80-aae6-11e8-9814-b9366b2d3f57.png",
"glassFrameConfig": [{
"brandName": "Longchamp",
"brandBannerUrl": "https://user-images.githubusercontent.com/6268441/44649102-88259680-aa15-11e8-8747-e23f52e5840b.png",
"species": [{
"gender": "male",
"model": "LO2100",
"types": [{
"color": "#805437",
"colorDesc": "BROWN",
"img": "https://user-images.githubusercontent.com/6268441/44649097-878d0000-aa15-11e8-8bca-f8232d7801a7.png"
},
{
"color": "#4A3527",
"colorDesc": "BLACK",
"img": "https://user-images.githubusercontent.com/6268441/45016712-14f4d380-b058-11e8-911f-b9ec5b34738e.png"
},
{
"color": "#C92F33",
"colorDesc": "RED",
"img": "https://user-images.githubusercontent.com/6268441/44649097-878d0000-aa15-11e8-8bca-f8232d7801a7.png"
}]
}]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment