kibana/packages/kbn-utility-types
2020-01-24 15:20:09 -07:00
..
test-d
index.ts Add isSystemRequest support to Kibana Platform (#53734) 2020-01-24 15:20:09 -07:00
package.json Shim input_control_vis for KP (#52243) 2019-12-18 16:25:35 -06:00
README.md State containers (#52384) 2019-12-06 10:53:06 -08:00
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

  • Ensure<T, X> — Makes sure T is of type X.
  • ObservableLike<T> — Minimal interface for an object resembling an Observable.
  • RecursiveReadonly<T> — Like Readonly<T>, but freezes object recursively.
  • ShallowPromise<T> — Same as Promise type, but it flat maps the wrapped type.
  • UnwrapObservable<T> — Returns wrapped type of an observable.
  • UnwrapPromise<T> — Returns wrapped type of a promise.