Files
frontend-app-authoring/src/types.ts
Navin Karkera 3c22e4bbe1 feat: Add sidebar and library dropdown filter [FC-0114] (#2778)
* Add flow in course outline sidebar. Allows author to add new section/subsection/unit or any container from existing libraries via sidebar.
* Adds library dropdown filter and collections dropdown filter in add sidebar. Allows authors to filter containers by selected libraries and collections.
2026-01-09 12:14:48 -05:00

11 lines
368 B
TypeScript

/** Utility type: makes one field required */
export type AtLeastOne<T, U = { [K in keyof T]: Pick<T, K> }> = Partial<T> & U[keyof U];
export type ValueOf<T> = T[keyof T];
/** Utility type: makes K required when Cond is true */
export type RequireIf<Obj, K extends keyof Obj, Cond extends boolean> =
Cond extends true
? Obj & Required<Pick<Obj, K>>
: Obj;