@pansy/react-mapbox-gl
Version:
🌍 基于 Mapbox GL 封装的 React 组件库
17 lines (16 loc) • 445 B
TypeScript
export type { KeysOfUnion } from 'type-fest';
export interface Instance {
on(type: string, handle: (...args: any[]) => void): void;
off(type: string, handle: (...args: any[]) => void): void;
[key: string]: any;
}
export type OptionalId<T> = T extends {
id: string;
} ? Omit<T, 'id'> & {
id?: string;
} : T;
export type OptionalSource<T> = T extends {
source: string;
} ? Omit<T, 'source'> & {
source?: string;
} : T;