* 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.
11 lines
368 B
TypeScript
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;
|