Support adding existing documents to a session
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { type DocumentData, type DocumentType } from "./types";
|
||||
|
||||
export type FieldType = "shortText" | "longText" | "toggle";
|
||||
export type FieldType = "identifier" | "shortText" | "longText" | "toggle";
|
||||
|
||||
export type ValueForFieldType<F extends FieldType> = {
|
||||
identifier: string;
|
||||
shortText: string;
|
||||
longText: string;
|
||||
toggle: boolean;
|
||||
@@ -10,6 +11,7 @@ export type ValueForFieldType<F extends FieldType> = {
|
||||
|
||||
function defaultValue<F extends FieldType>(fieldType: F): ValueForFieldType<F> {
|
||||
switch (fieldType) {
|
||||
case "identifier":
|
||||
case "shortText":
|
||||
case "longText":
|
||||
return "" as ValueForFieldType<F>;
|
||||
|
||||
Reference in New Issue
Block a user