Last active
June 13, 2017 13:42
-
-
Save EmrysMyrddin/e77116c73c772ac3748ae869f9aae47b to your computer and use it in GitHub Desktop.
Available plugins liste format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
plugins: [ | |
{ | |
"name": "Plugin 1", | |
"description": "A short description for documentation purpose", | |
"elementName": "plugin-1", | |
"icon": "picture_in_picture_alt", | |
"props": [ | |
{ | |
"name": "prop1", | |
"description": "A short description for documentation purpose", | |
"type": "string", | |
"defaultValue": "hello world !" | |
}, | |
{ | |
"name": "prop2", | |
"description": "A short description for documentation purpose", | |
"type": "number", | |
"defaultValue": "42" | |
}, | |
{ | |
"name": "prop4", | |
"description": "A short description for documentation purpose", | |
"type": "json", | |
"defaultValue": { "collection": ["first", "second"] } | |
} | |
] | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Voici la description formel des types de mon côter si ça peut lever des doutes | |
type PropBase = { name: string, description: string } | |
type Prop = | |
| ({ type: 'string', value: string } & PropBase) | |
| ({ type: 'number', value: number } & PropBase) | |
| ({ type: 'boolean', value: boolean } & PropBase) | |
| ({ type: 'json', value: mixed } & PropBase) | |
type Plugin = { | |
name: string, | |
description: string, | |
props: Prop[], | |
icon: string, | |
elementName: string, | |
} | |
type AvailablePlugins = { | |
plugins: Plugin[] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment