kibana/packages/kbn-utility-types
Spencer a859577b40
Remove rimraf (#48985)
* Update dependency del to v5

* unify del/rimraf usage with del v5

* update yarn.lock

* update kbn-pm distributable

* remove poorly transformed code

* force some deletes from tmp

* mock less of the fs module

* force tmp deletion in a few more suites

* please make this the last force
2019-10-24 06:29:43 -07:00
..
test-d Utility types (#41246) 2019-08-12 15:45:32 +02:00
index.ts Utility types (#41246) 2019-08-12 15:45:32 +02:00
package.json Remove rimraf (#48985) 2019-10-24 06:29:43 -07:00
README.md Utility types (#41246) 2019-08-12 15:45:32 +02:00
tsconfig.json Utility types (#41246) 2019-08-12 15:45:32 +02:00

@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.