From 22aa252ed09169d110f4069353eaf6cc9fb78722 Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Thu, 9 Apr 2020 17:20:29 -0400 Subject: [PATCH] add partial to enable normalization --- .../maps/common/descriptor_types/descriptor_types.d.ts | 4 ++++ x-pack/plugins/maps/public/layers/layer.d.ts | 9 +++++++-- x-pack/plugins/maps/public/layers/vector_layer.d.ts | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/maps/common/descriptor_types/descriptor_types.d.ts b/x-pack/plugins/maps/common/descriptor_types/descriptor_types.d.ts index b989474b3c1f2..394b761e2d449 100644 --- a/x-pack/plugins/maps/common/descriptor_types/descriptor_types.d.ts +++ b/x-pack/plugins/maps/common/descriptor_types/descriptor_types.d.ts @@ -113,11 +113,15 @@ export type LayerDescriptor = { visible?: boolean; }; +export type PartialLayerDescriptor = Partial; + export type VectorLayerDescriptor = LayerDescriptor & { joins?: JoinDescriptor[]; style?: VectorStyleDescriptor; }; +export type PartialVectorLayerDescriptor = Partial; + export type RangeFieldMeta = { min: number; max: number; diff --git a/x-pack/plugins/maps/public/layers/layer.d.ts b/x-pack/plugins/maps/public/layers/layer.d.ts index 56d65870ac655..77eb53cd1b3d6 100644 --- a/x-pack/plugins/maps/public/layers/layer.d.ts +++ b/x-pack/plugins/maps/public/layers/layer.d.ts @@ -3,7 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { LayerDescriptor, MapExtent, MapFilters } from '../../common/descriptor_types'; +import { + LayerDescriptor, + MapExtent, + MapFilters, + PartialLayerDescriptor, +} from '../../common/descriptor_types'; import { ISource } from './sources/source'; import { DataRequest } from './util/data_request'; import { SyncContext } from '../actions/map_actions'; @@ -25,7 +30,7 @@ export interface ILayerArguments { } export class AbstractLayer implements ILayer { - static createDescriptor(options: LayerDescriptor, mapColors?: string[]): LayerDescriptor; + static createDescriptor(options: PartialLayerDescriptor, mapColors?: string[]): LayerDescriptor; constructor(layerArguments: ILayerArguments); getBounds(mapFilters: MapFilters): Promise; getDataRequest(id: string): DataRequest | undefined; diff --git a/x-pack/plugins/maps/public/layers/vector_layer.d.ts b/x-pack/plugins/maps/public/layers/vector_layer.d.ts index cd67a4f816b35..f4dbf7d07e76f 100644 --- a/x-pack/plugins/maps/public/layers/vector_layer.d.ts +++ b/x-pack/plugins/maps/public/layers/vector_layer.d.ts @@ -9,6 +9,7 @@ import { AbstractLayer } from './layer'; import { IVectorSource } from './sources/vector_source'; import { MapFilters, + PartialVectorLayerDescriptor, VectorLayerDescriptor, VectorSourceRequestMeta, } from '../../common/descriptor_types'; @@ -32,7 +33,7 @@ export interface IVectorLayer extends ILayer { export class VectorLayer extends AbstractLayer implements IVectorLayer { static createDescriptor( - options: VectorLayerDescriptor, + options: PartialVectorLayerDescriptor, mapColors?: string[] ): VectorLayerDescriptor;