7c4e4f507b
* chore(NA): replace babel config files by inline presets by default in the js_ts_transpiler rule * chore(NA): update @kbn/ace build to exclude worker file * chore(NA): remove config file support Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
jest | ||
src | ||
BUILD.bazel | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/utility-types
TypeScript utility types for usage in Kibana.
- This package re-exports a subset of the items in
utility-types
- You can also add more utility types here.
Usage
import { UnwrapPromise } from '@kbn/utility-types';
type A = Promise<string>;
type B = UnwrapPromise<A>; // string
Reference
Assign<T, U>
— FromU
assign properties toT
(just like object assign).Ensure<T, X>
— Makes sureT
is of typeX
.ObservableLike<T>
— Minimal interface for an object resembling anObservable
.PublicContract<T>
— Returns an object with public keys only.PublicKeys<T>
— Returns public keys of an object.RecursiveReadonly<T>
— LikeReadonly<T>
, but freezes object recursively.ShallowPromise<T>
— Same asPromise
type, but it flat maps the wrapped type.UnionToIntersection<T>
— Converts a union of types into an intersection.UnwrapObservable<T>
— Returns wrapped type of an observable.UnwrapPromise<T>
— Returns wrapped type of a promise.UnwrapPromiseOrReturn<T>
— Returns wrapped type of a promise or the type itself, if it isn't a promise.Values<T>
— Returns object or array value types.