// Type definitions for ReactWithAddons v0.13.0 RC2 (internal module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped /// declare module React { // // React.addons // ---------------------------------------------------------------------- export var addons: { CSSTransitionGroup: CSSTransitionGroup; LinkedStateMixin: LinkedStateMixin; PureRenderMixin: PureRenderMixin; TransitionGroup: TransitionGroup; batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; batchedUpdates(callback: (a: A) => any, a: A): void; batchedUpdates(callback: () => any): void; // deprecated: use petehunt/react-classset or JedWatson/classnames classSet(cx: { [key: string]: boolean }): string; classSet(...classList: string[]): string; cloneWithProps

(element: DOMElement

, props: P): DOMElement

; cloneWithProps

(element: ClassicElement

, props: P): ClassicElement

; cloneWithProps

(element: ReactElement

, props: P): ReactElement

; createFragment(object: { [key: string]: ReactNode }): ReactFragment; update(value: any[], spec: UpdateArraySpec): any[]; update(value: {}, spec: UpdateSpec): any; // Development tools Perf: ReactPerf; TestUtils: ReactTestUtils; }; // // React.addons (Transitions) // ---------------------------------------------------------------------- interface TransitionGroupProps { component?: ReactType; childFactory?: (child: ReactElement) => ReactElement; } interface CSSTransitionGroupProps extends TransitionGroupProps { transitionName: string; transitionAppear?: boolean; transitionEnter?: boolean; transitionLeave?: boolean; } type CSSTransitionGroup = ComponentClass; type TransitionGroup = ComponentClass; // // React.addons (Mixins) // ---------------------------------------------------------------------- interface ReactLink { value: T; requestChange(newValue: T): void; } interface LinkedStateMixin extends Mixin { linkState(key: string): ReactLink; } interface PureRenderMixin extends Mixin { } // // Reat.addons.update // ---------------------------------------------------------------------- interface UpdateSpec { $set: any; $merge: {}; $apply(value: any): any; // [key: string]: UpdateSpec; } interface UpdateArraySpec extends UpdateSpec { $push?: any[]; $unshift?: any[]; $splice?: any[][]; } // // React.addons.Perf // ---------------------------------------------------------------------- interface ComponentPerfContext { current: string; owner: string; } interface NumericPerfContext { [key: string]: number; } interface Measurements { exclusive: NumericPerfContext; inclusive: NumericPerfContext; render: NumericPerfContext; counts: NumericPerfContext; writes: NumericPerfContext; displayNames: { [key: string]: ComponentPerfContext; }; totalTime: number; } interface ReactPerf { start(): void; stop(): void; printInclusive(measurements: Measurements[]): void; printExclusive(measurements: Measurements[]): void; printWasted(measurements: Measurements[]): void; printDOM(measurements: Measurements[]): void; getLastMeasurements(): Measurements[]; } // // React.addons.TestUtils // ---------------------------------------------------------------------- interface MockedComponentClass { new(): any; } interface ReactTestUtils { Simulate: Simulate; renderIntoDocument

(element: ReactElement

): Component; renderIntoDocument>(element: ReactElement): C; mockComponent(mocked: MockedComponentClass, mockTagName?: string): ReactTestUtils; isElementOfType(element: ReactElement, type: ReactType): boolean; isTextComponent(instance: Component): boolean; isDOMComponent(instance: Component): boolean; isCompositeComponent(instance: Component): boolean; isCompositeComponentWithType( instance: Component, type: ComponentClass): boolean; findAllInRenderedTree( tree: Component, fn: (i: Component) => boolean): Component; scryRenderedDOMComponentsWithClass( tree: Component, className: string): DOMComponent[]; findRenderedDOMComponentWithClass( tree: Component, className: string): DOMComponent; scryRenderedDOMComponentsWithTag( tree: Component, tagName: string): DOMComponent[]; findRenderedDOMComponentWithTag( tree: Component, tagName: string): DOMComponent; scryRenderedComponentsWithType

( tree: Component, type: ComponentClass

): Component[]; scryRenderedComponentsWithType>( tree: Component, type: ComponentClass): C[]; findRenderedComponentWithType

( tree: Component, type: ComponentClass

): Component; findRenderedComponentWithType>( tree: Component, type: ComponentClass): C; } interface SyntheticEventData { altKey?: boolean; button?: number; buttons?: number; clientX?: number; clientY?: number; changedTouches?: TouchList; charCode?: boolean; clipboardData?: DataTransfer; ctrlKey?: boolean; deltaMode?: number; deltaX?: number; deltaY?: number; deltaZ?: number; detail?: number; getModifierState?(key: string): boolean; key?: string; keyCode?: number; locale?: string; location?: number; metaKey?: boolean; pageX?: number; pageY?: number; relatedTarget?: EventTarget; repeat?: boolean; screenX?: number; screenY?: number; shiftKey?: boolean; targetTouches?: TouchList; touches?: TouchList; view?: AbstractView; which?: number; } interface EventSimulator { (element: Element, eventData?: SyntheticEventData): void; (component: Component, eventData?: SyntheticEventData): void; } interface Simulate { blur: EventSimulator; change: EventSimulator; click: EventSimulator; cut: EventSimulator; doubleClick: EventSimulator; drag: EventSimulator; dragEnd: EventSimulator; dragEnter: EventSimulator; dragExit: EventSimulator; dragLeave: EventSimulator; dragOver: EventSimulator; dragStart: EventSimulator; drop: EventSimulator; focus: EventSimulator; input: EventSimulator; keyDown: EventSimulator; keyPress: EventSimulator; keyUp: EventSimulator; mouseDown: EventSimulator; mouseEnter: EventSimulator; mouseLeave: EventSimulator; mouseMove: EventSimulator; mouseOut: EventSimulator; mouseOver: EventSimulator; mouseUp: EventSimulator; paste: EventSimulator; scroll: EventSimulator; submit: EventSimulator; touchCancel: EventSimulator; touchEnd: EventSimulator; touchMove: EventSimulator; touchStart: EventSimulator; wheel: EventSimulator; } }