Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
fix(types): devtools typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
zeromake committed Dec 13, 2017
1 parent 7333d93 commit 3209256
Show file tree
Hide file tree
Showing 7 changed files with 405 additions and 666 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ typings/
/dist/
/devtools.js
/devtools.js.map
/devtools-run.js
/devtools-run.js.map
/docs/
*error.log

285 changes: 0 additions & 285 deletions devtools-run.js

This file was deleted.

1 change: 0 additions & 1 deletion devtools-run.js.map

This file was deleted.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,44 +59,44 @@
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.6.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"chai": "^4.1.2",
"conventional-changelog-cli": "^1.3.3",
"conventional-changelog-cli": "^1.3.5",
"coveralls": "^3.0.0",
"cross-env": "^5.0.5",
"cross-env": "^5.1.1",
"gzip-size-cli": "^2.1.0",
"istanbul-instrumenter-loader": "^3.0.0",
"karma": "^1.7.1",
"karma-chai-sinon": "^0.1.5",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage-istanbul-reporter": "^1.3.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.4",
"karma-mocha-reporter": "^2.2.5",
"karma-phantomjs-launcher": "^1.0.4",
"karma-remap-istanbul": "^0.6.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.5",
"karma-webpack": "^2.0.6",
"mocha": "^4.0.1",
"preact-jsx-chai": "^2.2.1",
"preact-render-to-string": "^3.7.0",
"prop-types": "^15.5.10",
"remap-istanbul": "^0.9.5",
"rimraf": "^2.6.1",
"rollup": "^0.50.0",
"rollup-plugin-alias": "^1.3.1",
"rollup": "^0.52.1",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-typescript": "zeromake/rollup-plugin-typescript",
"rollup-plugin-uglify": "^2.0.1",
"rollup-watch": "^4.3.1",
"sinon": "^4.0.1",
"sinon": "^4.1.3",
"sinon-chai": "^2.13.0",
"ts-loader": "^2.3.5",
"tslint": "^5.7.0",
"ts-loader": "^3.2.0",
"tslint": "^5.8.0",
"typedoc": "^0.9.0",
"typescript": "^2.5.2",
"uglify-es": "^3.1.1",
"webpack": "^3.7.1"
"typescript": "^2.6.2",
"uglify-es": "^3.2.2",
"webpack": "^3.10.0"
}
}
3 changes: 0 additions & 3 deletions src/devtools-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ export function getInitDevTools(opt: typeof options, findDOMNode: typeof IfindDO
function updateReactComponent(componentOrVDom: any): IReactComponent {
const isVDom = findVDom(componentOrVDom) == null;
const newInstance = isVDom ? createReactDOMComponent(componentOrVDom) : createReactCompositeComponent(componentOrVDom);
if (!isVDom) {
console.log(componentOrVDom);
}
const base: Element | Component<any, any> = isVDom ? findDOMNode(componentOrVDom) : componentOrVDom;
if (instanceMap.has(base)) {
const inst = instanceMap.get(base);
Expand Down
9 changes: 4 additions & 5 deletions types/zreact.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ declare namespace zreact {
}

interface DangerouslySetInnerHTML {
__html: string;
__html: string;
}

interface ZreactHTMLAttributes {
Expand Down Expand Up @@ -104,8 +104,8 @@ declare namespace zreact {
}
interface Component<PropsType, StateType> extends ComponentLifecycle<PropsType, StateType> { }

function h<PropsType>(node:ComponentConstructor<PropsType, any> | FunctionalComponent<PropsType>, params:PropsType, ...children:(JSX.Element|JSX.Element[]|string)[]):JSX.Element;
function h(node:string, params:JSX.HTMLAttributes&JSX.SVGAttributes&{[propName: string]: any}, ...children:(JSX.Element|JSX.Element[]|string)[]):JSX.Element;
function h<PropsType>(node:ComponentConstructor<PropsType, any> | FunctionalComponent<PropsType>, params?:PropsType, ...children:(JSX.Element|JSX.Element[]|string)[]):JSX.Element;
function h(node:string, params?:JSX.HTMLAttributes&JSX.SVGAttributes&{[propName: string]: any}, ...children:(JSX.Element|JSX.Element[]|string)[]):JSX.Element;
function render(node:JSX.Element, parent:Element|Document, mergeWith?:Element):Element;
function rerender():void;
function cloneElement(element:JSX.Element, props:any):JSX.Element;
Expand Down Expand Up @@ -168,8 +168,7 @@ declare module "zreact" {
}

declare module "zreact/devtools" {
// Empty. This module initializes the React Developer Tools integration
// when imported.
export const initDevTools: (vdom?: zreact.IVDom) => void;
}

declare namespace JSX {
Expand Down

0 comments on commit 3209256

Please sign in to comment.