@sassoftware/vi-api
Version:
Types used in the SAS Visual Investigator API
16 lines (15 loc) • 943 B
TypeScript
export type FieldType = "STRING" | "BOOLEAN" | "REFERENCEDATA" | "USER_GROUP" | "JSON" | DateDataType | NumberDataType;
export type NumberDataType = "SMALLINT" | "INTEGER" | "LONG" | "FLOAT" | "DOUBLE" | "NUMERIC";
export type DateDataType = "DATE" | "TIMESTAMP" | "TIMESTAMP_WITH_TIME_ZONE";
export declare const isFieldDataTypeDate: (field?: string) => boolean;
export interface UserGroup {
id: string;
type: "user" | "group";
}
export type FieldTypeToValue<Type extends FieldType> = Type extends "BOOLEAN" ? boolean : Type extends "STRING" | DateDataType | "REFERENCEDATA" ? string : Type extends NumberDataType ? number : Type extends "JSON" ? object : Type extends "USER_GROUP" ? UserGroup[] : never;
export type FieldValue = undefined | string | number | boolean | object | UserGroup | Date | ChildObject[] | null;
export type ChildObject = {
id?: string;
isNew?: boolean;
fieldValues: Record<string, FieldValue>;
};