kibana/packages/kbn-utility-types
..
test-d
index.ts
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

  • UnwrapPromise<T> — Returns wrapped type of a promise.
  • UnwrapObservable<T> — Returns wrapped type of an observable.
  • ShallowPromise<T> — Same as Promise type, but it flat maps the wrapped type.
  • ObservableLike<T> — Minimal interface for an object resembling an Observable.