Skip to content

Antd typescript support #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"frontend"
],
"main": "dist/antd.min.js",
"typings": "types/index.d.ts",
"files": [
"dist",
"lib",
Expand Down
27 changes: 27 additions & 0 deletions types/affix.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types

import { AntdComponent } from './component';

export declare class Affix extends AntdComponent {
/**
* Pixels to offset from top when calculating position of scroll
* @default 0
* @type number
*/
offsetTop: number;

/**
* Pixels to offset from bottom when calculating position of scroll
* @type number
*/
offsetBottom: number;

/**
* specifies the scrollable area dom node
* @default () => window
* @type Function
*/
target: () => HTMLElement;
}
64 changes: 64 additions & 0 deletions types/alert.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types

import { AntdComponent } from './component';

export declare class Alert extends AntdComponent {
/**
* Called when close animation is finished
* @type Function
*/
afterClose: () => void;

/**
* Whether to show as banner
* @default false
* @type boolean
*/
banner: boolean;

/**
* Whether Alert can be closed
* @type boolean
*/
closable: boolean;

/**
* Close text to show
* @type any (string | slot)
*/
closeText: any;

/**
* additional content of Alert
* @type any (string | slot)
*/
description: any;

/**
* Custom icon, effective when showIcon is true
* @type any (VNode | slot)
*/
icon: any;

/**
* Content of Alert
* @type any (string | slot)
*/
message: any;

/**
* Whether to show icon
* @default false, in banner mode default is true
* @type boolean
*/
showIcon: boolean;

/**
* Type of Alert styles, options: success, info, warning, error
* @default info, in banner mode default is warning
* @type string
*/
type: "success" | "info" | "warning" | "error";
}
19 changes: 19 additions & 0 deletions types/anchor/anchor-link.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types

import { AntdComponent } from "../component";

export declare class AnchorLink extends AntdComponent {
/**
* target of hyperlink
* @type string
*/
href: string;

/**
* content of hyperlink
* @type any (string | slot)
*/
title: any;
}
51 changes: 51 additions & 0 deletions types/anchor/anchor.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types

import { AntdComponent } from '../component';
import { AnchorLink } from "./anchor-link";

export declare class Anchor extends AntdComponent {
static Link: AnchorLink;

/**
* Fixed mode of Anchor
* @default true
* @type boolean
*/
affix: boolean;

/**
* Bounding distance of anchor area
* @default 5
* @type number
*/
bounds: number;

/**
* Scrolling container
* @default () => window
* @type Function
*/
getContainer: () => HTMLElement;

/**
* Pixels to offset from bottom when calculating position of scroll
* @type number
*/
offsetBottom: number;

/**
* Pixels to offset from top when calculating position of scroll
* @default 0
* @type number
*/
offsetTop: number;

/**
* Whether show ink-balls in Fixed mode
* @default false
* @type boolean
*/
showInkInFixed: boolean;
}
127 changes: 127 additions & 0 deletions types/ant-design-vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types

import Vue from "vue";

import { Affix } from "./affix";
import { Anchor } from "./anchor/anchor";
import { AutoComplete } from "./auto-complete";
import { Alert } from "./alert";
import { Avatar } from "./avatar";
import { BackTop } from "./back-top";
import { Badge } from "./badge";
import { Breadcrumb } from "./breadcrumb";
import { Button } from "./button/button";
import { Calendar } from "./calendar";
import { Card } from "./card";
import { Collapse } from "./collapse/collapse";
import { Carousel } from "./carousel";
import { Cascader } from "./cascader";
import { Checkbox } from "./checkbox/checkbox";
import { Col } from "./grid/col";
import { DatePicker } from "./date-picker/date-picker";
import { Divider } from "./divider";
import { Dropdown } from "./dropdown/dropdown";
import { Form } from "./form/form";
import { Icon } from "./icon";
import { Input } from "./input/input";
import { InputNumber } from "./input-number";
import { Layout } from "./layout/layout";
import { List } from "./list/list";
import { LocaleProvider } from "./locale-provider";
import { Message } from "./message";
import { Menu } from "./menu/menu";
import { Modal } from "./modal";
import { Notification } from "./notification";
import { Pagination } from "./pagination";
import { Popconfirm } from "./popconfirm";
import { Popover } from "./popover";
import { Progress } from "./progress";
import { Radio } from "./radio/radio";
import { Rate } from "./rate";
import { Row } from "./grid/row";
import { Select } from "./select/select";
import { Slider } from "./slider";
import { Spin } from "./spin";
import { Steps } from "./steps/steps";
import { Switch } from "./switch";
import { Table } from "./table/table";
import { Transfer } from "./transfer";
import { Tree } from "./tree/tree";
import { TreeSelect } from "./tree-select";
import { Tabs } from "./tabs/tabs";
import { Tag } from "./tag/tag";
import { TimePicker } from "./time-picker";
import { Timeline } from "./timeline/timeline";
import { Tooltip } from "./tootip/tooltip";
import { Upload } from "./upload";
import { Drawer } from "./drawer";
import { Skeleton } from "./skeleton";

/**
* Install all ant-design-vue components into Vue.
* Please do not invoke this method directly.
* Call `Vue.use(Antd)` to install.
*/
export function install(vue: typeof Vue): void;

declare const message: Message;
declare const notification: Notification;

export {
Affix,
Anchor,
AutoComplete,
Alert,
Avatar,
BackTop,
Badge,
Breadcrumb,
Button,
Calendar,
Card,
Collapse,
Carousel,
Cascader,
Checkbox,
Col,
DatePicker,
Divider,
Dropdown,
Form,
Icon,
Input,
InputNumber,
Layout,
List,
LocaleProvider,
message,
Menu,
Modal,
notification,
Pagination,
Popconfirm,
Popover,
Progress,
Radio,
Rate,
Row,
Select,
Slider,
Spin,
Steps,
Switch,
Table,
Transfer,
Tree,
TreeSelect,
Tabs,
Tag,
TimePicker,
Timeline,
Tooltip,
Upload,
Drawer,
Skeleton
};
Loading