message: a couple of helper types for getting promised return types
diff: @@ -122,3 +122,15 @@ export type DataSourceForPlaceable<P extends PlaceableObject> = P extends Placea
  ? D['_source']
  : never
  : never;
  +
  +/**
  + * If T is Promise<TResult> then TResult; otherwise T.
  + */
  +export type PromisedType<T> = T extends Promise<infer Result> ? Result : T;
  +
  +/**
  + * If ReturnType<T> is Promise<TResult> then TResult; otherwise ReturnType<T>.
  + */
  +export type PromisedReturnType<T extends (...args: any) => any> = ReturnType<T> extends Promise<infer ResultType>
  + ? ResultType
  + : ReturnType<T>;
  