diff --git a/src/types.test.ts b/src/types.test.ts new file mode 100644 index 0000000..51d8034 --- /dev/null +++ b/src/types.test.ts @@ -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; diff --git a/src/types.ts b/src/types.ts index 7a6c6c7..f542d2d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -28,7 +28,6 @@ export type FieldsSubField = { export type ObjectOptions = { fields: FieldsSubField[]; - collapsed?: boolean; helpText?: string; }; @@ -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;