mmr-gl-react
Version:
React components for MMR GL JS-compatible libraries
18 lines (17 loc) • 563 B
TypeScript
import type { CustomLayerInterface, ILayer } from '../types';
type OptionalId<T> = T extends {
id: string;
} ? Omit<T, 'id'> & {
id?: string;
} : T;
type OptionalSource<T> = T extends {
source: string;
} ? Omit<T, 'source'> & {
source?: string;
} : T;
export type LayerProps<LayerT> = OptionalSource<OptionalId<LayerT>> & {
/** If set, the layer will be inserted before the specified layer */
beforeId?: string;
};
declare function Layer<LayerT extends ILayer>(props: LayerProps<LayerT | CustomLayerInterface>): any;
export default Layer;