import type { Billboard, BillboardCollection, Entity, Event, Label, LabelCollection, Model, ModelNode, PointPrimitive, PointPrimitiveCollection, Polyline, PolylineCollection, Primitive, } from "cesium"; export type ValueOf = T[keyof T]; export type ArrayKeys = StringOnly< K extends readonly (infer E)[] ? E : K extends (infer E)[] ? E : K >; export type Merge = Omit & B; export type UnionMerge = Omit & Omit & { [K in keyof A & keyof B]: A[K] | B[K] }; export type PickCesiumProps< T, K extends readonly any[] | string, Required extends ArrayKeys = never, > = RemoveReadOnlyAndPartial>, Required>; export type ConstructorOptions any> = NonNullable< ConstructorParameters[0] >; export type ConstructorOptions2 any> = NonNullable< ConstructorParameters[1] >; export type StaticMethodOptions< T extends Record any>, K extends keyof T, > = NonNullable[0]>; export type StaticMethodOptions2< T extends Record any>, K extends keyof T, > = NonNullable[1]>; export type MethodOptions< T extends new (...args: any) => any & Record any>, K extends keyof T, > = NonNullable[K]>[0]>; export type MethodOptions2< T extends new (...args: any) => any & Record any>, K extends keyof T, > = NonNullable[K]>[1]>; export type UnusedCesiumProps< T, K, // eslint-disable-next-line @typescript-eslint/no-empty-object-type E extends Record = {}, I extends string = never, > = Exclude, ArrayKeys, E>, I>; // eslint-disable-next-line @typescript-eslint/no-empty-object-type type InvalidProps = {}> = | Exclude | Exclude; type CesiumPureProps = Exclude< StringOnly, FunctionKeys | Exclude, CesiumEventKeys> | "prototype" | PrivateKeys >; type PrivateKeys = { [K in keyof T]: K extends `_${string}` ? K : never; }[keyof T]; type StringOnly = K extends string ? K : never; type CesiumEventKeys = { [K in keyof T]: T[K] extends Event ? K : never; }[keyof T]; type FunctionKeys = { [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never; }[keyof T]; type IfEquals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? A : B; // MUST use mapped type syntax (not Record) for IfEquals to work correctly type ReadonlyKeys = { // eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style [P in keyof T]-?: IfEquals<{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, never, P>; }[keyof T]; type RemoveReadOnlyAndPartial = { -readonly [key in keyof Pick]: T[key]; } & { -readonly [key in keyof Omit]?: T[key]; }; export type EventTarget = { id: Entity; } & ( | { primitive: Primitive } | { primitive: Model; node: ModelNode; } | { collection: BillboardCollection; primitive: Billboard } | { collection: LabelCollection; primitive: Label } | { collection: PointPrimitiveCollection; primitive: PointPrimitive } | { collection: PolylineCollection; primitive: Polyline } );