@awsui/components-react
Version:
On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en
36 lines • 1.02 kB
TypeScript
/**
* Makes specified properties required.
*
* @example
* ```
* import { AlertProps } from '~components/alert/interfaces'
*
* type InternalAlertProps = SomeRequired<AlertProps, 'type'>
*
* function Alert(props: AlertProps) { ... }
* function InternalAlert(props: InternalAlertProps) { ... }
* ```
*/
export type SomeRequired<Type, Keys extends keyof Type> = Type & { [Key in Keys]-?: Type[Key] };
/**
* Makes specified properties optional.
*
* @example
* ```
* type PartialAlertProps = SomeOptional<AlertProps, 'type' | 'children'>
* ```
*/
export type SomeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
/**
* Utility type that makes a union of given type and undefined.
* @example
* ```
* type OptionalString = Optional<string>
* type OptionalStringOrNumber = Optional<string | number>
* ```
*/
export type Optional<Type> = Type | undefined;
/**
* Use this function to mark conditions which should never be visited
*/
export declare function assertNever(_value: never): null;