From 083973f647c354a9becc34a7090daee80029bd28 Mon Sep 17 00:00:00 2001 From: Weston Catron Date: Wed, 28 Dec 2016 16:40:10 -0500 Subject: [PATCH] Add typescript declarations for Dimmer. --- typings/index.d.ts | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/typings/index.d.ts b/typings/index.d.ts index 259b8e3606..880546e4b0 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2473,6 +2473,81 @@ interface CheckboxProps { export class Checkbox extends React.Component { } +// Dimmer +// ---------------------------------- +interface DimmerProps { + + /** An active dimmer will dim its parent container. */ + active?: boolean; + + /** An element type to render as (string or function). */ + as?: any; + + /** Primary content. */ + children?: React.ReactNode; + + /** Additional classes. */ + className?: string; + + /** Shorthand for primary content. */ + content?: any; + + /** A disabled dimmer cannot be activated */ + disabled?: boolean; + + /** + * Called when the dimmer is clicked. + * + * @param {SyntheticEvent} event - React's original SyntheticEvent. + * @param {object} data - All props. + */ + onClick?: React.MouseEventHandler; + + /** + * Handles click outside Dimmer's content, but inside Dimmer area. + * + * @param {SyntheticEvent} event - React's original SyntheticEvent. + * @param {object} data - All props. + */ + onClickOutside?: React.MouseEventHandler; + + /** A dimmer can be formatted to have its colors inverted. */ + inverted?: boolean; + + /** A dimmer can be formatted to be fixed to the page. */ + page?: boolean; + + /** A dimmer can be controlled with simple prop. */ + simple?: boolean; + +} + +interface DimmerClass extends React.ComponentClass { + Dimmable: typeof DimmerDimmable; +} + +export const Dimmer: DimmerClass; + +interface DimmerDimmableProps { + + /** An element type to render as (string or function). */ + as?: any; + + /** A dimmable element can blur its contents. */ + blurring?: boolean; + + /** Primary content. */ + children?: React.ReactNode; + + /** Additional classes. */ + className?: string; + + /** Controls whether or not the dim is displayed. */ + dimmed?: boolean; +} + +export const DimmerDimmable: React.ComponentClass; + // Dropdown // ---------------------------------- type DropdownPropPointing = 'left' | 'right' | 'top' | 'top left' | 'top right' | 'bottom' | 'bottom left' | 'bottom right'