mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add back context; add more helper context types and documentation * Fix the handling of ref to properly exclude string refs where not supported * Fix erroneous tests that got caught by the better Ref type * Augment ComponentProps to support JSX.IntrinsicElements * Add tests, doc comments for ComponentProps* * Add self to Definitions by * Add TODO comment * Add comments about the "'ref' extends keyof P" checks * Fix the handling of ref and props when using withComponent in styled-components * Swap nesting order of mapped types to fix missing $ExpectErrors * Comment out test that fails in TS@3.0 * Hack to deal with the tests not failing when they should * Rewrite styled-components * Bump version * Bump minimum TypeScript version * Update types of @rebass/grid (depends on styled-components) * Update styled-react-modal types to 1.1 (also styled-components related) * Reformat styled-components's index.d.ts
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
// Type definitions for styled-react-modal 1.1
|
|
// Project: https://github.com/AlexanderRichey/styled-react-modal
|
|
// Definitions by: Adam Lavin <https://github.com/Lavoaster>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.9
|
|
|
|
import * as React from 'react';
|
|
import { StyledComponent, AnyStyledComponent, CSSObject, InterpolationFunction } from 'styled-components';
|
|
|
|
declare const BaseModalBackground: StyledComponent<'div', any>;
|
|
|
|
interface ModalProps {
|
|
isOpen: boolean;
|
|
allowScroll?: boolean;
|
|
afterOpen?: () => void;
|
|
afterClose?: () => void;
|
|
beforeOpen?: Promise<void> | (() => void);
|
|
beforeClose?: Promise<void> | (() => void);
|
|
onEscapeKeydown?: (event: Event) => void;
|
|
onBackgroundClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
}
|
|
|
|
declare class Modal extends React.Component<ModalProps> {
|
|
static styled(
|
|
object: CSSObject | InterpolationFunction<any>
|
|
): StyledComponent<React.ComponentClass<ModalProps>, any>;
|
|
static styled(
|
|
strings: TemplateStringsArray,
|
|
...interpolations: any[]
|
|
): StyledComponent<React.ComponentClass<ModalProps>, any>;
|
|
}
|
|
|
|
interface ModalProviderProps {
|
|
backgroundComponent?: AnyStyledComponent;
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
declare class ModalProvider extends React.Component<ModalProviderProps> {}
|
|
|
|
export default Modal;
|
|
export { BaseModalBackground, ModalProvider };
|