polen
Version:
A framework for delightful GraphQL developer portals
31 lines • 1.34 kB
TypeScript
/**
* Interactive GraphQL code block with tree-sitter parsing
*
* This component replaces CodeHike's default rendering for GraphQL code blocks
* that have the "interactive" meta flag. It provides:
* - Syntax highlighting using tree-sitter
* - Hover tooltips showing type information (when schema is available)
* - Click navigation to reference documentation
* - Integration with CodeHike's annotation system
*/
import type { React } from '#dep/react/index';
import type { HighlightedCode } from 'codehike/code';
import type { GraphQLSchema } from 'graphql';
interface GraphQLInteractiveProps {
/** The code block from CodeHike with code and annotations */
codeblock: HighlightedCode;
/** The GraphQL schema for providing type information and validation */
schema?: GraphQLSchema;
/** Whether to show a warning indicator when schema is missing */
showWarningIfNoSchema?: boolean;
}
/**
* Main GraphQL Interactive component with error boundary protection
*
* This is the component that should be used in user code. It wraps the
* internal implementation with an error boundary that provides graceful
* fallback to static code rendering if interactive features fail.
*/
export declare const GraphQLInteractive: React.FC<GraphQLInteractiveProps>;
export {};
//# sourceMappingURL=GraphQLInteractive.d.ts.map