ConstOptionaloptions: StringOptionsexport const MyEnum = createSafeEnum(['a', 'b', 'c'] as const);
export type MyEnum = Static<typeof MyEnum.schema>;
// type MyEnum = "a" | "b" | "c" | "unknown"
export const MY_ENUMS = MyEnum.values;
// MY_ENUMS = ["a", "b", "c", "unknown"]
export const MY_ENUM = MyEnum.record;
// MY_ENUM = { a: "a", b: "b", c: "c", unknown: "unknown" }
Utility that both creates a SafeStringEnumSchema and returns it along with the values in a readonly array, and a record of the enum values, with 'unknown' included.
Used to allow an extension to both define the schema and export the values in a consistent way.