|
| 1 | +import * as React from "react"; |
| 2 | +import "./stateVisualizer.css"; |
| 3 | +export interface IProps { |
| 4 | + router: any; |
| 5 | + width?: number; |
| 6 | + height?: number; |
| 7 | +} |
| 8 | +export interface IState { |
| 9 | +} |
| 10 | +export declare class StateVisualizer extends React.Component<IProps, IState> { |
| 11 | + /** |
| 12 | + * Creates a new StateVisualizer and adds it to the document. |
| 13 | + * |
| 14 | + * @param router the UIRouter object |
| 15 | + * @param element (optional) the element where the StateVisualizer should be placed. |
| 16 | + * If no element is passed, an element will be created in the body. |
| 17 | + * |
| 18 | + * |
| 19 | + * # Angular 1 + UI-Router (1.0.0-beta.2 and higher): |
| 20 | + * |
| 21 | + * Inject the router (`$uiRouter`) in a run block, then call StateVisualizer.create(); |
| 22 | + * |
| 23 | + * ``` |
| 24 | + * app.run(function($uiRouter) { |
| 25 | + * StateVisualizer.create($uiRouter); |
| 26 | + * }); |
| 27 | + * ``` |
| 28 | + * |
| 29 | + * # Angular 1 + UI-Router 1.0.0-alpha.1 through 1.0.0-beta.1: |
| 30 | + * |
| 31 | + * Inject the router (`ng1UIRouter`) in a run block, then call StateVisualizer.create(); |
| 32 | + * |
| 33 | + * ``` |
| 34 | + * app.run(function(ng1UIRouter) { |
| 35 | + * StateVisualizer.create(ng1UIRouter); |
| 36 | + * }); |
| 37 | + * ``` |
| 38 | + * |
| 39 | + * Angular 2: |
| 40 | + * |
| 41 | + * Call StateVisualizer.create() from your UIRouterConfig |
| 42 | + * |
| 43 | + * ``` |
| 44 | + * export class MyUIRouterConfig extends UIRouterConfig { |
| 45 | + * configure(router: UIRouter) { |
| 46 | + * StateVisualizer.create(router); |
| 47 | + * } |
| 48 | + * } |
| 49 | + * ``` |
| 50 | + * |
| 51 | + * React: |
| 52 | + * |
| 53 | + * Call StateVisualizer.create() from your bootstrap |
| 54 | + * |
| 55 | + * ``` |
| 56 | + * let router = new UIRouterReact(); |
| 57 | + * StateVisualizer.create(router); |
| 58 | + * router.start(); |
| 59 | + * ``` |
| 60 | + * |
| 61 | + * @return the element that was bootstrapped. |
| 62 | + * You can destroy the component using: |
| 63 | + * [ReactDOM.unmountComponentAtNode](https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode) |
| 64 | + */ |
| 65 | + static create(router: any, element?: any): any; |
| 66 | + private el; |
| 67 | + right: string; |
| 68 | + bottom: string; |
| 69 | + minimize: (evt?: any) => void; |
| 70 | + componentDidMount(): void; |
| 71 | + render(): JSX.Element; |
| 72 | +} |
0 commit comments