Skip to content

Commit

Permalink
Merge pull request #135 from hasparus/patch-1
Browse files Browse the repository at this point in the history
Update LiveProviderProps type
  • Loading branch information
sofiapoh authored Apr 24, 2019
2 parents a7b3f7f + 7eab501 commit 2fe4222
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions typings/react-live.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ComponentClass, StatelessComponent, HTMLProps, ComponentType } from 'react'
import { PrismTheme, Language } from 'prism-react-renderer';

// Helper types
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
Expand All @@ -13,6 +14,9 @@ export type LiveProviderProps = Omit<DivProps, 'scope'> & {
code?: string;
noInline?: boolean;
transformCode?: (code: string) => string;
language?: Language;
disabled?: boolean;
theme?: PrismTheme;
}

export const LiveProvider: ComponentClass<LiveProviderProps>
Expand Down
8 changes: 8 additions & 0 deletions typings/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export const providerC = (
scope={{ Component: React.Component }}
transformCode={(code: string): string => code + ';;'}
noInline={false}
language="typescript"
theme={{
plain: {
fontWeight: '800',
color: 'salmon'
},
styles: []
}}
/>
);

Expand Down

0 comments on commit 2fe4222

Please sign in to comment.