initial commit
This commit is contained in:
parent
4905ba076e
commit
e7c81e3d60
55
src/types/element.ts
Normal file
55
src/types/element.ts
Normal file
@ -0,0 +1,55 @@
|
||||
import type { Modality } from 'src/types/modality';
|
||||
|
||||
export type BaseElement = {
|
||||
id: string;
|
||||
modality: Modality;
|
||||
h: number;
|
||||
w: number;
|
||||
|
||||
xWidget: number;
|
||||
yWidget: number;
|
||||
|
||||
expirationInterval?: number;
|
||||
expiration?: string;
|
||||
onExpiration?: 'delete' | 'escalate' | 'deescalate';
|
||||
interacted?: boolean;
|
||||
canOverlap?: boolean;
|
||||
};
|
||||
|
||||
export type TableElement = BaseElement & {
|
||||
type: 'table';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type ButtonElement = BaseElement & {
|
||||
type: 'button';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type TextElement = BaseElement & {
|
||||
type: 'text';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type ImageElement = BaseElement & {
|
||||
type: 'image';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type AudioElement = BaseElement & {
|
||||
type: 'audio';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type IconElement = BaseElement & {
|
||||
type: 'icon';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type Element =
|
||||
| TableElement
|
||||
| ButtonElement
|
||||
| TextElement
|
||||
| ImageElement
|
||||
| AudioElement
|
||||
| IconElement;
|
@ -1,36 +0,0 @@
|
||||
/* MODIFY AS REQUIRED */
|
||||
|
||||
export type Modality =
|
||||
| 'visual'
|
||||
| 'auditory'
|
||||
| 'tactile'
|
||||
| 'olfactory'
|
||||
| 'gustatory';
|
||||
|
||||
export type Element = {
|
||||
expirationInterval?: number;
|
||||
expiration?: string;
|
||||
onExpiration?: 'delete' | 'escalate' | 'deescalate';
|
||||
interacted?: boolean;
|
||||
id: string;
|
||||
modality: Modality;
|
||||
type: 'table' | 'button' | 'text' | 'image' | 'audio' | 'icon';
|
||||
xWidget: number;
|
||||
yWidget: number;
|
||||
h: number;
|
||||
w: number;
|
||||
canOverlap?: boolean;
|
||||
};
|
||||
|
||||
export type Widget = {
|
||||
elements: Element[];
|
||||
id: string;
|
||||
type: 'tinder' | 'message' | 'highWarning' | 'lowWarning' | 'request';
|
||||
maxAmount: number;
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
useElementLocation: boolean;
|
||||
canOverlap: boolean;
|
||||
};
|
6
src/types/modality.ts
Normal file
6
src/types/modality.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export type Modality =
|
||||
| 'visual'
|
||||
| 'auditory'
|
||||
| 'tactile'
|
||||
| 'olfactory'
|
||||
| 'gustatory';
|
35
src/types/widget.ts
Normal file
35
src/types/widget.ts
Normal file
@ -0,0 +1,35 @@
|
||||
export type BaseWidget = {
|
||||
element: Element[];
|
||||
id: string;
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
canOverlap: boolean;
|
||||
};
|
||||
|
||||
export type MessageWidget = BaseWidget & {
|
||||
type: 'message';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type HighWarningWidget = BaseWidget & {
|
||||
type: 'highWarning';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type LowWarningWidget = BaseWidget & {
|
||||
type: 'lowWarning';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type RequestWidget = BaseWidget & {
|
||||
type: 'request';
|
||||
/** additional properties here */
|
||||
};
|
||||
|
||||
export type Widget =
|
||||
| MessageWidget
|
||||
| HighWarningWidget
|
||||
| LowWarningWidget
|
||||
| RequestWidget;
|
Loading…
Reference in New Issue
Block a user