@procore/core-react
Version:
React library of Procore Design Guidelines
24 lines (23 loc) • 1 kB
TypeScript
import React from 'react';
import type { AnchorNavigationElementSection } from './AnchorNavigation.types';
export declare const AnchorNavigationContext: React.Context<{
offset: number;
sections: AnchorNavigationElementSection[];
selected: string;
registerSection: (id: string, label: string, element: HTMLElement) => void;
unregisterSection: (id: string) => void;
onSelect: (id: string, withScroll?: boolean) => void;
}>;
export declare const useAnchorNavigationContext: () => {
offset: number;
sections: AnchorNavigationElementSection[];
selected: string;
registerSection: (id: string, label: string, element: HTMLElement) => void;
unregisterSection: (id: string) => void;
onSelect: (id: string, withScroll?: boolean) => void;
};
interface AnchorNavigationProviderProps {
offset?: number;
}
export declare function AnchorNavigationProvider({ children, offset, }: React.PropsWithChildren<AnchorNavigationProviderProps>): React.JSX.Element;
export {};