{ + (instance: Descriptor
, extraProps?: P): Descriptor
;
+ }
+
+ export interface ReactLink extends Mixin {
+ linkState extends Specification {
+ componentWillEnter?(callback: () => void): void;
+ componentDidEnter?(): void;
+ componentWillLeave?(callback: () => void): void;
+ componentDidLeave?(): void;
+ }
+
+ export interface NumericPerfContext {
+ [key: string]: number;
+ }
+
+ export interface Measurements {
+ exclusive: NumericPerfContext;
+ inclusive: NumericPerfContext;
+ render: NumericPerfContext;
+ counts: NumericPerfContext;
+ writes: NumericPerfContext;
+ displayNames: {
+ [key: string]: ComponentPerfContext;
+ };
+ totalTime: number;
+ }
+
+ export interface Perf {
+ start(): void;
+ stop(): void;
+ printInclusive(measurements: Measurements[]): void;
+ printExclusive(measurements: Measurements[]): void;
+ printWasted(measurements: Measurements[]): void;
+ printDOM(measurements: Measurements[]): void;
+ getLastMeasurements(): Measurements[];
+ }
+
+ export interface TestUtils {
+ Simulate: Simulate;
+ renderIntoDocument(instance: Descriptor (specification: Specification ): Factory ;
export function renderComponent(component: Descriptor extends DomReferencer {
@@ -69,19 +73,19 @@ declare module "react" {
replaceProps(nextProps: P, callback?: () => void): void;
}
- interface Constructable {
+ export interface Constructable {
new(): any;
}
- interface Validator {
+ export interface Validator {
(props: P, propName: string, componentName: string): Error;
}
- interface Requireable extends Validator {
+ export interface Requireable extends Validator {
isRequired: Validator ;
}
- interface ValidationMap {
+ export interface ValidationMap {
[key: string]: Validator ;
}
@@ -112,12 +116,12 @@ declare module "react" {
// Browser Interfaces
// Taken from https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts
- interface AbstractView {
+ export interface AbstractView {
styleMedia: StyleMedia;
document: Document;
}
- interface Touch {
+ export interface Touch {
identifier: number;
target: EventTarget;
screenX: number;
@@ -128,7 +132,7 @@ declare module "react" {
pageY: number;
}
- interface TouchList {
+ export interface TouchList {
[index: number]: Touch;
length: number;
item(index: number): Touch;
@@ -214,7 +218,7 @@ declare module "react" {
}
// Attributes
- interface EventAttributes {
+ export interface EventAttributes {
onCopy?: (event: ClipboardEvent) => void;
onCut?: (event: ClipboardEvent) => void;
onPaste?: (event: ClipboardEvent) => void;
@@ -251,7 +255,7 @@ declare module "react" {
onWheel?: (event: WheelEvent) => void;
}
- interface DomAttributes extends EventAttributes {
+ export interface DomAttributes extends EventAttributes {
// HTML Attributes
accept?: any;
accessKey?: any;
@@ -347,7 +351,7 @@ declare module "react" {
wmode?: any;
}
- interface SvgAttributes extends EventAttributes {
+ export interface SvgAttributes extends EventAttributes {
cx?: any;
cy?: any;
d?: any;
@@ -393,10 +397,10 @@ declare module "react" {
y?: any;
}
- interface DomElement extends Factory