Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/types.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { ChoicesOptions, ObjectOptions } from "./types";

const objectOptions = {
fields: [],
helpText: "Optional help text.",
} satisfies ObjectOptions;

const choicesOptions = {
choices: ["One", "Two"],
multiple: true,
} satisfies ChoicesOptions;

void objectOptions;
void choicesOptions;

const unsupportedObjectOptions = {
fields: [],
// @ts-expect-error Unsupported object UI state is not part of the public options type.
collapsed: true,
} satisfies ObjectOptions;

const unsupportedChoicesOptions = {
choices: ["One", "Two"],
// @ts-expect-error Unsupported choices presentation UI is not part of the public options type.
presentation: "toggle",
} satisfies ChoicesOptions;

void unsupportedObjectOptions;
void unsupportedChoicesOptions;
2 changes: 0 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export type FieldsSubField = {

export type ObjectOptions = {
fields: FieldsSubField[];
collapsed?: boolean;
helpText?: string;
};

Expand Down Expand Up @@ -68,7 +67,6 @@ export type ChoicesOptions = {
choices?: FieldsChoice[] | string[];
options?: FieldsChoice[] | string[];
multiple?: boolean;
presentation?: "radio" | "checkbox" | "toggle";
orientation?: "vertical" | "horizontal";
columns?: number;
helpText?: string;
Expand Down