From 661911bdaa598dd3ae12ea5cbf58f09968881962 Mon Sep 17 00:00:00 2001 From: normano64 Date: Sun, 17 Jul 2016 15:48:35 +0200 Subject: [PATCH] Typings for the project --- index.d.ts | 1381 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 1324 insertions(+), 57 deletions(-) diff --git a/index.d.ts b/index.d.ts index e66eb25cc..586aa526a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,57 +1,1324 @@ -// Type definitions for react-toolbox 0.16.2 -// Project: http://react-toolbox.com/ -// Definitions by: @xogeny (Michael M. Tiller), @hsrobflavorus (Robert Parker), @ixrock (Roman Karlov) -/* CHANGES - * 26/05/2015 Export components by names (not only defaults), added missing components exports - * 06/05/2016: Refactor into external module declarations (no more 'declare module ...') - * 04/27/2016: Updates for 0.16.2, added , , and ActivableRendererFactory definitions, misc. tweaks and fixes. - * 02/03/2016: - * Fixed for TypeScript 1.8.0 stricter var declaration requirements (move `declare var ...` inside each individual module). - * Removed triple-slash reference to React to fix npm install compatibility (you'll need to make sure you're referencing react.d.ts somewhere in your project!). - * Hopefully fixed the default exports where applicable - * 01/13/2016: Minor changes, add a few missing props, add IconButton to react-toolbox/lib/button - * 12/21/2015: Fix "import * as Input from 'react-toolbox/lib/input'" style imports, which now correctly import only the necessary component(s). - * NOTE that you must use "import * as {Component Name}" not just "import {Component Name}" for this to work. - * 12/20/2015: Should be compatible with 0.14.0. Refactor modules into 'react-toolbox/lib/*' format. - Unfortunately importing them directly in that manner doesn't seem to work - i.e. "import Input from 'react-toolbox/lib/input'" resolves to undefined, whereas "import { Input } from 'react-toolbox'" works fine! - ... Any ideas welcome! - * 12/20/2015: Add AppBar, Avatar, and refactor Card and its child Components to match the documentation. - * 12/18/2015: Update to react-toolbox 0.13.1 (from 0.12.11) - * 12/18/2015: Use JSDoc-style comments to provide Intellisense where supported - */ -/* - MISSING COMPONENTS (Contributions welcome) - * Ripple HOC - */ - -export { default as ActivableRendererFactory } from 'react-toolbox/lib/hoc/ActivableRenderer'; - -export { AppBar } from 'react-toolbox/lib/app_bar' -export { Autocomplete } from 'react-toolbox/lib/autocomplete' -export { Avatar } from 'react-toolbox/lib/avatar' -export { Button, IconButton } from 'react-toolbox/lib/button' -export { Card, CardTitle, CardMedia, CardText, CardActions } from 'react-toolbox/lib/card' -export { Checkbox } from 'react-toolbox/lib/checkbox' -export { Chip } from 'react-toolbox/lib/chip' -export { DatePicker } from 'react-toolbox/lib/date_picker' -export { Dialog } from 'react-toolbox/lib/dialog' -export { Drawer } from 'react-toolbox/lib/drawer' -export { Dropdown } from 'react-toolbox/lib/dropdown' -export { FontIcon } from 'react-toolbox/lib/font_icon' -export { Input } from 'react-toolbox/lib/input' -export { Layout, Panel, NavDrawer, Sidebar } from 'react-toolbox/lib/layout' -export { Link } from 'react-toolbox/lib/link' -export { List, ListCheckbox, ListItem, ListDivider, ListSubHeader } from 'react-toolbox/lib/list' -export { Menu, MenuDivider, MenuItem, IconMenu } from 'react-toolbox/lib/menu' -export { Navigation } from 'react-toolbox/lib/navigation' -export { Overlay } from 'react-toolbox/lib/overlay' -export { ProgressBar } from 'react-toolbox/lib/progress_bar' -export { RadioButton, RadioGroup } from 'react-toolbox/lib/radio' -export { Ripple } from 'react-toolbox/lib/ripple' -export { Slider } from 'react-toolbox/lib/slider' -export { Snackbar } from 'react-toolbox/lib/snackbar' -export { Switch } from 'react-toolbox/lib/switch' -export { Tabs, Tab } from 'react-toolbox/lib/tabs' -export { TimePicker } from 'react-toolbox/lib/time_picker' -export { default as Tooltip } from 'react-toolbox/lib/tooltip' \ No newline at end of file +// Type definitions for react-toolbox 1.0.2 +// Project: https://github.com/react-toolbox/react-toolbox +// Definitions by: Per Bergqwist + +// __ReactToolbox +declare namespace __ReactToolbox { + import React = __React; + + interface Props { + className?: string; + key?: string | number; + onClick?: React.MouseEventHandler; + style?: React.CSSProperties; + } + + /** + * + */ + interface AppBarThemeProps { + appBar?: string; + fixed?: string; + flat?: string; + } + interface AppBarProps extends Props { + children?: React.ReactNode; + fixed?: boolean; + flat?: boolean; + theme?: AppBarThemeProps; + } + export class AppBar extends React.Component { + } + + /** + * + */ + interface AutocompleteThemeProps { + active?: string; + autocomplete?: string; + focus?: string; + input?: string; + label?: string; + suggestion?: string; + suggestions?: string; + up?: string; + value?: string; + values?: string; + } + interface AutocompleteProps extends Props { + direction?: "auto" | "up" | "down"; + disabled?: boolean; + error?: string; + label?: string; + multiple?: boolean; + onChange?: React.FormEventHandler; + selectedPosition?: "above" | "below"; + showSuggestionsWHenValueIsSet?: boolean; + source?: any; + suggestionMatch?: "start" | "anywhere" | "word"; + style?: React.CSSProperties; + theme?: AutocompleteThemeProps; + value?: any; + } + export class Autocomplete extends React.Component { + } + + /** + * + */ + interface AvatarThemeProps { + avatar?: string; + image?: string; + letter?: string; + } + interface AvatarProps extends Props { + children?: React.ReactNode; + cover?: boolean; + icon?: React.ReactNode | string; + image?: React.ReactNode | string; + theme?: AvatarThemeProps; + title?: string; + } + export class Avatar extends React.Component { + } + + // Button + namespace Button { + /** + *