Skip to content
Snippets Groups Projects
Commit 1a4f5b58 authored by rhenck's avatar rhenck
Browse files

Improve unit types

Put the possible element types explicitly.
parent 73a2ccc2
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,8 @@ export interface UnitPageSection { ...@@ -28,7 +28,8 @@ export interface UnitPageSection {
export interface UnitUIElement { export interface UnitUIElement {
[index: string]: string | number | boolean | string[] | undefined; [index: string]: string | number | boolean | string[] | undefined;
type: string; // TODO maybe use enum or manual enumeration, because possible values are known type: 'text' | 'button' | 'text-field' | 'text-area' | 'checkbox'
| 'dropdown' | 'radio' | 'image' | 'audio' | 'video';
id: string; id: string;
zIndex: number zIndex: number
width: number; width: number;
......
...@@ -40,7 +40,8 @@ export function createUnitPageSection(): UnitPageSection { ...@@ -40,7 +40,8 @@ export function createUnitPageSection(): UnitPageSection {
}; };
} }
export function createUnitUIElement(type: string): UnitUIElement { export function createUnitUIElement(type: 'text' | 'button' | 'text-field' | 'text-area' | 'checkbox'
| 'dropdown' | 'radio' | 'image' | 'audio' | 'video'): UnitUIElement {
return { return {
type, type,
id: 'id_placeholder', id: 'id_placeholder',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment