diff --git a/.travis.yml b/.travis.yml
index c8c468a417..07914721a9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
language: node_js
node_js:
- - 6.9.2
+ - node
sudo: false
diff --git a/acorn/acorn-tests.ts b/acorn/acorn-tests.ts
index fb79d23718..72ca71d2f6 100644
--- a/acorn/acorn-tests.ts
+++ b/acorn/acorn-tests.ts
@@ -1,5 +1,3 @@
-///
-
import acorn = require('acorn');
import * as ESTree from 'estree';
@@ -67,3 +65,6 @@ acorn.getLineInfo('string', 56);
acorn.plugins['test'] = function (p: acorn.Parser, config: any) {
}
+
+acorn.tokenizer('console.log("hello world)', {locations: true}).getToken();
+acorn.tokenizer('console.log("hello world)', {locations: true})[Symbol.iterator]().next();
diff --git a/acorn/index.d.ts b/acorn/index.d.ts
index 1944abc257..441deb29c3 100644
--- a/acorn/index.d.ts
+++ b/acorn/index.d.ts
@@ -238,9 +238,12 @@ declare namespace acorn {
function parseExpressionAt(input: string, pos?: number, options?: Options): ESTree.Expression;
- // todo: here the tokenizer function returns a Parser instance, that is targeting the detail of
- // Parser prototype. Someone need this please reade README.md first.
- // function tokenizer(options: Options, input: string): Parser;
+ interface ITokenizer {
+ getToken() : Token,
+ [Symbol.iterator](): Iterator
+ }
+
+ function tokenizer(input: string, options: Options): ITokenizer;
let parse_dammit: IParse | undefined;
let LooseParser: ILooseParserClass | undefined;
diff --git a/amplify/amplify-tests.ts b/amplify/amplify-tests.ts
index edf2988122..b4f98ccd5b 100644
--- a/amplify/amplify-tests.ts
+++ b/amplify/amplify-tests.ts
@@ -1,6 +1,3 @@
-
-///
-
import amplify = require("amplify");
// Copied examples directly from AmplifyJs site
diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts b/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts
index 4ff5b4cf19..1efc5d0391 100644
--- a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts
+++ b/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts
@@ -1,6 +1,3 @@
-///
-///
-
var myApp = angular.module('testModule');
interface MyAppScope extends ng.IScope {
diff --git a/angular-dynamic-locale/angular-dynamic-locale-tests.ts b/angular-dynamic-locale/angular-dynamic-locale-tests.ts
index fd88de0d25..1e30aafd94 100644
--- a/angular-dynamic-locale/angular-dynamic-locale-tests.ts
+++ b/angular-dynamic-locale/angular-dynamic-locale-tests.ts
@@ -15,6 +15,9 @@ class LocaleTestController {
var newLocale = "mt"
tmhDynamicLocaleService.set(newLocale);
+
+ newLocale = "en";
+ tmhDynamicLocaleService.set(newLocale).then((value) => {});
}
}
diff --git a/angular-dynamic-locale/index.d.ts b/angular-dynamic-locale/index.d.ts
index 788c3ad87b..4ee0e6eb89 100644
--- a/angular-dynamic-locale/index.d.ts
+++ b/angular-dynamic-locale/index.d.ts
@@ -11,7 +11,7 @@ declare module 'angular' {
export namespace dynamicLocale {
interface tmhDynamicLocaleService {
- set(locale: string): void;
+ set(locale: string): angular.IPromise;
get(): string;
}
diff --git a/angular-feature-flags/angular-feature-flags-tests.ts b/angular-feature-flags/angular-feature-flags-tests.ts
index 8ca17e4962..ac956dd657 100644
--- a/angular-feature-flags/angular-feature-flags-tests.ts
+++ b/angular-feature-flags/angular-feature-flags-tests.ts
@@ -1,5 +1,3 @@
-///
-
import * as angular from "angular";
let myApp = angular.module('myApp', ['feature-flags']);
diff --git a/angular-hotkeys/angular-hotkeys-tests.ts b/angular-hotkeys/angular-hotkeys-tests.ts
index 1f87ecefdf..c0bd9b974d 100644
--- a/angular-hotkeys/angular-hotkeys-tests.ts
+++ b/angular-hotkeys/angular-hotkeys-tests.ts
@@ -1,5 +1,3 @@
-///
-
var scope: ng.IScope;
var hotkeyProvider: ng.hotkeys.HotkeysProvider;
var hotkeyObj: ng.hotkeys.Hotkey;
diff --git a/angular-jwt/angular-jwt-tests.ts b/angular-jwt/angular-jwt-tests.ts
index b20b2eea9d..88b177ba74 100644
--- a/angular-jwt/angular-jwt-tests.ts
+++ b/angular-jwt/angular-jwt-tests.ts
@@ -1,5 +1,3 @@
-///
-
var app = angular.module("angular-jwt-tests", ["angular-jwt"]);
var $jwtHelper: ng.jwt.IJwtHelper;
diff --git a/angular-modal/angular-modal-tests.ts b/angular-modal/angular-modal-tests.ts
index 5be313840b..edb4d7e6ef 100644
--- a/angular-modal/angular-modal-tests.ts
+++ b/angular-modal/angular-modal-tests.ts
@@ -1,5 +1,3 @@
-///
-
var btfModal: angularModal.AngularModalFactory;
// Using template URL
diff --git a/angular-oauth2/angular-oauth2-tests.ts b/angular-oauth2/angular-oauth2-tests.ts
new file mode 100644
index 0000000000..042fe537aa
--- /dev/null
+++ b/angular-oauth2/angular-oauth2-tests.ts
@@ -0,0 +1,10 @@
+import * as angular from 'angular';
+
+angular.module('angular-oauth2-test', ['angular-oauth2'])
+ .config(['OAuthProvider', (OAuthProvider: angular.oauth2.OAuthProvider) => {
+ OAuthProvider.configure({
+ baseUrl: 'https://api.website.com',
+ clientId: 'CLIENT_ID',
+ clientSecret: 'CLIENT_SECRET' // optional
+ });
+ }]);
\ No newline at end of file
diff --git a/angular-oauth2/index.d.ts b/angular-oauth2/index.d.ts
new file mode 100644
index 0000000000..e6b9592874
--- /dev/null
+++ b/angular-oauth2/index.d.ts
@@ -0,0 +1,49 @@
+// Type definitions for angular-oauth2 4.1
+// Project: https://github.com/oauthjs/angular-oauth2
+// Definitions by: Antério Vieira
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+import * as angular from 'angular';
+
+declare module 'angular' {
+ export namespace oauth2 {
+ interface OAuthConfig {
+ baseUrl: string;
+ clientId: string;
+ clientSecret?: string;
+ grantPath?: string;
+ revokePath?: string;
+ }
+
+ interface OAuthProvider {
+ configure(params: OAuthConfig): OAuthConfig;
+ }
+
+ interface Data {
+ username: string;
+ password: string;
+ }
+
+ interface OAuth {
+ isAuthenticated(): boolean;
+ getAccessToken(data: Data, options?: any): angular.IPromise;
+ getRefreshToken(data?: Data, options?: any): angular.IPromise;
+ revokeToken(data?: Data, options?: any): angular.IPromise;
+ }
+
+ interface OAuthTokenConfig {
+ name: string;
+ options: any;
+ }
+
+ interface OAuthTokenOptions {
+ secure: boolean;
+ }
+
+ interface OAuthTokenProvider {
+ configure(params: OAuthTokenConfig): OAuthTokenConfig;
+ }
+
+ }
+}
+
diff --git a/angular-oauth2/tsconfig.json b/angular-oauth2/tsconfig.json
new file mode 100644
index 0000000000..e8a5250748
--- /dev/null
+++ b/angular-oauth2/tsconfig.json
@@ -0,0 +1,24 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "target": "es6",
+ "lib": [
+ "es6",
+ "dom"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "angular-oauth2-tests.ts"
+ ]
+}
diff --git a/fine-uploader/tslint.json b/angular-oauth2/tslint.json
similarity index 100%
rename from fine-uploader/tslint.json
rename to angular-oauth2/tslint.json
diff --git a/angular/angular-tests.ts b/angular/angular-tests.ts
index 4e1f33ce47..b4e394aa37 100644
--- a/angular/angular-tests.ts
+++ b/angular/angular-tests.ts
@@ -587,7 +587,8 @@ namespace TestPromise {
function test_angular_forEach() {
const values: { [key: string]: string } = { name: 'misko', gender: 'male' };
const log: string[] = [];
- angular.forEach(values, (value, key) => {
+ angular.forEach(values, (value, key, obj) => {
+ obj[key] = value;
this.push(key + ': ' + value);
}, log);
// expect(log).toEqual(['name: misko', 'gender: male']);
diff --git a/angular/index.d.ts b/angular/index.d.ts
index bbbbdb021a..5d47751844 100644
--- a/angular/index.d.ts
+++ b/angular/index.d.ts
@@ -97,7 +97,7 @@ declare namespace angular {
* @param iterator Iterator function.
* @param context Object to become context (this) for the iterator function.
*/
- forEach(obj: T[], iterator: (value: T, key: number) => any, context?: any): any;
+ forEach(obj: T[], iterator: (value: T, key: number, obj: T[]) => void, context?: any): T[];
/**
* Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
*
@@ -107,7 +107,7 @@ declare namespace angular {
* @param iterator Iterator function.
* @param context Object to become context (this) for the iterator function.
*/
- forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string) => any, context?: any): any;
+ forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string, obj: { [index: string]: T; }) => void, context?: any): { [index: string]: T; };
/**
* Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional.
*
@@ -117,7 +117,7 @@ declare namespace angular {
* @param iterator Iterator function.
* @param context Object to become context (this) for the iterator function.
*/
- forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any;
+ forEach(obj: any, iterator: (value: any, key: any, obj: any) => void, context?: any): any;
fromJson(json: string): any;
identity(arg?: T): T;
@@ -1332,9 +1332,19 @@ declare namespace angular {
// see http://docs.angularjs.org/api/ng.$controller
// see http://docs.angularjs.org/api/ng.$controllerProvider
///////////////////////////////////////////////////////////////////////////
+
+ /**
+ * The minimal local definitions required by $controller(ctrl, locals) calls.
+ */
+ interface IControllerLocals {
+ $scope: ng.IScope;
+ $element: JQuery;
+ }
+
interface IControllerService {
// Although the documentation doesn't state this, locals are optional
(controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T;
+ (controllerConstructor: Function, locals?: IControllerLocals, later?: boolean, ident?: string): T;
(controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T;
(controllerName: string, locals?: any, later?: boolean, ident?: string): T;
}
diff --git a/antd/antd-tests.tsx b/antd/antd-tests.tsx
deleted file mode 100644
index 1319455e91..0000000000
--- a/antd/antd-tests.tsx
+++ /dev/null
@@ -1,483 +0,0 @@
-///
-
-/*import {
- Affix,
- Button,
- Alert,
- Badge,
- Breadcrumb,
- Calendar,
- Carousel,
- Cascader,
- Checkbox,
- Collapse,
- DatePicker,
- Dropdown,
- Icon,
- Form,
- Input,
- InputNumber,
- Row,
- Col,
- Menu,
- message,
- Modal,
- notification,
- Pagination,
- Popconfirm,
- Popover,
- Progress,
- QueueAnim,
- Radio,
- Select,
- Slider,
- Spin,
- Steps,
- Switch,
- Table,
- Tabs,
- Tag,
- TimePicker,
- Timeline,
- Tooltip,
- Transfer,
- Tree,
- TreeSelect,
- Upload,
-
-
-
-} from 'antd';*/
-
-import * as React from 'react'
-import Affix from 'antd/lib/Affix'
-import Button from 'antd/lib/Button'
-import Alert from 'antd/lib/Alert'
-import Badge from 'antd/lib/Badge'
-import Breadcrumb from 'antd/lib/Breadcrumb'
-import Calendar from 'antd/lib/Calendar'
-import Carousel from 'antd/lib/Carousel'
-import Cascader from 'antd/lib/Cascader'
-import Checkbox from 'antd/lib/Checkbox'
-import Collapse from 'antd/lib/Collapse'
-import DatePicker from 'antd/lib/DatePicker'
-import Dropdown from 'antd/lib/Dropdown'
-import Icon from 'antd/lib/Icon'
-import Form from 'antd/lib/Form'
-import Input from 'antd/lib/Input'
-import InputNumber from 'antd/lib/InputNumber'
-import Row from 'antd/lib/Row'
-import Col from 'antd/lib/Col'
-import Menu from 'antd/lib/Menu'
-import message from 'antd/lib/message'
-import Modal from 'antd/lib/Modal'
-import notification from 'antd/lib/notification'
-import Pagination from 'antd/lib/Pagination'
-import Popconfirm from 'antd/lib/Popconfirm'
-import Popover from 'antd/lib/Popover'
-import Progress from 'antd/lib/Progress'
-import QueueAnim from 'antd/lib/QueueAnim'
-import Radio from 'antd/lib/Radio'
-import Select from 'antd/lib/Select'
-import Slider from 'antd/lib/Slider'
-import Spin from 'antd/lib/Spin'
-import Steps from 'antd/lib/Steps'
-import Switch from 'antd/lib/Switch'
-import Table from 'antd/lib/Table'
-import Tabs from 'antd/lib/Tabs'
-import Tag from 'antd/lib/Tag'
-import TimePicker from 'antd/lib/TimePicker'
-import Timeline from 'antd/lib/Timeline'
-import Tooltip from 'antd/lib/Tooltip'
-import Transfer from 'antd/lib/Transfer'
-import Tree from 'antd/lib/Tree'
-import TreeSelect from 'antd/lib/TreeSelect'
-import Upload from 'antd/lib/Upload'
-
-const ButtonGroup = Button.Group;
-const CheckboxGroup = Checkbox.Group;
-const Panel = Collapse.Panel;
-const RangePicker = DatePicker.RangePicker;
-const MonthPicker = DatePicker.MonthPicker;
-const DropdownButton = Dropdown.Button;
-const SubMenu = Menu.SubMenu;
-const MenuItemGroup = Menu.ItemGroup;
-const ProgressCircle = Progress.Circle;
-const ProgressLine = Progress.Line;
-const RadioGroup = Radio.Group;
-const Option = Select.Option;
-const OptGroup = Select.OptGroup;
-const Step = Steps.Step;
-const FormItem = Form.Item;
-const TabPane = Tabs.TabPane;
-const TreeNode = Tree.TreeNode;
-const TreeSelectTreeNode = TreeSelect.TreeNode;
-
-const onChange = () => { }
-
-const options = [{
- value: 'zhejiang',
- label: '浙江',
- children: [{
- value: 'hangzhou',
- label: '杭州',
- children: [{
- value: 'xihu',
- label: '西湖',
- }],
- }],
-}, {
- value: 'jiangsu',
- label: '江苏',
- children: [{
- value: 'nanjing',
- label: '南京',
- children: [{
- value: 'zhonghuamen',
- label: '中华门',
- }],
- }],
- }];
-
-const columns = [{
- title: '姓名',
- dataIndex: 'name',
- key: 'name',
- render(text: any) {
- return {text};
- }
-}, {
- title: '年龄',
- dataIndex: 'age',
- key: 'age',
- }, {
- title: '住址',
- dataIndex: 'address',
- key: 'address',
- }, {
- title: '操作',
- key: 'operation',
- render(text: any, record: any) {
- return (
-
- 操作一{record.name}
-
- 操作二
-
-
- 更多
-
-
- );
- }
- }];
-const data = [{
- key: '1',
- name: '胡彦斌',
- age: 32,
- address: '西湖区湖底公园1号'
-}, {
- key: '2',
- name: '胡彦祖',
- age: 42,
- address: '西湖区湖底公园1号'
- }, {
- key: '3',
- name: '李大嘴',
- age: 32,
- address: '西湖区湖底公园1号'
- }];
-
-// tests
-class AccountForm extends React.Component{
- render() {
- const { getFieldProps } = this.props.form;
- return (
-
- );
- }
-}
-
-var Account = Form.create()(AccountForm);
-
-// app
-class App extends React.Component{
- render() {
- message.success('success')
- message.config({ top: 100 })
- message.destroy()
- message.info('info', 1000)
- message.error('error', 3500)
-
- Modal.info({ title: 'hello' });
- Modal.success({ cancelText: 'No' })
- notification.success({
- message: 'hello',
- description: 'test'
- })
- const props = {
- name: 'file',
- action: '/upload.do',
- onChange(info: any) {
- if (info.file.status !== 'uploading') {
- console.log(info.file, info.fileList);
- }
- if (info.file.status === 'done') {
- message.success(`${info.file.name} 上传成功。`);
- } else if (info.file.status === 'error') {
- message.error(`${info.file.name} 上传失败。`);
- }
- }
- };
- return
-
Affix
-
-
- test
-
-
-
-
-
-
-
-
-
-
-
- 首页
- 应用中心
- 应用列表
- 某应用
-
-
-
-
-
- 1
- 2
- 3
- 4
-
-
-
-
-
-
-
- test1
-
-
- test2
-
-
- test3
-
-
-
-
-
- Hello Dp }>
-
- 触发链接
-
-
- dpb
} type="primary">
- 某功能按钮
-
-
-
-
-
-
-
-
-
-
-
- ,
-
-
- remove
-
- Overlay} title="title">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- demo1
- demo2
- demo3
- demo4
-
-
-
- A
- B
- C
- D
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ,
-
-
-
- 选项卡一内容
- 选项卡二内容
- 选项卡三内容
-
-
- 标签一
- 标签二
- { } }>标签三
- 标签四(链接)
-
-
-
-
-
- 创建服务现场 2015-09-01
- 初步排除网络异常 2015-09-01
- 技术测试异常 2015-09-01
- 网络异常正在修复 2015-09-01
-
-
-
-
- 鼠标移上来就会出现提示
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- sss} key="0-0-1-0" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- sss} key="random3" />
-
-
-
-
-
- }
-}
diff --git a/antd/index.d.ts b/antd/index.d.ts
deleted file mode 100644
index f262eda45f..0000000000
--- a/antd/index.d.ts
+++ /dev/null
@@ -1,2083 +0,0 @@
-// Type definitions for Antd v0.12.10
-// Project: http://ant.design
-// Definitions by: bang88 , Bruce Mitchener
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// TypeScript Version: 2.1
-
-///
-
-declare namespace Antd {
- // Affix
- interface AffixProps {
- /**
- * 达到指定偏移量后触发
- */
- offset?: number
- }
- /**
- * # Affix
- * 将页面元素钉在可视范围。
- * ## 何时使用
- * 当内容区域比较长,需要滚动页面时,这部分内容对应的操作或者导航需要在滚动范围内始终展现。常用于侧边菜单和按钮组合。
- * 页面可视范围过小时,慎用此功能以免遮挡页面内容。
- */
- export class Affix extends React.Component {
- render(): JSX.Element
- }
-
-
- // Alert
- interface AlertProps {
- /**
- * 必选参数,指定警告提示的样式,有四种选择`success`、`info`、`warn`、`error`
- */
- type: string,
- /**可选参数,默认不显示关闭按钮 */
- closable?: boolean,
- /**可选参数,自定义关闭按钮 */
- closeText?: React.ReactNode,
- /**必选参数,警告提示内容 */
- message: React.ReactNode,
- /**可选参数,警告提示的辅助性文字介绍 */
- description?: React.ReactNode,
- /**可选参数,关闭时触发的回调函数 */
- onClose?: Function,
- /**可选参数,是否显示辅助图标 */
- showIcon?: boolean
- }
-
-
- /**
- * # Alert
- * 警告提示,展现需要关注的信息。
-
- * ## 何时使用
-
- * - 当某个页面需要向用户显示警告的信息时。
- * - 非浮层的静态展现形式,始终展现,不会自动消失,用户可以点击关闭。
- * */
- export class Alert extends React.Component {
- render(): JSX.Element
- }
-
-
- // Badge
- /**
- * #Badge
- *
- * 图标右上角的圆形徽标数字。
-
- * ## 何时使用
-
- * 一般出现在通知图标或头像的右上角,用于显示需要处理的消息条数,通过醒目视觉形式吸引用户处理。
- *
- */
- export class Badge extends React.Component {
- render(): JSX.Element
- }
- interface BadgeProps {
- /** 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏*/
- count: number,
- /** 展示封顶的数字值*/
- overflowCount?: number,
- /** 不展示数字,只有一个小红点*/
- dot?: boolean
- }
-
-
- // Button
- interface ButtonProps {
- /** 设置按钮类型,可选值为 `primary` `ghost` 或者不设 */
- type?: ButtonType | string,
- /** 设置按钮形状,可选值为 `circle` `circle-outline` 或者不设*/
- shape?: string,
- /** 设置按钮大小,可选值为 `small` `large` 或者不设*/
- size?: string,
- /** 设置 `button` 原生的 `type` 值,可选值请参考 HTML标准*/
- htmlType?: string,
- /** `click` 事件的 handler*/
- onClick?: Function,
- /** 设置按钮载入状态*/
- loading?: boolean,
- /** 样式名*/
- className?: string,
- }
-
-
- enum ButtonType {
- primary,
- ghost,
- dashed
- }
-
- interface ButtonGroupProps {
- /** 设置按钮大小,可选值为 `small` `large` 或者不设*/
- size?: string
-
- }
-
- /**
- 可以将多个 `Button` 放入 `Button.Group` 的容器中。
-
- 通过设置 `size` 为 `large` `small` 分别把按钮组合设为大、小尺寸。若不设置 `size`,则尺寸为中。*/
- class ButtonGroup extends React.Component {
- render(): JSX.Element
- }
-
- /**
- * #Button
- 按钮用于开始一个即时操作。
-
- ## 何时使用
-
- 标记了一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。*/
- export class Button extends React.Component {
- static Group: typeof ButtonGroup
- render(): JSX.Element
- }
-
-
-
- // Breadcrumb
-
- interface BreadcrumbItemProps {
- /** 链接,如不传则不可点击 */
- href?: string
- }
- export class BreadcrumbItem extends React.Component {
- render(): JSX.Element
- }
-
- interface BreadcrumbProps {
- /** router 的路由栈信息 */
- routes?: Array,
- /** 路由的参数*/
- params?: Object,
- /** 分隔符自定义*/
- separator?: string | React.ReactNode
- }
- /**
- * #Breadcrumb
- 显示当前页面在系统层级结构中的位置,并能向上返回。
-
- ## 何时使用
-
- - 当系统拥有超过两级以上的层级结构时;
- - 当需要告知用户“你在哪里”时;
- - 当需要向上导航的功能时。*/
- export class Breadcrumb extends React.Component {
- static Item: typeof BreadcrumbItem
- render(): JSX.Element
- }
-
-
- // Calendar
- interface CalendarProps {
- /** 自定义渲染月单元格*/
- monthCellRender?: Function,
- /** 自定义渲染日期单元格*/
- dateCellRender?: Function,
- /** 是否全屏显示*/
- fullscreen?: boolean,
- /** 国际化配置*/
- locale?: Object,
- prefixCls?: string,
- className?: string,
- style?: Object,
- /** 日期面板变化回调*/
- onPanelChange?: Function,
- /** 展示日期*/
- value?: Date,
- /** 默认展示日期*/
- defaultValue?: Date,
- /** 初始模式,`month/year`*/
- mode?: string
- }
- /**
- * #Calendar
- 按照日历形式展示数据的容器。
-
- ## 何时使用
-
- 当数据是日期或按照日期划分时,例如日程、课表、价格日历等,农历等。目前支持年/月切换。
- */
- export class Calendar extends React.Component {
- render(): JSX.Element
- }
-
-
- // Carousel
- interface CarouselProps {
- /** 动画效果函数,可取 scrollx, fade*/
- effect?: string,
- /** 是否显示面板指示点*/
- dots?: boolean,
- /** 垂直显示*/
- vertical?: boolean,
- /** 是否自动切换*/
- autoplay?: boolean,
- /** 动画效果*/
- easing?: string,
- /** 切换面板的回调*/
- beforeChange?: Function,
- /** 切换面板的回调*/
- afterChange?: Function
- }
- /**
- * #Carousel
- 旋转木马,一组轮播的区域。
-
- ## 何时使用
-
- - 当有一组平级的内容。
- - 当内容空间不足时,可以用走马灯的形式进行收纳,进行轮播展现。
- - 常用于一组图片或卡片轮播。
- */
- export class Carousel extends React.Component {
- render(): JSX.Element
- }
-
-
-
- // Cascader
- interface CascaderProps {
- /** 可选项数据源*/
- options: Object,
- /** 默认的选中项*/
- defaultValue?: Array,
- /** 指定选中项*/
- value?: Array,
- /** 选择完成后的回调*/
- onChange?: Function,
- /** 选择后展示的渲染函数*/
- displayRender?: Function,
- /** 自定义样式*/
- style?: Object,
- /** 自定义类名*/
- className?: string,
- /** 自定义浮层类名*/
- popupClassName?: string,
- /** 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` */
- popupPlacement?: string,
- /** 输入框占位文本*/
- placeholder?: string,
- /** 输入框大小,可选 `large` `default` `small` */
- size?: string,
- /** 禁用*/
- disabled?: boolean,
- /** 是否支持清除*/
- allowClear?: boolean
-
- }
- /**
- * #Cascader
- 级联选择框。
-
-
- ## 何时使用
-
- - 需要从一组相关联的数据集合进行选择,例如省市区,公司层级,事物分类等。
- - 从一个较大的数据集合中进行选择时,用多级分类进行分隔,方便选择。
- - 比起 Select 组件,可以在同一个浮层中完成选择,有较好的体验。*/
- export class Cascader extends React.Component {
- render(): JSX.Element
- }
-
-
-
-
- // Checkbox
- interface CheckboxProps {
- /** 指定当前是否选中*/
- checked?: boolean,
- /** 初始是否选中*/
- defaultChecked?: boolean,
- /** 变化时回调函数*/
- onChange?: Function
- }
-
- interface CheckboxGroupProps {
- /** 默认选中的选项*/
- defaultValue?: Array,
- /** 指定选中的选项*/
- value?: Array,
- /** 指定可选项*/
- options?: Array,
- /** 变化时回调函数*/
- onChange?: Function
- }
- /** Checkbox 组*/
- class CheckboxGroup extends React.Component {
- render(): JSX.Element
- }
- /**
- * #Checkbox
- 多选框。
-
- ## 何时使用
-
- - 在一组可选项中进行多项选择时;
- - 单独使用可以表示两种状态之间的切换,和 `switch` 类似。区别在于切换 `switch` 会直接触发状态改变,而 `checkbox` 一般用于状态标记,需要和提交操作配合。
- */
- export class Checkbox extends React.Component {
- static Group: typeof CheckboxGroup
- render(): JSX.Element
- }
-
-
-
- // Collapse
-
- interface CollapseProps {
- /** 当前激活 tab 面板的 key*/
- activeKey?: Array | string,
- /** 初始化选中面板的key */
- defaultActiveKey?: Array,
- /** 切换面板的回调*/
- onChange?: Function
-
- }
- class CollapsePanel extends React.Component<{
- /** 对应 activeKey */
- key: string,
- /** 面板头内容*/
- header: React.ReactNode | string
- }, {}> {
- render(): JSX.Element
- }
- /**
- * #Collapse
- 可以折叠/展开的内容区域。
-
- ## 何时使用
-
- - 对复杂区域进行分组和隐藏,保持页面的整洁。
- - `手风琴` 是一种特殊的折叠面板,只允许单个内容区域展开。*/
- export class Collapse extends React.Component {
- static Panel: typeof CollapsePanel
- render(): JSX.Element
- }
-
-
-
- // DatePicker
- interface DatePickerProps {
-
- value?: string | Date,
- defaultValue?: string | Date,
- /** 展示的日期格式,配置参考 [GregorianCalendarFormat](https://github.com/yiminghe/gregorian-calendar-format)*/
- format?: string,
- /** 不可选择的日期*/
- disabledDate?: Function,
- /** 时间发生变化的回调,发生在用户选择时间时*/
- onChange?: Function,
- /** 禁用*/
- disabled?: boolean,
- style?: Object,
- /** 格外的弹出日历样式*/
- popupStyle?: Object,
- /** 输入框大小,`large` 高度为 32px,`small` 为 22px,默认是 28px*/
- size?: string,
- /** 国际化配置*/
- locale?: Object,
- /** 增加时间选择功能*/
- showTime?: boolean,
- /** 点击确定按钮的回调*/
- onOk?: Function,
- /** 定义浮层的容器,默认为 body 上新建 div*/
- getCalendarContainer?: Function
-
- }
- interface RangePickProps extends DatePickerProps {
-
- }
- class RangePicker extends React.Component {
- render(): JSX.Element
- }
- class MonthPicker extends React.Component {
- render(): JSX.Element
- }
- /**
- * #DatePicker
- 输入或选择日期的控件。
-
- ## 何时使用
-
- 当用户需要输入一个日期,可以点击标准输入框,弹出日期面板进行选择。*/
- export class DatePicker extends React.Component, {}> {
- static RangePicker: typeof RangePicker
- static MonthPicker: typeof MonthPicker
- render(): JSX.Element
- }
-
-
-
-
- // Dropdown
-
- interface DropdownProps {
- /** 触发下拉的行为 ['click'] or ['hover']*/
- trigger?: Array,
- /** 菜单节点*/
- overlay: React.ReactNode
-
- }
-
- class DropdownButton extends React.Component<{
- /** 按钮类型*/
- type?: string,
- /** 点击左侧按钮的回调*/
- onClick?: Function,
- /** 触发下拉的行为*/
- trigger?: string,
- /** 菜单节点*/
- overlay: React.ReactNode
- }, {}> {
- render(): JSX.Element
- }
- /**
- * #Dropdown
- 向下弹出的列表。
-
- ## 何时使用
-
- 当页面上的操作命令过多时,用此组件可以收纳操作元素。点击或移入触点,会出现一个下拉菜单。可在列表中进行选择,并执行相应的命令。
- */
- export class Dropdown extends React.Component {
- static Button: typeof DropdownButton
- render(): JSX.Element
- }
-
-
-
- // Form
-
- interface FormItemProps {
- prefixCls?: string,
- /** label 标签的文本*/
- label?: React.ReactNode,
- /** label 标签布局,通 `` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}`*/
- labelCol?: Object,
- /** 提示信息,如不设置,则会根据校验规则自动生成 */
- help?: React.ReactNode | boolean,
- /** 额外的提示信息,和 help 类似,当需要错误信息和提示文案同时出现时,可以使用这个。*/
- extra?: string,
- /** 是否必填,如不设置,则会根据校验规则自动生成 */
- validateStatus?: string,
- /** 配合 validateStatus 属性使用,是否展示校验状态图标 */
- hasFeedback?: boolean,
- /** 需要为输入控件设置布局样式时,使用该属性,用法同 labelCol*/
- wrapperCol?: Object,
- className?: string,
- required?: boolean,
- id?: string
- }
- /**
- 表单一定会包含表单域,表单域可以是输入控件,标准表单域,标签,下拉菜单,文本域等。
-
- 这里我们分别封装了表单域 `` 和输入控件 ``。*/
- export class FormItem extends React.Component {
- render(): JSX.Element
- }
- interface FormComponentProps {
- form: CreateFormOptions
- }
- export class FormComponent extends React.Component {
- render(): JSX.Element
- }
-
- // function create
- type CreateFormOptions = {
- /** 获取一组输入控件的值,如不传入参数,则获取全部组件的值*/
- getFieldsValue(): (fieldNames?: Array) => any
- /** 获取一个输入控件的值*/
- getFieldValue(): (fieldName: string) => any
- /** 设置一组输入控件的值*/
- setFieldsValue(): (obj: Object) => void
- /** 设置一组输入控件的值*/
- setFields(): (obj: Object) => void
- /** 校验并获取一组输入域的值与 Error*/
- validateFields(): (fieldNames?: Array, options?: Object, callback?: (erros: any, values: any) => void) => any
- /** 与 `validateFields` 相似,但校验完后,如果校验不通过的菜单域不在可见范围内,则自动滚动进可见范围 */
- validateFieldsAndScroll(): (fieldNames?: Array, options?: Object, callback?: (erros: any, values: any) => void) => any
- /** 获取某个输入控件的 Error */
- getFieldError(): (name: string) => Object
- /** 判断一个输入控件是否在校验状态*/
- isFieldValidating(): (name: string) => Object
- /**重置一组输入控件的值与状态,如不传入参数,则重置所有组件*/
- resetFields(): (names?: Array) => void
-
- getFieldsValue(): (id: string, options: {
- /** 子节点的值的属性,如 Checkbox 的是 'checked'*/
- valuePropName?: string,
- /** 子节点的初始值,类型、可选值均由子节点决定*/
- initialValue?: any,
- /** 收集子节点的值的时机*/
- trigger?: string,
- /** 校验子节点值的时机*/
- validateTrigger?: string,
- /** 校验规则,参见 [async-validator](https://github.com/yiminghe/async-validator) */
- rules?: Array,
- /** 必填输入控件唯一标志*/
- id?: string
- }) => Array
-
-
- }
-
- interface ComponentDecorator {
- (component: T): T;
- }
- interface FormProps {
- prefixCls?: string,
- /** 水平排列布局*/
- horizontal?: boolean,
- /** 行内排列布局*/
- inline?: boolean,
- /** 经 `Form.create()` 包装过的组件会自带 `this.props.form` 属性,直接传给 Form 即可*/
- form?: Object,
- /** 数据验证成功后回调事件*/
- onSubmit?: (e: React.FormEvent