UNPKG

259 BTypeScriptView Raw
1/**
2 * Makes the specified properties in a type optional.
3 * @example type NotifyData = Optional<EventData, "object">
4 * // returns: { eventName: string; object?: Observable }
5 */
6export type Optional<T, K extends keyof T> = Omit<T, K> & { [P in K]?: T[P] };