mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Removed descriptors from our code
This commit is contained in:
@@ -63,7 +63,7 @@ var PropTypesSpecification: React.Specification<any, any> = {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
render: (): React.Descriptor<any> => {
|
||||
render: (): React.ReactHTMLElement => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
+17
-15
@@ -23,7 +23,7 @@ declare module React {
|
||||
};
|
||||
|
||||
export interface CloneWithProps<P> {
|
||||
(instance: Descriptor<P>, extraProps?: P): Descriptor<P>;
|
||||
(instance: ReactComponentElement<P>, extraProps?: P): ReactComponentElement<P>;
|
||||
}
|
||||
|
||||
export interface ReactLink<T> {
|
||||
@@ -79,20 +79,22 @@ declare module React {
|
||||
|
||||
export interface TestUtils {
|
||||
Simulate: Simulate;
|
||||
renderIntoDocument(instance: Descriptor<any>): Descriptor<any>;
|
||||
renderIntoDocument<P>(instance: ReactComponentElement<P>): ReactComponentElement<P>;
|
||||
renderIntoDocument(instnace: ReactHTMLElement): ReactHTMLElement;
|
||||
renderIntoDocument(instnace: ReactSVGElement): ReactSVGElement;
|
||||
mockComponent(componentClass: ReactComponentFactory<any>, mockTagName?: string): TestUtils;
|
||||
isDescriptorOfType(descriptor: Descriptor<any>, componentClass: ReactComponentFactory<any>): boolean;
|
||||
isDOMComponent(instance: Descriptor<any>): boolean;
|
||||
isCompositeComponent(instance: Descriptor<any>): boolean;
|
||||
isCompositeComponentWithType(instance: Descriptor<any>, componentClass: Function): boolean;
|
||||
isTextComponent(instance: Descriptor<any>): boolean;
|
||||
findAllInRenderedTree(tree: Descriptor<any>, test: Function): Descriptor<any>[];
|
||||
scryRenderedDOMComponentsWithClass(tree: Descriptor<any>, className: string): Descriptor<any>[];
|
||||
findRenderedDOMComponentWithClass(tree: Descriptor<any>, className: string): Descriptor<any>;
|
||||
scryRenderedDOMComponentsWithTag(tree: Descriptor<any>, className: string): Descriptor<any>[];
|
||||
findRenderedDOMComponentWithTag(tree: Descriptor<any>, tagName: string): Descriptor<any>;
|
||||
scryFindRenderedComponentsWithTag(tree: Descriptor<any>, componentClass: Function): Descriptor<any>[];
|
||||
findRenderedComponentWithType(tree: Descriptor<any>, componentClass: Function): Descriptor<any>;
|
||||
isDescriptorOfType(descriptor: ReactElement<any, any>, componentClass: ReactComponentFactory<any>): boolean;
|
||||
isDOMComponent(instance: ReactElement<any, any>): boolean;
|
||||
isCompositeComponent(instance: ReactElement<any, any>): boolean;
|
||||
isCompositeComponentWithType(instance: ReactElement<any, any>, componentClass: ReactComponentFactory<any>): boolean;
|
||||
isTextComponent(instance: ReactElement<any, any>): boolean;
|
||||
findAllInRenderedTree(tree: ReactElement<any, any>, test: (component: ReactElement<any, any>) => boolean): ReactElement<any, any>[];
|
||||
scryRenderedDOMComponentsWithClass(tree: ReactElement<any, any>, className: string): ReactElement<any, any>[];
|
||||
findRenderedDOMComponentWithClass(tree: ReactElement<any, any>, className: string): ReactElement<any, any>;
|
||||
scryRenderedDOMComponentsWithTag(tree: ReactElement<any, any>, className: string): ReactElement<any, any>[];
|
||||
findRenderedDOMComponentWithTag(tree: ReactElement<any, any>, tagName: string): ReactElement<any, any>;
|
||||
scryFindRenderedComponentsWithTag(tree: ReactElement<any, any>, componentClass: Function): ReactElement<any, any>[];
|
||||
findRenderedComponentWithType(tree: ReactElement<any, any>, componentClass: Function): ReactElement<any, any>;
|
||||
}
|
||||
|
||||
export interface SyntheticEventData {
|
||||
@@ -131,7 +133,7 @@ declare module React {
|
||||
|
||||
export interface EventSimulator {
|
||||
(element: Element, eventData?: SyntheticEventData): void;
|
||||
(descriptor: Descriptor<any>, eventData?: SyntheticEventData): void;
|
||||
(descriptor: ReactElement<any, any>, eventData?: SyntheticEventData): void;
|
||||
}
|
||||
|
||||
export interface Simulate {
|
||||
|
||||
@@ -63,7 +63,7 @@ var PropTypesSpecification: React.Specification<any, any> = {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
render: (): React.Descriptor<any> => {
|
||||
render: (): React.ReactHTMLElement => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
Vendored
+14
-23
@@ -38,20 +38,19 @@ declare module React {
|
||||
|
||||
export function initializeTouchEvents(shouldUseTouch: boolean): void;
|
||||
|
||||
export interface ReactFactory<P, E extends ReactElement> {
|
||||
(properties: P, ...children: any[]): E;
|
||||
|
||||
export interface ReactComponentFactory<P> {
|
||||
(properties: P, ...children: any[]): ReactComponentElement<P>;
|
||||
}
|
||||
|
||||
export interface ReactComponentFactory<P> extends ReactFactory<P, ReactComponentElement<P>> {
|
||||
export interface ReactElementFactory<P> {
|
||||
(properties: P, ...children: any[]): ReactDOMElement<P>;
|
||||
}
|
||||
|
||||
export interface ReactElementFactory<P, E extends ReactDOMElement<any>> extends ReactFactory<P, E> {
|
||||
export interface DomElement extends ReactElementFactory<DomAttributes> {
|
||||
}
|
||||
|
||||
export interface DomElement extends ReactElementFactory<DomAttributes, ReactHTMLElement> {
|
||||
}
|
||||
|
||||
export interface SvgElement extends ReactElementFactory<SvgAttributes, ReactSVGElement> {
|
||||
export interface SvgElement extends ReactElementFactory<SvgAttributes> {
|
||||
}
|
||||
|
||||
export interface ReactClass<P> {
|
||||
@@ -60,18 +59,17 @@ declare module React {
|
||||
|
||||
export interface ReactComponent<P> {
|
||||
props: P;
|
||||
render(): ReactElement;
|
||||
render(): ReactElement<any, any>;
|
||||
}
|
||||
|
||||
export interface ReactElement {
|
||||
type: any;
|
||||
props: any;
|
||||
export interface ReactElement<T, P> {
|
||||
type: T;
|
||||
props: P;
|
||||
key: string;
|
||||
ref: string;
|
||||
}
|
||||
|
||||
export interface ReactDOMElement<P> extends ReactElement {
|
||||
type: string;
|
||||
export interface ReactDOMElement<P> extends ReactElement<string, P> {
|
||||
props: P;
|
||||
}
|
||||
|
||||
@@ -81,17 +79,10 @@ declare module React {
|
||||
export interface ReactSVGElement extends ReactDOMElement<SvgAttributes> {
|
||||
}
|
||||
|
||||
export interface ReactComponentElement<P> extends ReactElement {
|
||||
type: ReactClass<P>;
|
||||
export interface ReactComponentElement<P> extends ReactElement<ReactClass<P>, P> {
|
||||
props: P;
|
||||
}
|
||||
|
||||
export interface Descriptor<P> {
|
||||
props: P;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface Mixin<P, S> {
|
||||
componentWillMount?(): void;
|
||||
componentDidMount?(): void;
|
||||
@@ -111,7 +102,7 @@ declare module React {
|
||||
propTypes?: ValidationMap<P>;
|
||||
getDefaultProps?(): P;
|
||||
getInitialState?(): S;
|
||||
render(): Descriptor<any>;
|
||||
render(): ReactElement<any, any>;
|
||||
}
|
||||
|
||||
export interface DomReferencer {
|
||||
|
||||
Reference in New Issue
Block a user