/** * @file AnchorNav * @description 锚点导航 * @author hsm-lv */ /// import React from 'react'; import { Schema } from '../types'; import { ThemeProps } from '../theme'; import { PlainObject } from '../types'; export interface AnchorNavSectionProps extends ThemeProps { title?: string; name: string | number; body?: Schema; className?: string; } declare class AnchorNavSectionComponent extends React.PureComponent { contentDom: any; contentRef: (ref: any) => any; render(): JSX.Element; } export declare const AnchorNavSection: { new (props: (Pick & import("../theme").ThemeOutterProps) | Readonly & import("../theme").ThemeOutterProps>): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly & import("../theme").ThemeOutterProps> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; }; new (props: Pick & import("../theme").ThemeOutterProps, context: any): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly & import("../theme").ThemeOutterProps> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextType: React.Context; ComposedComponent: typeof AnchorNavSectionComponent; } & import("hoist-non-react-statics").NonReactStatics & { ComposedComponent: typeof AnchorNavSectionComponent; }; export interface AnchorNavProps extends ThemeProps { links?: Array; active?: string | number; linkClassName?: string; sectionClassName?: string; sectionRender?: (section: AnchorNavSectionProps, props?: AnchorNavProps) => JSX.Element; onSelect?: (key: string | number) => void; } export interface AnchorNavState { offsetArr: PlainObject[]; fromSelect: boolean; } export declare class AnchorNav extends React.Component { static defaultProps: Pick; contentDom: React.RefObject; componentDidMount(): void; scrollToNav(e: Event): void; scrollToSection(key: string | number): void; handleSelect(key: string | number): void; fireSelect(key: string | number): void; renderLink(link: any, index: number): JSX.Element | undefined; renderSection(section: any, index: number): React.DetailedReactHTMLElement | undefined; render(): JSX.Element | null; } declare const _default: { new (props: (Pick, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps) | Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; }; new (props: Pick, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps, context: any): { render(): JSX.Element; context: any; setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, "active" | "links" | "onSelect" | "sectionRender"> & Partial, "linkClassName" | "sectionClassName">> & Partial, never>> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextType: React.Context; ComposedComponent: typeof AnchorNav; } & import("hoist-non-react-statics").NonReactStatics & { ComposedComponent: typeof AnchorNav; } & { AnchorNavSection: typeof AnchorNavSection; }; export default _default;