import type { PropsWithChildren, ReactElement } from "react";
import type { CameraState, Cognite3DViewerOptions, NodeAppearance } from "@cognite/reveal";
import type { DmsUniqueIdentifier, ExternalId, Space } from "@cognite/reveal-components/data-providers";
import type { AssetId } from "@cognite/reveal-components/data-providers/cache";
import type { AddReveal3DResource, AllResourceIdentifier, BaseAddOptions, CadAddOptions, NewCadModelStyling as CadModelStyling, CadResourceIdentifier, Classic3DResourceIdentifier, DM3DResourceIdentifier, Image360AddOptions, Image360DMResourceIdentifier, Image360EventsResourceIdentifier, Image360IconCullingOptions, Image360ResourceIdentifier, PointCloudAddOptions, PointCloudResourceIdentifier, SceneAddOptions, SceneResourceIdentifier, ThreeDResourceIdentifier } from "@cognite/reveal-components/data-providers/types";
import { type RevealWidgetTrackingProps } from "@cognite/reveal-components/ui/components";
import type { InstanceId, UsageMetricsTracker } from "@cognite/reveal-components/utilities";
import type { InstanceStylingGroup } from "@cognite/reveal-components/utilities/modelIds";
import type { TreeIndexStylingGroup } from "@cognite/reveal-components/utilities/styling";
export type { AddReveal3DResource, AllResourceIdentifier, AssetId, BaseAddOptions, CadAddOptions, CadModelStyling, CadResourceIdentifier, Classic3DResourceIdentifier, DM3DResourceIdentifier, DmsUniqueIdentifier, ExternalId, Image360AddOptions, Image360DMResourceIdentifier, Image360EventsResourceIdentifier, Image360IconCullingOptions, Image360ResourceIdentifier, InstanceId, InstanceStylingGroup, UsageMetricsTracker, PointCloudAddOptions, PointCloudResourceIdentifier, RevealWidgetTrackingProps, SceneAddOptions, SceneResourceIdentifier, Space, ThreeDResourceIdentifier, TreeIndexStylingGroup };
/**
* Public API surface for the standalone `@cognite/reveal-widget` npm package.
*
* `RevealWidget` here is the real, unmodified implementation from
* `@cognite/reveal-components` — there is no runtime wrapper. `@cognite/reveal-components`
* is a `dependencies` entry, so it and its own published dependencies (`@cognite/signal-utils`,
* `@cognite/underscore`) are treated as external. The resource/identifier types above are
* re-exported directly from `@cognite/reveal-components`'s narrow, already-subpath-exported
* type barrels (`./data-providers/types`, `./utilities/modelIds`, `./utilities`), which an
* external consumer resolves normally since that package is published.
*
* `Reveal3DResourceHandle`, `RevealWidgetController`, `RevealWidgetCameraController`, `RevealWidgetAssets`, `RevealWidgetHtmlOverlays`, and
* `RevealWidgetProps` below are still hand-declared, because their real counterparts (only
* reachable via the entangled `./ui/components` export) expose `RevealDomainObject`/
* `SceneDomainObject` directly in their signatures — too large for API Extractor's type bundler
* and not meaningful for an external consumer anyway. `src/index.test.ts` has compile-time-only
* (`// @ts-expect-error`-driven) tests asserting these hand-written types stay structurally
* compatible with the real implementation — update both together when the real API changes.
* `RevealWidgetTrackingProps` (and its arms) don't have this problem — they only reference
* `UsageMetricsTracker`, so they're imported and re-exported directly from `./ui/components`
* rather than hand-declared.
*
* `tracking`/`appIdentifier` (on `RevealWidgetProps`) plumb through to the real `RevealWidget`'s
* usage-tracking seam, which reports to a dedicated, named `mixpanel-browser` instance *by
* default* — not Fusion's own `@cognite/metrics`/Mixpanel setup, since `@cognite/reveal-widget`
* is also consumed outside this monorepo. Pass `tracking: { disabled: true }` to opt out
* entirely, or `tracking: { mixpanelToken }` (with `appIdentifier`) to report to your own
* Mixpanel project instead.
*/
export declare const Default3DStyles: {
	Highlighted: {
		cad: NodeAppearance;
		pointcloud: NodeAppearance;
		image360: NodeAppearance;
	};
};
/**
* A narrow, external-facing view of a loaded 3D resource (CAD model, point cloud, image360
* collection, or scene). This is a type-only narrowing — the actual object returned at runtime
* by `addResource()`/`getModels()` is still the real `RevealDomainObject`/`SceneDomainObject`.
* Only `.remove()` is published here to keep the exported type surface minimal.
*/
export type Reveal3DResourceHandle = {
	remove(): boolean;
};
/**
* A scene that can be loaded for a location, and the (sub-)location it is
* configured on.
*/
export type LocationSceneCandidate = {
	scene: DmsUniqueIdentifier;
	locationName: string;
};
/**
* Outcome of `RevealWidgetController.addResourceByLocation`:
* - `loaded`: the scene was added to the widget
* - `selection-required`: the location has several scenes (its own and those of
*   its sub-locations); nothing was loaded, call again with the chosen scene
* - `not-found`: no such location, or it has no scene
*/
export type AddResourceByLocationResult = SceneLoadedForLocation | SceneSelectionRequiredForLocation | SceneNotFoundForLocation;
export type SceneLoadedForLocation = {
	status: "loaded";
	scene: Reveal3DResourceHandle;
};
export type SceneSelectionRequiredForLocation = {
	status: "selection-required";
	candidates: LocationSceneCandidate[];
};
export type SceneNotFoundForLocation = {
	status: "not-found";
};
/**
* An asset that is mapped to a loaded 3D model.
*/
export type MappedAsset = {
	name: string;
	description?: string;
	/** Pass to `styleByInstance` / `focusInstances` to highlight or zoom to the asset */
	instanceId: InstanceId;
};
/**
* Options for `RevealWidgetAssets.searchMappedAssets`.
*/
export type SearchMappedAssetsOptions = {
	/**
	* Free-text search on the asset name and description. Not guaranteed to
	* return all matching assets.
	*/
	query?: string;
	/** Maximum number of assets to return (default 100, maximum 1000) */
	limit?: number;
};
/**
* Result of `RevealWidgetAssets.searchMappedAssets`.
*/
export type SearchMappedAssetsResult = {
	assets: MappedAsset[];
	/**
	* True if there may be more matching assets than were returned. Pagination is
	* not supported, so use `query` to narrow down the search.
	*/
	hasMore: boolean;
};
/**
* Search for the assets mapped to the models in the widget.
*/
export type RevealWidgetAssets = {
	/**
	* Search the core data model assets that are mapped to the visible CAD models,
	* point clouds and data model 360 image collections, including those of a
	* loaded scene. Only data modeling assets are searched, never classic assets,
	* so this is intended for data-modeling-only projects. Use the returned
	* `instanceId`s with `styleByInstance` and `focusInstances` to highlight an
	* asset and zoom to it.
	*/
	searchMappedAssets(options?: SearchMappedAssetsOptions): Promise<SearchMappedAssetsResult>;
};
/**
* A position in the CDF coordinate system, i.e. the one the coordinates of
* CDF 3D models and their assets are given in
*/
export type HtmlOverlayPosition = {
	x: number;
	y: number;
	z: number;
};
/**
* A handle to an HTML overlay added to the widget
*/
export type HtmlOverlayHandle = {
	/**
	* Removes the overlay's element from the widget. Does nothing if
	* it has already been removed.
	*/
	remove(): void;
};
/**
* Attaching HTML elements to positions in the 3D scene of the widget,
* e.g. to show notifications.
*/
export type RevealWidgetHtmlOverlays = {
	/**
	* Attaches an HTML element to a position in the scene. The element follows the
	* position as the camera moves, and is hidden while the position is not in view.
	*
	* The widget sets `position: absolute` on the element, which the overlay requires.
	* Styling such as `transform: translate(-50%, -50%)` to center the element on the
	* position, and `pointer-events: none` to not interfere with camera navigation,
	* is up to the caller.
	*
	* ```
	* const overlay = controller.htmlOverlays.add(element, { x: 10, y: 20, z: 5 });
	*
	* // during cleanup:
	* overlay.remove();
	* ```
	*
	* @param element The element to attach. Adding the same element again moves it.
	* @param position The position in CDF coordinates
	*/
	add(element: HTMLElement, position: HtmlOverlayPosition): HtmlOverlayHandle;
	/**
	* Removes all the overlays added to the widget
	*/
	clear(): void;
	/**
	* Hides or shows all the overlays, including ones added later. They are visible by default.
	*/
	setVisible(visible: boolean): void;
};
export type RevealWidgetCameraController = {
	/**
	* Focus all visible models in the scene
	*/
	focusCameraAll(): void;
	/**
	* Focus on a single given 3D model
	*/
	focusModel(handle: Reveal3DResourceHandle): void;
	/**
	* Returns the state of the camera in the Reveal viewer
	*/
	getCameraState(): Required<CameraState>;
	/**
	* Sets the state of the camera
	*/
	setCameraState(cameraState: CameraState): void;
	enterNearby360Image(): Promise<void> | undefined;
};
export type RevealWidgetController = {
	/**
	* Access the RevealWidgetCameraController for camera controls
	*/
	readonly cameraController: RevealWidgetCameraController;
	/**
	* Access the RevealWidgetAssets for searching the assets mapped to the models
	*/
	readonly assets: RevealWidgetAssets;
	/**
	* Access the RevealWidgetHtmlOverlays for attaching HTML elements to positions in the scene
	*/
	readonly htmlOverlays: RevealWidgetHtmlOverlays;
	/**
	* Add a 3D resource (i.e. model or scene) to the widget.
	* Added resources can be removed by calling their `.remove` method.
	*/
	addResource(resource: AllResourceIdentifier): Promise<Reveal3DResourceHandle>;
	/**
	* Load a scene from a location (matched by external ID or name). If the
	* location, including its sub-locations, has exactly one scene it is loaded.
	* If it has several, nothing is loaded and the candidates are returned so the
	* caller can ask the user to pick one, then call this method again with
	* `selectedScene`.
	*/
	addResourceByLocation(location: string, selectedScene?: DmsUniqueIdentifier): Promise<AddResourceByLocationResult>;
	/**
	* Get all models added to the RevealWidget
	*/
	getModels(): Reveal3DResourceHandle[];
	/**
	* Get all models added to the RevealWidget that are visible
	*/
	getVisibleModels(): Reveal3DResourceHandle[];
	/**
	* Style the provided instances with the associated styles in the given models, if
	* the instances are contextualized to the models
	*/
	styleByInstance(instanceStylingGroups: InstanceStylingGroup[], handles: Reveal3DResourceHandle[]): Promise<void>;
	/**
	* Moves the camera to show the provided instances in the visible models in the scene.
	*/
	focusInstances(instances: InstanceId[]): Promise<void>;
};
export type RevealWidgetProps = {
	/**
	* Defines the initialization options for the RevealWidget, including the SDK and data modeling status
	* The user can either specify these separately, or opt for the object
	* `{ inheritFromRevealContext: true }`, in which case the Widget will assume the existence of
	* a `RevealContext` mounted above it in the hierarchy.
	*/
	viewerOptions: (Pick<Cognite3DViewerOptions, "sdk" | "onLoading"> & {
		useCoreDm: boolean;
	}) | {
		/**
		* Disables the RevealWidget's own RevealContext, relying on one defined in the application
		* layer instead.
		*/
		inheritFromRevealContext: true;
	};
	/**
	* The widget uses this to set a reference to the widget controller.
	* The widget calls this with `undefined` when the component unmounts or this callback changes
	*/
	setControllerRef?: (controller: RevealWidgetController | undefined) => void;
	/**
	* Reports which application is using the widget and which of its features are being triggered
	* (e.g. adding a resource, moving the camera). See `RevealWidgetTrackingProps` for the options.
	*/
	tracking?: RevealWidgetTrackingProps;
	/** Identifies the host application */
	appIdentifier: string;
};
export declare const RevealWidget: (props: PropsWithChildren<RevealWidgetProps>) => ReactElement;
