import type { Maybe, SafeAny, WrClassInput } from 'ngwr/utils';Common types
Shared type aliases from ngwr/utils.
Installation
Usage
function findUser(id: string): Maybe<User> {
return db.get(id) ?? null;
}
// A deliberate, searchable `any`.
function fromLegacyBridge(payload: SafeAny): void {
// narrow before use
}
// What every panelClass takes.
const extra: WrClassInput = wide() ? 'w-[40rem] shadow-2xl' : null;API
| Name | Description | Type | Default |
|---|---|---|---|
Maybe<T> | T | null | undefined. isDefined narrows it back to T. | type alias | — |
SafeAny | A deliberate any for interop boundaries, easy to search for. | type alias | — |
WrClassInput | Extra classes for a part ngwr renders: string | readonly string[] | null | undefined. Every panelClass takes it; toClassList normalises one. | type alias | — |
See also
Util isDefinedType guard that drops null and undefined, for use with Array.filter.Util toClassListFlattens class inputs into a de-duplicated list of single class names.Type Type conventionsHow ngwr declares and exports its public types.Type CatalogThe public types you use most, grouped by area and linked to the page that uses them.Util isNonEmptyArrayType guard for an array with at least one element, so [0] is typed T.