@macrostrat/column-components
Version:
React rendering primitives for stratigraphic columns
62 lines (61 loc) • 2.24 kB
TypeScript
import { ReactNode } from 'react';
import { StatefulComponent } from '@macrostrat/ui-components';
import { Renderer } from './label-primitives';
import { ColumnCtx, ColumnDivision } from '../context';
declare const NoteLayoutContext: import('react').Context<null>;
interface NoteLayoutProviderProps {
notes: any[];
width: number;
paddingLeft: number;
noteComponent: any;
forceOptions: object;
children?: ReactNode;
}
interface NoteLayoutState {
notes?: any[];
elementHeights?: object;
columnIndex?: object;
nodes?: object;
updateHeight?: Function;
generatePath: Function;
createNodeForNote?: Function;
noteComponent?: any;
renderer?: typeof Renderer;
}
export interface NoteLayoutCtx {
renderer: typeof Renderer;
paddingLeft: number;
scale: Function;
width: number;
updateHeight: Function;
generatePath: Function;
columnIndex?: any;
nodes?: any;
}
declare class NoteLayoutProvider extends StatefulComponent<NoteLayoutProviderProps, NoteLayoutState> {
static contextType: import('react').Context<ColumnCtx<ColumnDivision>>;
static defaultProps: {
paddingLeft: number;
estimatedTextHeight(note: any, width: any): number;
};
context: ColumnCtx<ColumnDivision>;
_previousContext: ColumnCtx<ColumnDivision>;
_rendererIndex: object;
constructor(props: any);
render(): import('react').FunctionComponentElement<import('react').ProviderProps<null>>;
computeContextValue(): void;
savedRendererForWidth(width: any): any;
generatePath(node: any, pixelOffset: any): any;
createNodeForNote(note: any): any;
computeForceLayout(prevProps: any, prevState: any): void;
updateHeight(id: any, height: any): void;
updateNotes(): void;
componentDidMount(): void;
componentDidUpdate(prevProps: any, prevState: any): ColumnCtx<ColumnDivision> | undefined;
}
declare function NoteRect(props: any): import('react').DOMElement<any, Element> | null;
declare const NoteUnderlay: ({ ...rest }: {
[x: string]: any;
}) => import('react').FunctionComponentElement<any>;
export declare function useNoteLayout(): never;
export { NoteLayoutContext, NoteLayoutProvider, NoteRect, NoteUnderlay };