34 lines
No EOL
1.3 KiB
TypeScript
34 lines
No EOL
1.3 KiB
TypeScript
// @strict: true
|
|
type ElementRef = (element: HTMLElement | null) => void;
|
|
|
|
type ThumbProps = {
|
|
elementRef?: ElementRef;
|
|
}
|
|
|
|
type ComponentProps = {
|
|
thumbYProps?: ThumbProps;
|
|
thumbXProps: ThumbProps;
|
|
}
|
|
|
|
class Component {
|
|
props!: ComponentProps;
|
|
public thumbYElementRef = (ref: HTMLElement | null) => {
|
|
typeof this.props.thumbYProps!.elementRef === 'function' && this.props.thumbYProps!.elementRef(ref);
|
|
|
|
typeof (this.props.thumbYProps!.elementRef) === 'function' && this.props.thumbYProps!.elementRef(ref);
|
|
|
|
typeof ((this.props).thumbYProps!.elementRef)! === 'function' && this.props.thumbYProps!.elementRef(ref);
|
|
|
|
typeof this.props.thumbXProps.elementRef === 'function' && this.props.thumbXProps.elementRef(ref);
|
|
|
|
typeof this.props.thumbXProps.elementRef === 'function' && (this.props).thumbXProps.elementRef(ref);
|
|
|
|
typeof this.props.thumbXProps.elementRef === 'function' && (this.props.thumbXProps).elementRef(ref);
|
|
|
|
typeof this.props.thumbXProps.elementRef === 'function' && ((this.props)!.thumbXProps)!.elementRef(ref);
|
|
|
|
typeof (this.props.thumbXProps).elementRef === 'function' && ((this.props)!.thumbXProps)!.elementRef(ref);
|
|
|
|
typeof this.props!.thumbXProps!.elementRef === 'function' && ((this.props)!.thumbXProps)!.elementRef(ref);
|
|
};
|
|
} |