Skip to content

Commit

Permalink
add partial to enable normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Apr 9, 2020
1 parent fd120db commit 22aa252
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,15 @@ export type LayerDescriptor = {
visible?: boolean;
};

export type PartialLayerDescriptor = Partial<LayerDescriptor>;

export type VectorLayerDescriptor = LayerDescriptor & {
joins?: JoinDescriptor[];
style?: VectorStyleDescriptor;
};

export type PartialVectorLayerDescriptor = Partial<VectorLayerDescriptor>;

export type RangeFieldMeta = {
min: number;
max: number;
Expand Down
9 changes: 7 additions & 2 deletions x-pack/plugins/maps/public/layers/layer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<MapExtent>;
getDataRequest(id: string): DataRequest | undefined;
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/maps/public/layers/vector_layer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AbstractLayer } from './layer';
import { IVectorSource } from './sources/vector_source';
import {
MapFilters,
PartialVectorLayerDescriptor,
VectorLayerDescriptor,
VectorSourceRequestMeta,
} from '../../common/descriptor_types';
Expand All @@ -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;

Expand Down

0 comments on commit 22aa252

Please sign in to comment.