* feat: 🎸 add @kbn/utility-types * feat: 🎸 improve @kbn/utility-types * chore: 🤖 move @kbn/utility-types to dev deps * chore: 🤖 change @kbn/utility-types build setup * fix: 🐛 implement review suggestions * feat: 🎸 add ShallowPromise type * Update packages/kbn-utility-types/README.md Co-Authored-By: Luke Elmers <lukeelmers@gmail.com> * test: 💍 add tests for utility-types * chore: 🤖 add utility-types tests to TypeScript config * test: 💍 remove negative tests to not cause TypeScript fail * chore: 🤖 remove ref to type defs to try fix CI tests * Update packages/kbn-utility-types/index.ts Co-Authored-By: Spencer <email@spalger.com> * chore: 🤖 add TS types index to fix `grunt run:test_projects` * chore: 🤖 use similar tsconfig.json as in other packages * chore: 🤖 add "clean" script * chore: 🤖 add kbn:bootstrap script |
||
---|---|---|
.. | ||
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 asPromise
type, but it flat maps the wrapped type.ObservableLike<T>
— Minimal interface for an object resembling anObservable
.