generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
44 lines (43 loc) • 2.12 kB
TypeScript
import type { SetFieldType, SetRequired } from 'type-fest';
import type { Field } from '../types/application/field.js';
import type { Field as BaseField } from '../types/base/field.js';
declare const blobFieldTypes: {
readonly BLOB: "Blob";
readonly ANY_BLOB: "AnyBlob";
readonly IMAGE_BLOB: "ImageBlob";
readonly TEXT_BLOB: "TextBlob";
};
declare const fieldTypes: {
readonly BLOB: "Blob";
readonly ANY_BLOB: "AnyBlob";
readonly IMAGE_BLOB: "ImageBlob";
readonly TEXT_BLOB: "TextBlob";
readonly STRING: "String";
readonly INTEGER: "Integer";
readonly LONG: "Long";
readonly BIG_DECIMAL: "BigDecimal";
readonly FLOAT: "Float";
readonly DOUBLE: "Double";
readonly UUID: "UUID";
readonly ENUM: "Enum";
readonly BOOLEAN: "Boolean";
readonly LOCAL_DATE: "LocalDate";
readonly ZONED_DATE_TIME: "ZonedDateTime";
readonly INSTANT: "Instant";
readonly DURATION: "Duration";
readonly TIME: "LocalTime";
readonly BYTES: "byte[]";
readonly BYTE_BUFFER: "ByteBuffer";
};
export default fieldTypes;
export declare const fieldTypeValues: string[];
export type FieldType = (typeof fieldTypes)[keyof typeof fieldTypes];
type FieldBlobType = (typeof blobFieldTypes)[keyof typeof blobFieldTypes];
type FieldBinaryType = (typeof blobFieldTypes)[keyof typeof blobFieldTypes] | 'byte[]';
export declare const isBlobType: (fieldType: string) => fieldType is FieldBlobType;
export declare const getBlobContentType: (fieldType: FieldBlobType) => "image" | "text" | "any" | undefined;
export declare const isFieldBlobType: (field: Field) => field is SetFieldType<Field, "fieldType", FieldBlobType>;
export declare const isFieldBinaryType: (field: Field) => field is SetFieldType<Field, "fieldType", FieldBinaryType>;
export declare const isFieldEnumType: (field: Field) => field is SetRequired<Field, "enumFileName" | "enumValues">;
export declare const isFieldNotEnumType: (field: Field) => field is SetFieldType<Field, "fieldType", FieldType>;
export declare const convertFieldBlobType: <const F extends BaseField = BaseField>(field: F) => F;