27 lines
661 B
TypeScript
27 lines
661 B
TypeScript
// TypeScript variants of the Java classes.
|
|
// Typically, standalone DTOs (Data Transfer Objects) are used to communicate with the backend,
|
|
// but we'll keep it simple here.
|
|
|
|
export type UiPropertyType = "number" | "string" | "text";
|
|
|
|
export class TypeProperty {
|
|
constructor(public name: string, public type: UiPropertyType) {}
|
|
}
|
|
|
|
export class DataType {
|
|
constructor(
|
|
public id: string,
|
|
public name: string,
|
|
public properties: TypeProperty[]
|
|
) {}
|
|
|
|
static empty(): DataType {
|
|
return new DataType("", "", []);
|
|
}
|
|
}
|
|
|
|
export class DataTypeConfiguration {
|
|
constructor(public dataTypes: DataType[]) {}
|
|
}
|
|
|
|
export type Runnable = () => void;
|