Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/// <reference types="draft-js" />
/// <reference types="react" />
/// <reference types="immutable" />

import * as React from 'react';
import * as Draft from 'draft-js';
import * as Immutable from 'immutable';

export default class PrismDecorator {
highlighted: any;
constructor(options?: IPrismOptions);
/**
* Return list of decoration IDs per character
*
* @param {ContentBlock}
* @return {List<String>}
*/
getDecorations(block: any): Immutable.List<string>;
/**
* Return component to render a decoration
*
* @param {String}
* @return {Function}
*/
getComponentForKey(key: any): (props: any) => React.DOMElement<any, any>;
/**
* Return props to render a decoration
*
* @param {String}
* @return {Object}
*/
getPropsForKey(key: any): {
type: any;
};
}

export interface IPrismOptions {
defaultSyntax?: string;
getSyntax?: (block: Draft.ContentBlock) => string;
render?: (props: any) => React.DOMElement<any, any>;
blockFilter?: (block: Draft.ContentBlock) => boolean;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "draft-js-prism",
"version": "1.0.3",
"version": "1.0.4",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you undo this version change? Thanks!

"description": "Code highlighting for DraftJS",
"main": "./lib/index.js",
"scripts": {
Expand Down