Skip to content

chore(types): update Layout types #2705

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 1 commit into from
Aug 19, 2020
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 .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ es/
lib/
_site/
dist/
types/
15 changes: 10 additions & 5 deletions types/layout/layout-content.d.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
import { CSSProperties } from 'vue';
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: Pythonfo <https://github.com/Pythonfo>
// Copy from: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types

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

export default class LayoutContent extends AntdComponent {
export interface LayoutContentProps {
/**
* container className
* @default undefined
* @type string
*/
class: string;
class?: string;

/**
* to customize the styles
* @type string | object
* @type CSSProperties
*/
style: string | object;
style?: CSSProperties;

/**
* whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
* @type boolean
*/
hasSider: boolean;
hasSider?: boolean;
}

export default class LayoutContent extends AntdComponent {
$props: LayoutContentProps;
}
15 changes: 10 additions & 5 deletions types/layout/layout-footer.d.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
import { CSSProperties } from 'vue';
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: Pythonfo <https://github.com/Pythonfo>
// Copy from: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types

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

export default class LayoutFooter extends AntdComponent {
export interface LayoutFooterProps {
/**
* container className
* @default undefined
* @type string
*/
class: string;
class?: string;

/**
* to customize the styles
* @type string | object
* @type CSSProperties
*/
style: string | object;
style?: CSSProperties;

/**
* whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
* @type boolean
*/
hasSider: boolean;
hasSider?: boolean;
}

export default class LayoutFooter extends AntdComponent {
$props: LayoutFooterProps;
}
15 changes: 10 additions & 5 deletions types/layout/layout-header.d.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
import { CSSProperties } from 'vue';
// Project: https://github.com/vueComponent/ant-design-vue
// Definitions by: Pythonfo <https://github.com/Pythonfo>
// Copy from: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types

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

export default class LayoutHeader extends AntdComponent {
export interface LayoutHeaderProps {
/**
* container className
* @default undefined
* @type string
*/
class: string;
class?: string;

/**
* to customize the styles
* @type string | object
* @type CSSProperties
*/
style: string | object;
style?: CSSProperties;

/**
* whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
* @type boolean
*/
hasSider: boolean;
hasSider?: boolean;
}

export default class LayoutHeader extends AntdComponent {
$props: LayoutHeaderProps;
}
33 changes: 19 additions & 14 deletions types/layout/layout-sider.d.ts
Original file line number Diff line number Diff line change
@@ -1,79 +1,84 @@
import { CSSProperties, Slot, VNodeChild } from 'vue';
// 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 LayoutSider extends AntdComponent {
export interface LayoutSiderProps {
/**
* container className
* @type string
*/
class: string;
class?: string;

/**
* whether can be collapsed
* @default false
* @type boolean
*/
collapsible: boolean;
collapsible?: boolean;

/**
* to set the current status
* @type boolean
*/
collapsed: boolean;
collapsed?: boolean;

/**
* to set the initial status
* @default false
* @type boolean
*/
defaultCollapsed: boolean;
defaultCollapsed?: boolean;

/**
* reverse direction of arrow, for a sider that expands from the right
* @default false
* @type boolean
*/
reverseArrow: boolean;
reverseArrow?: boolean;

/**
* to customize the styles
* @type object | string
* @type CSSProperties
*/
style: object | string;
style?: CSSProperties;

/**
* specify the customized trigger, set to null to hide the trigger
* @type string | slot
* @type string | | VNodeChild | JSX.Element
*/
trigger: any;
trigger?: string | VNodeChild | JSX.Element;

/**
* width of the sidebar
* @default 200
* @type number | string
*/
width: number | string;
width?: number | string;

/**
* width of the collapsed sidebar, by setting to 0 a special trigger will appear
* @default 80
* @type number
*/
collapsedWidth: number;
collapsedWidth?: number;

/**
* breakpoints of the responsive layout
* @type string
*/
breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';

/**
* color theme of the sidebar
* @default 'dark'
* @type string
*/
theme: 'light' | 'dark';
theme?: 'light' | 'dark';
}

export declare class LayoutSider extends AntdComponent {
$props: LayoutSiderProps;
}
25 changes: 15 additions & 10 deletions types/layout/layout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,34 @@ import { LayoutSider } from './layout-sider';
import LayoutHeader from './layout-header';
import LayoutContent from './layout-content';
import LayoutFooter from './layout-footer';
import { CSSProperties } from 'vue';

export declare class Layout extends AntdComponent {
static Header: typeof LayoutHeader;
static Content: typeof LayoutContent;
static Footer: typeof LayoutFooter;
static Sider: typeof LayoutSider;

export interface LayoutProps {
/**
* container className
* @default undefined
* @type string
*/
class: string;
class?: string;

/**
* to customize the styles
* @type string | object
* @type CSSProperties
*/
style: string | object;
style?: CSSProperties;

/**
* whether contain Sider in children, don't have to assign it normally. Useful in ssr avoid style flickering
* @type boolean
*/
hasSider: boolean;
hasSider?: boolean;
}

export declare class Layout extends AntdComponent {
static Header: typeof LayoutHeader;
static Content: typeof LayoutContent;
static Footer: typeof LayoutFooter;
static Sider: typeof LayoutSider;

$props: LayoutProps;
}