import { Stage, type StructureComponent, type StructureRepresentationType } from "ngl";
import { type ErrorInfo, Component as ReactComponent, type ReactNode } from "react";
import type { Hetero } from "./hetero.js";
/**
* Determine the background color of the molecule viewer.
*
* If document has an element with a class `dark` or `light`, it will return 'black' and 'white' respectively.
* If prefers-color-scheme === dark, it will return 'black'.
* Otherwise, it will return 'white'.
*/
export declare function stageBackgroundColor(): "black" | "white";
/**
* Hook that provides the current NGL stage.
*
* @example
* Should be used in child components of NGLStage
* ```tsx
* import { useStage, NGLStage } from "@i-vresse/haddock3-ui/molviewer";
*
* function Child() {
* const stage = useStage();
* return
{stage.parameters}
;
* }
*
* function Parent() {
* return (
*
*
*
* );
* }
* ```
*/
export declare function useStage(): Stage;
export declare function NGLResidues({ residues, color, opacity, chain, representation, }: {
residues: number[];
color: string;
opacity?: number;
chain?: string;
representation: StructureRepresentationType;
}): null;
/**
* Hook that provides the current NGL structure component.
*
* @example
* Should be used in child components of NGLComponent
* ```tsx
* import { useComponent, NGLComponent, NGLStage } from "@i-vresse/haddock3-ui/molviewer";
*
* function Child() {
* const component = useComponent();
* return {component.type}
;
* }
*
* async function Parent() {
* const structure = new File(...);
* return (
*
*
*
*
*
* );
* }
* ```
*/
export declare function useComponent(): StructureComponent;
/**
* Set of default representation names in NGL.
*
* List from https://github.com/nglviewer/ngl/blob/5d64dbe6769448e0f33080e9ac957a70a0973a13/src/component/structure-component.ts#L52-L79
*/
export declare const defaultRepresentationNames: Set;
export declare function NGLComponent({ structure, chain, model, opacity, children, defaultRepresentation, }: {
structure: File | string;
chain?: string;
/**
* Index of the model to show (0 is the first), all models if undefined.
*/
model?: number;
opacity?: number;
children?: ReactNode;
defaultRepresentation?: boolean;
}): import("react/jsx-runtime").JSX.Element;
export declare function NGLStage({ onMouseLeave, onPick, onHover, children, }: {
children: ReactNode;
onPick?: (chain: string, residue: number, componentName: string, resname: string) => void;
onHover?: (chain: string, residue: number, componentName: string, resname: string) => void;
onMouseLeave?: () => void;
}): import("react/jsx-runtime").JSX.Element;
export declare class ErrorBoundary extends ReactComponent<{
children: ReactNode;
}, {
hasError: boolean;
}> {
constructor(props: {
children: ReactNode;
});
static getDerivedStateFromError(): {
hasError: boolean;
};
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable | null | undefined;
}
/**
* Use single surface to display multiple colors of residue sets
*/
export declare function NGLSurface({ active, passive, neighbours, highlight, activeColor, passiveColor, neighboursColor, highlightColor, defaultColor, opacity, }: {
active: number[];
passive: number[];
neighbours: number[];
highlight?: number | undefined;
activeColor?: string;
passiveColor?: string;
defaultColor?: string;
highlightColor?: string;
neighboursColor?: string;
opacity?: number;
}): null;
/**
* Component to render PDB file with NGL using its default representations.
*/
export declare function SimpleViewer({ structure, chain, defaultRepresentation, opacity, }: {
structure: File | string;
chain?: string;
defaultRepresentation?: boolean;
opacity?: number;
}): import("react/jsx-runtime").JSX.Element;
export declare function Viewer({ structure, chain, active, passive, renderSelectionAs, surface, neighbours, higlightResidue, onPick, onHover, onMouseLeave, selectionOpacity, surfaceOpacity, model, theme, }: {
structure: File;
chain: string;
active: number[];
passive: number[];
surface: number[];
/**
* Representation type to render the selection as.
*/
renderSelectionAs?: StructureRepresentationType;
/**
* Computed neighbours of the active or passive residues.
* Rendered similar to passive residues.
*/
neighbours?: number[];
higlightResidue?: number | undefined;
onPick?: (chain: string, residue: number) => void;
onHover?: (chain: string, residue: number) => void;
onMouseLeave?: () => void;
/**
* Opacity of the active, passive and neighbours residues.
*/
selectionOpacity?: number;
/**
* Opacity of the surface, when the selection is rendered as surface.
* Below 1 the cartoon shows through.
*/
surfaceOpacity?: number;
/**
* Index of the model to show of a multi-model structure (0 is the first).
*/
model?: number;
theme?: "light" | "dark";
}): import("react/jsx-runtime").JSX.Element;
/**
* Component that renders a ligand in PDB file.
*/
export declare function LigandViewer({ structure, selected, onPick, onHover, highlight, onMouseLeave, theme, }: {
structure: File;
selected: Hetero | undefined;
onPick: (picked: string) => void;
onHover: (hovering: string) => void;
highlight: string | undefined;
onMouseLeave?: () => void;
theme?: "light" | "dark";
}): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=molviewer.d.ts.map