1.0.5 • Published 6 months ago

@types/react-highlight.js v1.0.5

Weekly downloads
963
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/react-highlight.js

Summary

This package contains type definitions for react-highlight.js (https://github.com/bvaughn/react-highlight.js).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-highlight.js.

index.d.ts

// Type definitions for react-highlight.js 1.0
// Project: https://github.com/bvaughn/react-highlight.js
// Definitions by: Christian Murphy <https://github.com/ChristianMurphy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import { ComponentClass, ReactNode } from 'react';

/**
 * Props for a Highlight component.
 */
export interface HighlightProps {
    /**
     * Language name to use as a class to signal type to highlight.js.
     */
    language: string;

    /**
     * Language name to use as a class to signal type to highlight.js.
     */
    className?: string | undefined;

    /**
     * Inline styles to apply to the rendered <pre> tag.
     */
    style?: React.CSSProperties | undefined;

    /**
     * Content that will be highlighted
     */
    children?: ReactNode | undefined;
}

/**
 * A lightweight React wrapper around the Highlight.js syntax highlighting library.
 */
declare const Highlight: ComponentClass<HighlightProps>;

export default Highlight;

Additional Details

  • Last updated: Thu, 28 Oct 2021 12:31:34 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Christian Murphy.