diff --git a/types/react-frame-component/index.d.ts b/types/react-frame-component/index.d.ts new file mode 100644 index 0000000000..2e0712472f --- /dev/null +++ b/types/react-frame-component/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for react-frame-component 4.1 +// Project: https://github.com/ryanseddon/react-frame-component +// Definitions by: Alex Bukurov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +export interface FrameComponentProps extends React.IframeHTMLAttributes { + head?: React.ReactNode; + mountTarget?: string; + initialContent?: string; + contentDidMount?: () => void; + contentDidUpdate?: () => void; + children: React.ReactNode; +} + +export default class FrameComponent extends React.Component {} + +export interface FrameContext { + document?: any; + window?: any; +} + +export const FrameContextProvider: React.Provider; + +export const FrameContextConsumer: React.Consumer; diff --git a/types/react-frame-component/react-frame-component-tests.tsx b/types/react-frame-component/react-frame-component-tests.tsx new file mode 100644 index 0000000000..0bb60b7511 --- /dev/null +++ b/types/react-frame-component/react-frame-component-tests.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import Frame, { FrameContextConsumer } from 'react-frame-component'; + +
+ + content + + head} + mountTarget='#mountHere' + contentDidMount={() => {}} + contentDidUpdate={() => {}} + initialContent='

i wont be changed

' + > + content + + + + {({ document, window }) => content} + + +
; diff --git a/types/react-frame-component/tsconfig.json b/types/react-frame-component/tsconfig.json new file mode 100644 index 0000000000..4d50e17550 --- /dev/null +++ b/types/react-frame-component/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "jsx": "react", + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-frame-component-tests.tsx" + ] +} diff --git a/types/react-frame-component/tslint.json b/types/react-frame-component/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-frame-component/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }