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

Add type definitions for UI element types and input element values

This makes it easier to define types of objects in surrounding code.
parent eece5547
No related branches found
No related tags found
No related merge requests found
// eslint-disable-next-line max-classes-per-file
import { IdService } from '../id.service';
export type UIElementType = 'text' | 'button' | 'text-field' | 'text-area' | 'checkbox'
| 'dropdown' | 'radio' | 'image' | 'audio' | 'video';
export type InputElementValue = string | number | boolean | null;
export abstract class UIElement {
[index: string]: string | number | boolean | string[] | null | ((...args: any) => any);
type!: 'text' | 'button' | 'text-field' | 'text-area' | 'checkbox'
| 'dropdown' | 'radio' | 'image' | 'audio' | 'video';
type!: UIElementType;
id: string = 'id_placeholder';
zIndex: number = 0;
......@@ -41,7 +44,7 @@ export abstract class UIElement {
export abstract class InputElement extends UIElement {
label: string;
value: string | number | boolean | null;
value: InputElementValue;
required: boolean;
requiredWarnMessage: string;
......
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