diff --git a/src/components/layer.ts b/src/components/layer.ts index 115b21d9..a1e53dd0 100644 --- a/src/components/layer.ts +++ b/src/components/layer.ts @@ -8,8 +8,9 @@ import type {MapInstance, AnyLayer, CustomLayerInterface} from '../types'; // Omiting property from a union type, see // https://github.com/microsoft/TypeScript/issues/39556#issuecomment-656925230 type OptionalId = T extends {id: string} ? Omit & {id?: string} : T; +type OptionalSource = T extends {source: string} ? Omit & {source?: string} : T; -export type LayerProps = OptionalId & { +export type LayerProps = OptionalSource> & { /** If set, the layer will be inserted before the specified layer */ beforeId?: string; };