kibana/packages/kbn-utility-types
Spencer 32491462a9
add kibana.jsonc files to existing packages (#138965)
* [packages] add kibana.jsonc files

* auto-migrate to kibana.jsonc

* support interactive pkg id selection too

* remove old codeowners entry

* skip codeowners generation when .github/CODEOWNERS doesn't exist

* fall back to format validation if user is offline

* update question style

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-08 13:31:57 -07:00
..
src @kbn/utility-types: DotObject and DedotObject (#139539) 2022-08-31 17:51:34 +02:00
BUILD.bazel @kbn/utility-types: DotObject and DedotObject (#139539) 2022-08-31 17:51:34 +02:00
index.ts @kbn/utility-types: DotObject and DedotObject (#139539) 2022-08-31 17:51:34 +02:00
kibana.jsonc add kibana.jsonc files to existing packages (#138965) 2022-09-08 13:31:57 -07:00
package.json add kibana.jsonc files to existing packages (#138965) 2022-09-08 13:31:57 -07:00
README.md @kbn/utility-types: DotObject and DedotObject (#139539) 2022-08-31 17:51:34 +02:00
tsconfig.json chore(NA): remove src folder requirement from packages (part 2) (#138476) 2022-08-30 15:57:35 +01: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 { UnwrapObservable } from '@kbn/utility-types';

type A = Observable<string>;
type B = UnwrapObservable<A>; // string

Reference

  • Assign<T, U> — From U assign properties to T (just like object assign).
  • DotObject<T> — Convert type T to a flattened structure.
  • DedotObject<T> — The inverse of DotObject<T>: convert the flattened type T to a deeply-nested type.
  • Ensure<T, X> — Makes sure T is of type X.
  • ObservableLike<T> — Minimal interface for an object resembling an Observable.
  • PublicContract<T> — Returns an object with public keys only.
  • PublicKeys<T> — Returns public keys of an object.
  • RecursiveReadonly<T> — Like Readonly<T>, but freezes object recursively.
  • ShallowPromise<T> — Same as Promise 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.
  • Values<T> — Returns object or array value types.